[Lxc-users] [systemd-devel] Unable to run systemd in an LXC / cgroup container.

John lxc at jelmail.com
Fri Dec 7 13:01:22 UTC 2012


> Quoting Michael H. Warfield (mhw at WittsEnd.com):
>   
>> You have to add an option to the config file for your systemd
>> containers.
>>
>> lxc.autodev = 1
>
I would like to understand a bit more about what this option does and 
learn the correct way of creating devices inside a container.

With autodev, if I understand correctly, LXC creates a 100Kb tmpfs for 
/dev, overmounting any existing /dev. it creates a pts subdirectory plus 
the devices listed in sutuct lxc_devs (src/lxc/conf.c) - null, zero, 
full, urandom, random, tty and console.

What do I do if I need more than those devices in /dev? To date, I have 
manually used mknod to create devices during the process of creating a 
rootfs (i.e. I create them beforehand, on the host). I see the comment 
in the source about providing a file, so I guess this is being thought 
about?

I like being able to do things in the main config file, so perhaps 
supporting options like "lxc.dev = name mask type maj min" ?

Also, I can't work out what the autodev option does that allows systemd 
to work ? It's a bit over my head but I'd like to understand if I can. 
What's the difference between /dev that is on the rootfs and a /dev that 
is created and over-mounted?

systemd inside container = issues so far:
- creating devices in /dev
- no vty devices (cannot use lxc-console)

Regards,
John






More information about the lxc-users mailing list