[lxc-users] tmux in attached containers?

florent at peterschmitt.fr florent at peterschmitt.fr
Mon May 11 20:19:14 UTC 2015


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.


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


More information about the lxc-users mailing list