Ultra-short LXC troubleshooting
Not mounting the directories
The sys_admin capability should be enabled in order for the filesystem to be mounted correctly when the container boots.
Not connecting to the console and respawing
The ttys should be allowed in the config file.
An example working config file can be found here
Looking at the file
rootfs/etc/inittab the tty device that is spawned after the initialization can be found. In order to start tty1 and tty2 something like this should exist:
1:2345:respawn:/sbin/getty 38400 tty1 2:23:respawn:/sbin/getty 38400 tty2
These ttys should also exist in the
roots/dev folder or should be created:
root@sth#mknod -m 660 dev/tty1 c 4 1 root@sth#mknod -m 660 dev/tty2 c 4 2
Then a connection to the console should be started:
lxc-console -n myfirstcontainer -t 2 # Number of tty