Saturday, December 31, 2011

LXC on Linux Mint Debian Wheezy

Looking into installing OpenVZ on Linux Mint Debian (Wheezy), I found there was no OpenVZ kernel available in the Linux 3.0 kernel series. Instead, lxc is available and is built into the mainline kernel.

lxc is based on cgroups (Control Groups) but is not as well documented as OpenVZ.

After installing lxc control package from Linux Mint repositories, it was at version 7.3.0. Attempting to start a virtual system produced an error: "configuration path not found".

The solution was to use Synaptic and add the Official Debian Testing repository, and reload. This enabled the update of lxc to 7.5-9, which fixes the issue.

Create & mount the cgroup (see elsewhere).
Create a new debian container:
lxc-create -n test1 -f lxc.test1 -t debian

In the new container set up the IP address, route, DNS and install tools:
test1# ifconfig eth0 192.168.30.100
test1# ip route add default via 192.168.30.1
test1# echo nameserver 8.8.8.8 > /etc/resolv.conf
test1# apt-get install nano mc pdmenu
test1# apt-get install ping

No comments:

Post a Comment