[lxc-users] busybox template in ubuntu 14.04 fails to install /usr/sbin/init.lxc?

Serge Hallyn serge.hallyn at ubuntu.com
Mon May 12 03:25:01 UTC 2014


Quoting Fajar A. Nugraha (list at fajar.net):
> On Mon, May 12, 2014 at 1:25 AM, Dan Kegel <dank at kegel.com> wrote:
> > This has probably been raised before, but unless you copy in init.lxc
> > manually, e.g.
> >
> > sudo cp /usr/sbin/init.lxc /var/lib/lxc/busybox/rootfs/usr/sbin/
> >
> > the commands
> >
> > sudo lxc-create -n busybox -t busybox
> > sudo lxc-execute -n busybox -- top
> >
> > will create the container, but fail on execute with the confusing message
> >
> > lxc-execute: Failed to find an lxc-init
> 
> My guess is that is intentional.
> 
> A busybox template (and probably the sshd template) should be as
> simple and as small as possible, demonstrating the possible small
> resource usage (in this case, disk space) of a container. So having it
> able to start with lxc-start (and in the case of sshd, accepting
> connections) is sufficient.
> 
> It is also not a straightforward matter to copy init.lxc. In ubuntu
> trusty at least, I had to copy to other libraries manually to a ubuntu
> container to make it work: liblxc.so.1 and libseccomp.so.2. For a

this difficulty is really bothering me so i'm thinking of teaching
lxc-execute to look for /usr/sbin/init.lxc.static on the host, and
binding that into the container automatically at start.  (Then probably
publishing init.lxc.static in a new package).


More information about the lxc-users mailing list