[Lxc-users] Ubuntu 12.04 linux-container package and init modifications

Fajar A. Nugraha list at fajar.net
Tue Mar 6 19:30:24 UTC 2012


On Wed, Mar 7, 2012 at 2:17 AM, thaddeus at thogan.com <thaddeus at thogan.com> wrote:
> I have been preparing to move a bunch of dev VMs running Ubuntu 10.04 on KVM
> to 12.04 on LXC after the release next month.

Do you mean you'll be using 10.04 or 12.04 inside the container?

>
> I am currently testing with the 12.04 beta build and have had good luck
> getting everything up and running. However I am still making numerous
> changes to the upstart scripts to make everything start fine.
>

True. But you SHOULD be able to create them as additional .conf files
instead of editing existing ones.

> Does anyone here have any experience with the new linux-container package in
> 12.04? It appears to have made many changes in an attempt to configure the
> guest to start properly in LXC, however the only reason everything worked
> was because the upstart failsafe-boot event was eventually emitted. It still
> took a bit of work to get the system to go through the usual boot process
> without failsafe needing to kick in.
>
> My guest is a Ubuntu 12.04 rootfs generated with debootstrap. Then the
> linux-container package was added. The network configuration done via that
> package didn't seem to work right: the default gateway wasn't set and the
> static-network-up event never fired.
>
> Is anyone familiar with the new package in 12.04, and if it is going to be
> updated before release to work out of the box? Or am I just doing it wrong?
> :)

I don't know about that, sorry.

What I DO know is that my 11.04 container, with lxcguest package, that
used to work fine in 11.04 and 11.10 host, stopped working in 12.04.

Initially I tried different hacks (like editing rc-sysinit.conf,
probably what you did as well), and even try creating a conf file that
basically does "init 2". After some testing, turns out the event for
loopback interface up (which is needed by rc-sysinit) was never
emmited. In the end adding this file works:


# cat /etc/init/lxc-lo.conf
start on startup
env container

pre-start script
        if [ "x$container" != "xlxc" -a "x$container" != "xlibvirt" ];
then
                stop;
        fi
        initctl start network-interface INTERFACE=lo
        exit 0;
end script


So now the modifications (both from lxcguest and my local addition)
are all new .conf files, which would be ignored if it's not started in
lxc environment. Might try 12.04 container later.

-- 
Fajar




More information about the lxc-users mailing list