[libvirt-users] How can I have more than one console/terminal windows when connecting to lxc

Daniel P. Berrange berrange at redhat.com
Wed Apr 30 10:05:55 UTC 2014

On Wed, Apr 30, 2014 at 03:51:24AM +0000, WANG Cheng D wrote:
> Dear all,
> I use virsh command to start a container and connect to it.
> When I use virsh -c lxc:/// console mycontainer, I only have one
> console. I wonder how to open multiple terminal windows for the
> same container.

There are two possible approaches. If you are running a full OS distro
inside the container and want to have mingetty login prompts on the
console devices, then you should simply add multiple <console> elements
to the guest XML. You can then use the --devname parameter to the
'virsh console' command to say which console you want to connect to.

If you just want to get a direct bash shell though, you can simply
join the namespace directly, as many times as you like with

 # virsh lxc-enter-namespace mycontainer /bin/sh

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

More information about the libvirt-users mailing list