Last Updated: February 25, 2016
· superboum

LXC Autostart Container at boot, choose order and delay

You might read some information on the internet like :

sudo ln -s /var/lib/lxc/myfirstcontainer/config /etc/lxc/auto/myfirstcontainer

And other some stuff with lxc-autostart or even /etc/default/lxc

But it didn't work for me. In latest version of LXC, this feature seems to be directly implement in the config file.

Currently, I'm running Debian Testing and this line saved me (put it in your configuration file, like /var/lib/lxc/myfirstcontainer/config) :

lxc.start.auto = 1

We can check that line works with

lxc-ls --fancy

You can even set a boot order and a boot delay :

lxc.start.delay = 0 (in seconds)
lxc.start.order = 0 (higher means earlier)

Source : https://groups.google.com/a/linux.ie/d/msg/ilug/7ZwRTTxXu4U/Zhd31tj4ciwJ

Say Thanks
Filed Under