[lxc-users] Unprivileged containers do not auto-start

Serge Hallyn serge.hallyn at ubuntu.com
Tue May 6 22:16:59 UTC 2014


Quoting Robert Pendell (shinji at elite-systems.org):
> On Tue, May 6, 2014 at 5:01 PM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> > Quoting Robert Pendell (shinji at elite-systems.org):
> >> OS: Ubuntu 14.04 LTS x86_64
> >> Kernel: Host-Supplied 3.14.1
> >> Provider: Linode
> >> Host Virtualization: Xen Paravirtualized
> >> LXC Version: 1.0.3-0ubuntu3
> >>
> >> On a fresh boot unprivileged containers are not starting automatically
> >> even though they have lxc.start.auto enabled.  lxc-ls as the user
> >> confirms autostart is enabled as well.
> >>
> >> Is this a bug or intended or am I just missing something really
> >> obvious in my configuration?
> >
> > By default only containers in /var/lib/lxc are autostarted.  You
> > could edit /etc/lxc/lxc.conf to change that.  If you're ok with
> > them only starting on login you might also be able to use a user
> > upstart session job, but I suspect tying the containers so closely
> > to your login session won't be what you want.
> >
> 
> That would be an accurate assumption.  At this point if I need to I
> can login and start the container manually.  I checked lxc.conf and
> I'm not sure how to set it up the way you suggest.  This system may
> end up being home to multiple containers that are mixed between
> locations.
> 
> P.S. - I noticed that lxc-autostart doesn't list unprivileged containers?

It doesn't list containers under your home dir.  However if you create
a root-owned  unprivileged root-owned container, lxc-autostart will list
it:

cat > lxc.conf << EOF
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.id_map = u 0 100000 100000
lxc.id_map = g 0 100000 100000
lxc.aa_profile = lxc-container-default-with-nesting
lxc.start.auto = 1
lxc.mount.auto = cgroup
EOF
sudo lxc-create -t download -n listme1 -f lxc.conf

After this, 
	sudo lxc-autostart -L
should show
	listme1 0

-serge


More information about the lxc-users mailing list