[lxc-users] tmux in attached containers?

Casey Marshall casey.marshall at canonical.com
Mon May 11 21:15:55 UTC 2015


On Mon, 11 May 2015 20:19:14 +0000
florent at peterschmitt.fr wrote:

> 11 mai 2015 20:40 "Casey Marshall" <casey.marshall at canonical.com> a écrit:
> > Hi,
> > How can I get tmux working in an attached LXC container?
> > 
> > I've tried using tmux in the shell with "lxc-attach", as well as with "lxc exec ... /bin/bash" with
> > the LXD client. It just exits rc=1.
> > 
> > I could install openssh-server inside the container, import my keys, etc. but that seems like
> > unnecessary overhead if I could just attach.
> > 
> > Is there something I can set up in the config or profile to get tmux working?
> > 
> > Thanks,
> > --
> > Casey Marshall <casey.marshall at canonical.com>
> 
> Hum. Just tried with a Debian Wheezy under LXC 1.1.2 (Ubuntu 15). Works like a charm.
> 
> lxc-attach -n pure-debian-7 tmux # insert bla bla here, detach tmux
> lxc-attach -n pure-debian-7 tmux a # attach without --clear-env
> lxc-attach -n pure-debian-7 --clear-env env TERM=xterm tmux a # attach with --clear-env, must set TERM variable.
> 

Oddly enough, the lxc-attach commands still don't work with my userspace containers, which isn't such a big deal. With my LXD client, "lxc exec juju-dev --env TERM=xterm tmux" works great. Thanks!

> 
> Maybe related to your container's OS and/or LXC version? Give more informations.

Should have been more clear. This was on a fresh install of Ubuntu 14.04.2 with packages from ppa:ubuntu-lxc/stable.

cmars at flatland:~$ dpkg -l | grep lxc
ii  liblxc1                                     1.1.2-0ubuntu3~ubuntu14.04.1~ppa1     amd64        Linux Containers userspace tools (library)
ii  lxc                                         1.1.2-0ubuntu3~ubuntu14.04.1~ppa1     amd64        Linux Containers userspace tools
ii  lxc-templates                               1.1.2-0ubuntu3~ubuntu14.04.1~ppa1     amd64        Linux Containers userspace tools (templates)
...

cmars at flatland:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.2 LTS
Release:	14.04
Codename:	trusty

cmars at flatland:~$ uname -a
Linux flatland 3.16.0-37-generic #51~14.04.1-Ubuntu SMP Wed May 6 15:23:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

-- 
Casey Marshall <casey.marshall at canonical.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150511/80c108af/attachment.sig>


More information about the lxc-users mailing list