Differences between revisions 4 and 5
Revision 4 as of 2013-02-26 08:24:51
Size: 716
Editor: ?StephaneKlein
Comment:
Revision 5 as of 2016-09-26 15:56:44
Size: 2380
Editor: jmtd
Comment: import some squeeze-specific notes from parent article
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
This procedure is not complete, it don't working on my system (the author) This procedure is not complete, it don't working on my system (an author)
Line 7: Line 7:
=== Preparing the host ===

Memory cgroup support (CONFIG_CGROUP_MEM_RES_CTLR, DebianBug: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''. <<BR>> 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 .
Line 31: Line 36:

== 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 ==

 * [[http://blog.foaa.de/2010/05/lxc-on-debian-squeeze/|LXC on Debian Squeeze]] (Published on 2010-05-01)
 * [[http://sutas.eu/setting-up-lxc-on-debian-squeeze/|Setting up LXC on Debian squeeze]] (Published on 06/11/2011)
 * [[http://www.wallix.org/2011/09/20/how-to-use-linux-containers-lxc-under-debian-squeeze/|How to use Linux containers (lxc) under Debian Squeeze]]

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