[lxc-users] Container starts on incorrect runlevel

Fajar A. Nugraha list at fajar.net
Tue Oct 13 20:36:18 UTC 2015

On Tue, Oct 13, 2015 at 9:18 PM, Davide Baldini
<baldiniebaldini at gmail.com> wrote:
> Thanks Fajar,
> yes, Debian installed from a template correctly starts on runlevel 2, the
> default for Debian.
> Since mine starts on "S" instead, a simple workaround could be to symlink
> /etc/rcS.d to /etc/rc2.d or, better, just issue "init 2" from an
> hypothetical rcS.d script. However, I prefer to keep the root tree as
> default as possible for portability over other hypervisors and simplicity.

You need modifications for old-sysvinit systems to run as lxc guest, e.g.

> Do you know if there's any way to let lxc-start specify a runlevel parameter
> for /sbin/init before booting? The same way as a bootloader would allow the
> user to specify it, along with other boot parameters.


But you CAN mount some files (e.g. guest's /etc/inittab, fstab, and
interfaces) from the host using lxc.mount.entry, so the file inside
the rootfs stays unmodified.


More information about the lxc-users mailing list