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:
- http://askubuntu.com/questions/532346/autostart-unpriviledged-lxc-containers
- https://www.stgraber.org/2014/01/17/lxc-1-0-unprivileged-containers/
- http://serverfault.com/questions/620709/how-to-auto-start-unprivileged-lxc-containers
- http://brentingitup.com/?q=node/22
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/