Autostart Ubuntu 14.04 LXC containers(1)

We started experimenting with LXC containers which is a nifty 1 not-so-new-anymore technology we recently stumbled upon.

Autostarting unprivileged containers seems to be problematic. Most of the workarounds don't seem to work. See for posts about this problem:

We use the unprivileged setup.

The workaround we came up with is to create a user crontab and use ssh to execute lxc-autostart at startup.

crontab -e add @reboot ssh user@host 'lxc-autostart'

Make sure you can ssh login without a password. To do that create a key-pair with ssh-keygen and ssh-copy-id to user@host. This solution is suggested by Tarruda https://gist.github.com/tarruda/2aea9107f04d8b8d8dbf.

We think at the moment the implementation to autostart unprivileged containers is a bit lacking.

Tuesday July 21, 2015

1. Nekhelesh, http://nik90.com/fiddling-around-with-lxc-containers/