Skip to content
Tim Ohliger edited this page Jul 18, 2018 · 11 revisions

How to install libvirt-lxctools

configure bridge br0:

... disable NetworkManager, enable network.service

Note: Finding the right LXC, criu and Kernel versions is crucial, as missing features in non-matching versions may render criu unusable. It is a good idea to keep to the versions provided in your distributions package manager. Definately working are criu version 2.2, LXC version 2.0.0 and Kernel 4.4.4 (Tested on Fedora 23).

You also may have to add the following to the LXC config file (as per https://criu.org/LXC):

lxc.console = none
lxc.tty = 0
lxc.cgroup.devices.deny = c 5:1 rwm

install lxc:

RPM dependencies:

gnupg
libcap
libcap-devel

Replace <version> with a version tag like lxc-2.0.9.

git clone https://github.com/lxc/lxc.git
cd lxc
git checkout <version>
./autogen.sh
./configure --prefix=<prefix> --enable-configpath-log
make && make install

Also, [email protected]:timohl/lxc.git in branch lxctools contains lxc-2.0.8 with a commit that might be required (not sure yet).

install criu:

https://criu.org/Installation

RPM dependencies:

protobuf
protobuf-c
protobuf-c-devel
protobuf-compiler
protobuf-devel
protobuf-python
libnl3
libnl3-devel
python-ipaddr
libbsd
libcap-devel

Replace <version> with a version tag like v3.6.

git clone https://github.com/xemul/criu
cd criu
git checkout <version>
make
cp criu/criu <prefix>/sbin

install libvirt:

RPM dependencies:

libpciaccess-devel
libxml2-devel
perl-XML-XPath
yajl-devel (not sure if really required)
xhtml1-dtds
libxslt
tar
nc
cp set_environment.sh <prefix>/bin/
. <prefix>/bin/set_environment.sh
git clone [email protected]:RWTH-OS/libvirt.git
cd libvirt
./autogen.sh --disable-expensive-tests --with-lxctools --without-apparmor --without-selinux --without-xen --without-openvz --without-vmware --without-phyp --without-xenapi --without-lbxl --without-vbox --without-lxc --without-hyperv --without-esy --without-parallels --without-storage-lvm --without-storage-iscsi --without-storage-mpath --without-storage-disk --without-storage-rbd --without-storage-sheepdog --without-storage-gluster --without-storage-zfs --without-test-suite --prefix <prefix>
make && make install
cp libvirtd-notls.conf <prefix>/etc/libvirt/

For set_environment.sh and libvirtd-notls.conf see Additional Files

create container:

TODO: add config example and more throughout help for creating containers

lxc-create -n <container-name> -t download

set network interface to bridge br0 e.g. via

virsh edit <container-name>

or if virsh reports an error:

vim <prefix>/var/lib/lxc/<container-name>/config

Bugs:

virsh edit SEGFAULTs retry. TODO: fixme

migration creates zombie processes: no fix yet; restore process needs to be reparented to init so that it gets properly reaped.

criu failes with too many fds: ulimit -n 102400 this is also a fix for several different error criu produces when dumping a large container (should be fixed with criu 2.1 -> it wasn't)