In trusty 14.04 containers fail to autoboot despite all settings being set as 14.04 requires. They show all as STOPPED

I have correctly configured 2 LXC containers:


They run perfectly if I run
sudo lxc-autostart

sudo lxc-ls --fancy results in:

ubuntu@saturn:/etc/init$ sudo lxc-ls --fancy 
NAME      STATE    IPV4           IPV6  AUTOSTART 

calypso   RUNNING  -     YES        
encelado  RUNNING  -     YES 

The problem is trying to run them at boot.

I have at: /var/lib/lxc/calypso/config:

# Template used to create this container: /usr/share/lxc/templates/lxc-download 
# Parameters passed to the template:
# For additional config options, please look at lxc.conf(5)

# Distribution configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
lxc.arch = x86_64

# Container specific configuration
lxc.rootfs = /var/lib/lxc/calypso/rootfs 
lxc.utsname = calypso

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
#lxc.network.link = lxcbr0
lxc.network.link = br0
lxc.network.hwaddr = 00:16:3e:64:0b:6e  

# Assign static IP Address
lxc.network.ipv4 =
lxc.network.ipv4.gateway = 

# Autostart
lxc.start.auto = 1
lxc.start.delay = 5
lxc.start.order = 100

and I have LXC_AUTO="false" as required inside /etc/default/lxc:

USE_LXC_BRIDGE="false"  # overridden in lxc-net
[ -f /etc/default/lxc-net ] && . /etc/default/lxc-net

Any idea on why the containers don't start at boot? At reboot they are always in the STOPPED state:

ubuntu@saturn:~$ sudo lxc-ls --fancy
calypso   STOPPED  -     -     YES       
encelado  STOPPED  -     -     YES   

and then again they can be started manually, using sudo lxc-autostart

  • I noticed that creating a cron: '@reboot /usr/bin/lxc-autostart' it works. It seems Ubuntu 14.4 doesn't launch lxc-autostart at boot time as the documentation says, launching all the container with lxc.start.auto = 1 – user273046 Apr 23 '14 at 14:09

You say:

I have LXC_AUTO="false" as required inside /etc/default/lxc

That specifically tells the upstart job NOT to start any container. Just don't set it or set it to true and you'll notice containers starting at boot time.


Check that LXC_AUTO is true in /etc/default/lxc


and add group parameter to your config

lxc.group = onboot

(or add BOOTGROUPS= with your setup to /etc/default/lxc )

I think that currently Ubuntus guide at Ubuntu lxc incorrectly states that LXC_AUTO should be false. Also ignore /etc/default/lxc symlink requirement.


In addition to what Manwe posted (which I found to be correct), I had to do some additional work because I am using the -P option on all my lxc commands to use a custom lxc path that's different from /var/lib/lxc. (In retrospect, if I did this again, I'd probably stick with the default location, but that is neither here nor there.)

Edit /etc/default/lxc and add at end:

OPTIONS="-P <lxcpath>"

Edit /etc/init/lxc-instance.conf and add

[ -f /etc/default/lxc ] && . /etc/default/lxc

to start of pre-start and script and add $OPTIONS after lxc-wait and lxc-start.

Like so:

pre-start script
        [ -f /etc/default/lxc ] && . /etc/default/lxc
        lxc-wait $OPTIONS -s RUNNING -n $NAME -t 0 && { stop; exit 0; } || true
end script

        [ -f /etc/default/lxc ] && . /etc/default/lxc
        exec lxc-start $OPTIONS -n $NAME
end script

Then it can be tested with:

sudo service lxc restart
sudo lxc-ls -P <lxcpath> --fancy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.