[Lxc-users] Regarding creating a LXC container in fedora 17

Shridhar Daithankar ghodechhap at ghodechhap.net
Sat May 18 18:32:47 UTC 2013


On Saturday, May 18, 2013 09:58:26 AM Michael H. Warfield wrote:
> On Sat, 2013-05-18 at 19:02 +0530, Ajith Adapa wrote:
> > Then I have started the container using below command and tried to
> > connect to its shell using lxc-console command but I ended up with
> > below message. Ideally I should see a prompt but its just hangs down
> > there. <Ctl+a q> works and nothing else.
> > 
> > [root at ipiblr ~]# lxc-start -n TEST -d
> > [root at ipiblr ~]# lxc-console -n TEST
> > 
> > Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a
> > itself
> 
> Oh, crap...  I keep forgetting about that (because I don't use it).
> That needs to be noted somewhere in the documentation.
> 
> That's yet another BAD decision on the part of the systemd crowd,
> lxc-console is probably not going to work, at least for the time being.
> They (systemd) intentionally, with documented malice a forethought,
> disable gettys on the vtys in the container if systemd detects that it's
> in a container.  However, /dev/console in the container is still active
> and is connected to lxc-start and I'm able to log in there but I have
> never gotten lxc-console to work with a systemd container and I don't
> know of anything I can do about it.  You would need some way to force
> the container to start gettys on the vtys.
> 
> Maybe, if I (or someone else) can figure out a way to do that (force the
> gettys to start on the vtys), it could be integrated into the Fedora
> template.  My patches for the autodev stuff (plus other stuff) have now
> been accepted and applied by Serge, so that's done.  Maybe I can look
> deeper into this morass now.

First of all, let me say thank you for your concise message upthread. It 
renewed my interest in lxc and I managed to get a working container for the 
first time. I will post a detailed HOWTO shortly.

I ran into the same lxc-console issue and managed to solve it by commenting 
out ConditionPathExists line in 
/etc/systemd/system/getty.target.wants/getty\@tty1.service

first I had to start the container in foreground, login, comment out 
aforementioned line and restart it in daemon mode. After that lxc-console 
worked.

If I changed the systemd unit from the chroot itself, it didn't reflect 
somehow. Also the line referred to /dev/tty0 but only /dev/tty and /dev/tty1 
were available in the container.

I don't understand systemd enough to comment on the reasons of it working or 
not-working. I just experimented around to get a working tty.

My environment is arch linux and the details are as follows.

kernel : 3.9.2-1 
systemd : 204-1
lxc : 1:0.9.0-2

HTH

-- 
Regards
 Shridhar




More information about the lxc-users mailing list