1

I'm using Ubuntu 14.04 and have installed LXC normally. I've followed the official LXC documentation to set up unprivileged containers under a non-root user.

These don't seem to support LXC's autostart functionality. Has anyone worked around this?

  • Your question doesn't really give all that much information. I suggest you edit it to include what you tried, why it didn't work, any research you did and what exactly you were hoping for/expecting. – Seth Oct 7 '14 at 2:41
  • That is much better, thank you. We still need a few more details however. A link to the installation docs would be nice. When you say "doesn't seem to support..." how did you reach that conclusion? – Seth Oct 7 '14 at 13:47
  • 1
    @Seth I'll add in a link to the docs to set up non-privileged users. As for how I know it doesn't work out of the box. The init stuff just isn't written to be aware of containers for anyone other than root any more - it used to be more manual requiring creation of symlinks per machine which would better support this use case. However back then unprivileged containers weren't well supported. I gleaned this from the LXC mailing list archives. I was just hoping someone might have already encountered this problem and patched the init stuff to be more compatible – Peter Roberts Oct 7 '14 at 17:05
0

I've written a small script to work around the issue, just follow the commented instructions.

0

Try put in /etc/rc.local:

/bin/su -c /usr/bin/lxc-autostart USER

  • Since rc.local is run as root, the su -c is not needed. – waltinator Jun 12 '15 at 22:06

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.