[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Freedombox-discuss] status of lxc in debian wheezy (was: Re: jails in Debian?)



On Fri, 2013-02-08 at 23:15 -0600, Nick M. Daly wrote:
> Rob van der Hoeven writes:
> 
> > On Thu, 2013-02-07 at 23:23 +0000, Wookey wrote:
> >> OK, the release team response was to raise this to 'important' and ask
> >> for a patch and an upload to testing-proposed-updates:
> >> 
> >
> > Great news, lets fix this!
> >
> > [...] I'm not familiar with the patching process so i can not do
> > this. I will be happy to help with the testing part if needed.
> 
> Rob, can you supply the necessary diff, so the bugger works at all in
> Wheezy?  LXC would be really useful.  Somebody else might be able to
> package, etc.
> 
> Rob and Wookey, thanks for your work on this.
> 
> Nick

Here is my solution:

First let me explain the problem. LXC uses shell scripts (they call them
templates) to create the rootfs of a container, this is where things go
wrong. The current Wheezy templates for creating a Debian rootfs use
live-debconfig and this package will not be included in Wheezy. Although
the scripts run, the generated rootfs is not configured correctly.
Fortunately there is nothing wrong with LXC. Simply replacing the shell
script with a version that does not depend on packages that are not in
Wheezy will solve the problem.

On my own computers i use a slightly modified version of the Debian
template that came with Squeeze. My modifications are:
 
1) Installing a Squeeze rootfs instead of a Lenny rootfs
2) Replacing the deprecated DHCP package
3) Adding some mknod commands to create tty's in the generated rootfs
4) Support for the armel architecture.
5) For the network configuration the template expects that the host has
a bridged network with the name br0 and a DHCP server running. 

I have updated this template to install a Wheezy rootfs and tested the
result. It seems to work perfectly. So my solution is: remove the
non-functional Debian templates from the LXC package and replace them
with my working template. 

You can download my Debian Wheezy template at:

http://freedomboxblog.nl/wp-content/uploads/lxc-debian-wheezy.gz

If you want to test the template:

Extract the file to /usr/share/lxc/templates , change owner and group to
root and make it executable.

Create a container with:

lxc-create -n wheezy01 -t debian-wheezy

Start it:

lxc-start -n wheezy01

The generated rootfs reports the container name to the DHCP server. If
you happen to to run a combined DHCP/DNS server like dnsmasq this can be
used to automatically create a domain-name for the container. (My own
setup would create the DNS name wheezy01.freedom.box for the container.
Handy for ssh connections...)

Rob.
http://freedomboxblog.nl





Reply to: