Note about LXC Squeeze-Backport version
This procedure is not complete, it don't working on my system (an author)
Preparing the host
Memory cgroup support (CONFIG_CGROUP_MEM_RES_CTLR, 534964,
is available for Squeeze since kernel version 2.6.39-bpo60-2. It is deactivated by default. You need to activate it with a kernel parameter. When using grub2, this can be easily done by setting GRUB_CMDLINE_LINUX="cgroup_enable=memory" in /etc/default/grub and running update-grub2.
Same goes for swap+memory (CONFIG_CGROUP_MEM_RES_CTLR_SWAP), kernel parameter "swapaccount=1" - see http://lists.debian.org/debian-kernel/2012/01/msg00804.html .
LXC Installation
# echo "deb http://backports.debian.org/debian-backports squeeze-backports main" > /etc/apt/sources.list.d/lxc.list # echo -e "Package: lxc\nPin: release a=squeeze-backports\nPin-Priority: 1000" > /etc/apt/preferences.d/lxc
# apt-get install lxc debootstrap bridge-utils libvirt-bin
# echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab # mount /sys/fs/cgroup
Create new container
# lxc-create -n foobar -t debian
This command will ask you some questions…
RootFS creation
- In theory you may use any tool to create a rootfs (debootstrap, multistrap, rootstock) as long as you are sure, that the result will run inside a container.
- For the first time and as an example, use the provided creation script of the lxc package.
cp -a /usr/lib/lxc/templates/lxc-debian /usr/lib/lxc/templates/lxc-squeeze
- (lxc-debian is designed to install lenny, which is no longer accessible from the specified archive.) Edit lxc-squeeze, replacing "lenny" with "squeeze" and "dhcp-client" with "isc-dhcp-client"
lxc-create -n myvm -t squeeze -f /usr/share/doc/lxc/examples/lxc-veth.conf
Here, we use lxc-veth.conf config file
References
LXC on Debian Squeeze (Published on 2010-05-01)
Setting up LXC on Debian squeeze (Published on 06/11/2011)