[lxc-users] Console issues

Peter Steele pwsteele at gmail.com
Fri Jan 29 19:04:07 UTC 2016


On 01/28/2016 03:25 PM, Peter Steele wrote:
> As I've explained in this mailing list before, I create my own custom 
> CentOS template that has some history, being initially used as a 
> template for KVM based virtual machines, then OpenVZ based containers, 
> then libvirt-lxc containers, and now finally we're tackling LXC. One 
> issue I've noted is that when I create a container using my custom 
> template lxc-console does not work. When I connect I get something 
> like this:
>
> # lxc-console -n vm-00
> Connected to tty 1
> Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a 
> itself
>
> and then at this point it basically hangs, just consuming whatever I 
> type but not attaching to the console and giving me feedback. If I use 
> same config file for the container but use the CentOS download 
> template instead, the console works as expected.
>
> In comparing the two cases, I've noticed that when I'm running with 
> the downloaded template, I get a set of five getty processes:
>
> # ps aux|grep agetty
> root        37  0.0  0.0   6452   800 pts/0    Ss+  22:45   0:00 
> /sbin/agetty --noclear --keep-baud pts/0 115200 38400 9600 vt220
> root        38  0.0  0.0   6452   796 pts/1    Ss+  22:45   0:00 
> /sbin/agetty --noclear --keep-baud pts/1 115200 38400 9600 vt220
> root        40  0.0  0.0   6452   804 pts/2    Ss+  22:45   0:00 
> /sbin/agetty --noclear --keep-baud pts/2 115200 38400 9600 vt220
> root        41  0.0  0.0   6452   808 pts/3    Ss+  22:45   0:00 
> /sbin/agetty --noclear --keep-baud pts/3 115200 38400 9600 vt220
> root        42  0.0  0.0   6452   796 lxc/console Ss+ 22:45   0:00 
> /sbin/agetty --noclear --keep-baud console 115200 38400 9600 vt220
>
> Using my own template, I only get a single console process:
>
> # ps aux|grep agetty
> root       279  0.0  0.0   6424   792 lxc/console Ss+ 13:57   0:00 
> /sbin/agetty --noclear --keep-baud console 115200 38400 9600
>
> If I go ahead and start the processes manually, then lxc-console 
> appears to work as expected. My question, what am I missing in my 
> template that causes this behavior, or more specifically, results in 
> the required agetty processes failing to start when the container is 
> started?

For what it's worth, this same container template works with libvirt_lxc 
as far as console access is concerned. Out of curiosity I also tried the 
OpenVZ container image for CentOS 7 (available online) and the console 
did not work with this image either. It *did* work with libvirt_lxc. So 
what's missing from these templates that LXC needs for enabling console 
access?

Peter



More information about the lxc-users mailing list