<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dwangoac</id>
	<title>CRIU - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dwangoac"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Dwangoac"/>
	<updated>2026-05-13T13:37:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=2418</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=2418"/>
		<updated>2015-04-15T21:31:20Z</updated>

		<summary type="html">&lt;p&gt;Dwangoac: /* Installation */ Fix formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
== Installing from packages ==&lt;br /&gt;
&lt;br /&gt;
Some distributions provide ready-to-use [[packages]]. If no, or the CRIU version you want is not yet there, you will need to get CRIU sources and compile it.&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository]. If you plan to modify CRIU sources the latter way is highly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Getting source tarball ===&lt;br /&gt;
: {{Latest release}}&lt;br /&gt;
&lt;br /&gt;
=== Cloning git repository ===&lt;br /&gt;
 git clone https://github.com/xemul/criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
&lt;br /&gt;
CRIU is mostly written in C and the build system is based on Makefiles. Thus just install standard &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; packages (on Debian, &amp;lt;code&amp;gt;[https://packages.debian.org/build-essential build-essential]&amp;lt;/code&amp;gt; will pull in both at once).&lt;br /&gt;
&lt;br /&gt;
If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Downloading Linaro toolchains&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get install lib32stdc++6 lib32z1 # These are ia32 binaries&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] to read and write [[images]] and thus requires [https://github.com/protobuf-c/protobuf-c C language bindings]. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and the &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; shared object is required at build and run time. [[CRIT]] also uses python language bindings for protocol buffers and requires the &amp;lt;code&amp;gt;descriptor.proto&amp;lt;/code&amp;gt; file typically provided by a distribution's protobuf development package.&lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest way is to install distribution packages.&lt;br /&gt;
&lt;br /&gt;
* RPM package names&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian package names&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;python-protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt; packages first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf-c&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To cross-compile for ARM some more tricks will be required.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For ARMv7&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf \&lt;br /&gt;
                         --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
For ARM8&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu \&lt;br /&gt;
                          --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other deps ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python-ipaddr&amp;lt;/code&amp;gt; is used by CRIT to pretty-print ip.&lt;br /&gt;
* If &amp;lt;code&amp;gt;libbsd&amp;lt;/code&amp;gt; available, CRIU will be compiled with setproctitle() support. It will allow to make process titles of service workers to be more verbose.&lt;br /&gt;
* The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces. The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Linux Kernel ==&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself.&lt;br /&gt;
&lt;br /&gt;
=== Configuring the kernel ===&lt;br /&gt;
&lt;br /&gt;
Most likely the first thing to enable is the &amp;lt;code&amp;gt;CONFIG_EXPERT=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Configure standard kernel features (expert users)) option, which on x86_64 depends on the &amp;lt;code&amp;gt;CONFIG_EMBEDDED=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Embedded system) one (welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
* ''General setup'' options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE=y&amp;lt;/code&amp;gt; (Checkpoint/restore support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NAMESPACES=y&amp;lt;/code&amp;gt; (Namespaces support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UTS_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; UTS namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IPC_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; IPC namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PID_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; PID namespaces)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NET_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; Network namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_FHANDLE=y&amp;lt;/code&amp;gt; (Open by fhandle syscalls)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EVENTFD=y&amp;lt;/code&amp;gt; (Enable eventfd() system call)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EPOLL=y&amp;lt;/code&amp;gt; (Enable eventpoll support)&lt;br /&gt;
* ''Networking support -&amp;gt; Networking options'' options for sock-diag subsystem&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG=y&amp;lt;/code&amp;gt; (Unix domain sockets -&amp;gt; UNIX: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG=y&amp;lt;/code&amp;gt; (Packet socket -&amp;gt; Packet: sockets monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG=y&amp;lt;/code&amp;gt; (Netlink socket -&amp;gt; Netlink: sockets monitoring interface)&lt;br /&gt;
* Other options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Inotify support for userspace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION=y&amp;lt;/code&amp;gt; (x86 only) (Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation)&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable the &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY=y&amp;lt;/code&amp;gt; (optional) (Processor type and features -&amp;gt; Track memory changes).&lt;br /&gt;
&lt;br /&gt;
Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
Simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
=== Compilation in Docker container ===&lt;br /&gt;
&lt;br /&gt;
There's a ''docker-build'' target in Makefile which builds CRIU in Ubuntu Docker container. Just run &amp;lt;code&amp;gt;make docker-build&amp;lt;/code&amp;gt; and that's it.&lt;br /&gt;
&lt;br /&gt;
=== Non-standard compilation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Building natively, but specifying built dependencies manually&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Cross Compilation for ARM&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
ARMv7&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
ARMv8&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
CRIU works perfectly even when run from the sources directory (with the &amp;quot;./criu&amp;quot; command), but if you want to have in standard paths run &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may need to install the following packages to generate docs in Debian-based OS's to avoid errors from install-man:&lt;br /&gt;
* &amp;lt;code&amp;gt;asciidoc&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;xmlto&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run &amp;lt;code&amp;gt;criu check --ms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing. If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Dwangoac</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=2417</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=2417"/>
		<updated>2015-04-15T21:30:15Z</updated>

		<summary type="html">&lt;p&gt;Dwangoac: /* Installation */ Add debian doc package information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
== Installing from packages ==&lt;br /&gt;
&lt;br /&gt;
Some distributions provide ready-to-use [[packages]]. If no, or the CRIU version you want is not yet there, you will need to get CRIU sources and compile it.&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository]. If you plan to modify CRIU sources the latter way is highly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Getting source tarball ===&lt;br /&gt;
: {{Latest release}}&lt;br /&gt;
&lt;br /&gt;
=== Cloning git repository ===&lt;br /&gt;
 git clone https://github.com/xemul/criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
&lt;br /&gt;
CRIU is mostly written in C and the build system is based on Makefiles. Thus just install standard &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; packages (on Debian, &amp;lt;code&amp;gt;[https://packages.debian.org/build-essential build-essential]&amp;lt;/code&amp;gt; will pull in both at once).&lt;br /&gt;
&lt;br /&gt;
If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Downloading Linaro toolchains&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get install lib32stdc++6 lib32z1 # These are ia32 binaries&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] to read and write [[images]] and thus requires [https://github.com/protobuf-c/protobuf-c C language bindings]. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and the &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; shared object is required at build and run time. [[CRIT]] also uses python language bindings for protocol buffers and requires the &amp;lt;code&amp;gt;descriptor.proto&amp;lt;/code&amp;gt; file typically provided by a distribution's protobuf development package.&lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest way is to install distribution packages.&lt;br /&gt;
&lt;br /&gt;
* RPM package names&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian package names&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;python-protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt; packages first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf-c&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To cross-compile for ARM some more tricks will be required.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For ARMv7&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf \&lt;br /&gt;
                         --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
For ARM8&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu \&lt;br /&gt;
                          --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other deps ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python-ipaddr&amp;lt;/code&amp;gt; is used by CRIT to pretty-print ip.&lt;br /&gt;
* If &amp;lt;code&amp;gt;libbsd&amp;lt;/code&amp;gt; available, CRIU will be compiled with setproctitle() support. It will allow to make process titles of service workers to be more verbose.&lt;br /&gt;
* The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces. The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Linux Kernel ==&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself.&lt;br /&gt;
&lt;br /&gt;
=== Configuring the kernel ===&lt;br /&gt;
&lt;br /&gt;
Most likely the first thing to enable is the &amp;lt;code&amp;gt;CONFIG_EXPERT=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Configure standard kernel features (expert users)) option, which on x86_64 depends on the &amp;lt;code&amp;gt;CONFIG_EMBEDDED=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Embedded system) one (welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
* ''General setup'' options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE=y&amp;lt;/code&amp;gt; (Checkpoint/restore support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NAMESPACES=y&amp;lt;/code&amp;gt; (Namespaces support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UTS_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; UTS namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IPC_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; IPC namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PID_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; PID namespaces)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NET_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; Network namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_FHANDLE=y&amp;lt;/code&amp;gt; (Open by fhandle syscalls)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EVENTFD=y&amp;lt;/code&amp;gt; (Enable eventfd() system call)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EPOLL=y&amp;lt;/code&amp;gt; (Enable eventpoll support)&lt;br /&gt;
* ''Networking support -&amp;gt; Networking options'' options for sock-diag subsystem&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG=y&amp;lt;/code&amp;gt; (Unix domain sockets -&amp;gt; UNIX: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG=y&amp;lt;/code&amp;gt; (Packet socket -&amp;gt; Packet: sockets monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG=y&amp;lt;/code&amp;gt; (Netlink socket -&amp;gt; Netlink: sockets monitoring interface)&lt;br /&gt;
* Other options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Inotify support for userspace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION=y&amp;lt;/code&amp;gt; (x86 only) (Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation)&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable the &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY=y&amp;lt;/code&amp;gt; (optional) (Processor type and features -&amp;gt; Track memory changes).&lt;br /&gt;
&lt;br /&gt;
Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
Simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
=== Compilation in Docker container ===&lt;br /&gt;
&lt;br /&gt;
There's a ''docker-build'' target in Makefile which builds CRIU in Ubuntu Docker container. Just run &amp;lt;code&amp;gt;make docker-build&amp;lt;/code&amp;gt; and that's it.&lt;br /&gt;
&lt;br /&gt;
=== Non-standard compilation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Building natively, but specifying built dependencies manually&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Cross Compilation for ARM&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
ARMv7&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
ARMv8&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
CRIU works perfectly even when run from the sources directory (with the &amp;quot;./criu&amp;quot; command), but if you want to have in standard paths run &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may need to install the following packages to generate docs in Debian-based OS's to avoid errors from install-man:&lt;br /&gt;
** &amp;lt;code&amp;gt;asciidoc&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;xmlto&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run &amp;lt;code&amp;gt;criu check --ms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing. If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Dwangoac</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=2416</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=2416"/>
		<updated>2015-04-15T21:26:32Z</updated>

		<summary type="html">&lt;p&gt;Dwangoac: /* Distribution Packages */ Add libprotobuf-dev&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
== Installing from packages ==&lt;br /&gt;
&lt;br /&gt;
Some distributions provide ready-to-use [[packages]]. If no, or the CRIU version you want is not yet there, you will need to get CRIU sources and compile it.&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository]. If you plan to modify CRIU sources the latter way is highly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Getting source tarball ===&lt;br /&gt;
: {{Latest release}}&lt;br /&gt;
&lt;br /&gt;
=== Cloning git repository ===&lt;br /&gt;
 git clone https://github.com/xemul/criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
&lt;br /&gt;
CRIU is mostly written in C and the build system is based on Makefiles. Thus just install standard &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; packages (on Debian, &amp;lt;code&amp;gt;[https://packages.debian.org/build-essential build-essential]&amp;lt;/code&amp;gt; will pull in both at once).&lt;br /&gt;
&lt;br /&gt;
If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Downloading Linaro toolchains&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get install lib32stdc++6 lib32z1 # These are ia32 binaries&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] to read and write [[images]] and thus requires [https://github.com/protobuf-c/protobuf-c C language bindings]. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and the &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; shared object is required at build and run time. [[CRIT]] also uses python language bindings for protocol buffers and requires the &amp;lt;code&amp;gt;descriptor.proto&amp;lt;/code&amp;gt; file typically provided by a distribution's protobuf development package.&lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest way is to install distribution packages.&lt;br /&gt;
&lt;br /&gt;
* RPM package names&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian package names&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;python-protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt; packages first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf-c&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To cross-compile for ARM some more tricks will be required.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For ARMv7&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf \&lt;br /&gt;
                         --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
For ARM8&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu \&lt;br /&gt;
                          --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other deps ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python-ipaddr&amp;lt;/code&amp;gt; is used by CRIT to pretty-print ip.&lt;br /&gt;
* If &amp;lt;code&amp;gt;libbsd&amp;lt;/code&amp;gt; available, CRIU will be compiled with setproctitle() support. It will allow to make process titles of service workers to be more verbose.&lt;br /&gt;
* The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces. The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Linux Kernel ==&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself.&lt;br /&gt;
&lt;br /&gt;
=== Configuring the kernel ===&lt;br /&gt;
&lt;br /&gt;
Most likely the first thing to enable is the &amp;lt;code&amp;gt;CONFIG_EXPERT=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Configure standard kernel features (expert users)) option, which on x86_64 depends on the &amp;lt;code&amp;gt;CONFIG_EMBEDDED=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Embedded system) one (welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
* ''General setup'' options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE=y&amp;lt;/code&amp;gt; (Checkpoint/restore support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NAMESPACES=y&amp;lt;/code&amp;gt; (Namespaces support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UTS_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; UTS namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IPC_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; IPC namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PID_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; PID namespaces)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NET_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; Network namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_FHANDLE=y&amp;lt;/code&amp;gt; (Open by fhandle syscalls)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EVENTFD=y&amp;lt;/code&amp;gt; (Enable eventfd() system call)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EPOLL=y&amp;lt;/code&amp;gt; (Enable eventpoll support)&lt;br /&gt;
* ''Networking support -&amp;gt; Networking options'' options for sock-diag subsystem&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG=y&amp;lt;/code&amp;gt; (Unix domain sockets -&amp;gt; UNIX: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG=y&amp;lt;/code&amp;gt; (Packet socket -&amp;gt; Packet: sockets monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG=y&amp;lt;/code&amp;gt; (Netlink socket -&amp;gt; Netlink: sockets monitoring interface)&lt;br /&gt;
* Other options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Inotify support for userspace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION=y&amp;lt;/code&amp;gt; (x86 only) (Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation)&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable the &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY=y&amp;lt;/code&amp;gt; (optional) (Processor type and features -&amp;gt; Track memory changes).&lt;br /&gt;
&lt;br /&gt;
Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
Simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
=== Compilation in Docker container ===&lt;br /&gt;
&lt;br /&gt;
There's a ''docker-build'' target in Makefile which builds CRIU in Ubuntu Docker container. Just run &amp;lt;code&amp;gt;make docker-build&amp;lt;/code&amp;gt; and that's it.&lt;br /&gt;
&lt;br /&gt;
=== Non-standard compilation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Building natively, but specifying built dependencies manually&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Cross Compilation for ARM&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
ARMv7&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
ARMv8&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
CRIU works perfectly even when run from the sources directory (with the &amp;quot;./criu&amp;quot; command), but if you want to have in standard paths run &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run &amp;lt;code&amp;gt;criu check --ms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing. If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Dwangoac</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=2415</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=2415"/>
		<updated>2015-04-15T21:14:27Z</updated>

		<summary type="html">&lt;p&gt;Dwangoac: /* Distribution Packages */ Fix python-protobuf .deb package name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
== Installing from packages ==&lt;br /&gt;
&lt;br /&gt;
Some distributions provide ready-to-use [[packages]]. If no, or the CRIU version you want is not yet there, you will need to get CRIU sources and compile it.&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository]. If you plan to modify CRIU sources the latter way is highly recommended.&lt;br /&gt;
&lt;br /&gt;
=== Getting source tarball ===&lt;br /&gt;
: {{Latest release}}&lt;br /&gt;
&lt;br /&gt;
=== Cloning git repository ===&lt;br /&gt;
 git clone https://github.com/xemul/criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
&lt;br /&gt;
CRIU is mostly written in C and the build system is based on Makefiles. Thus just install standard &amp;lt;code&amp;gt;gcc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; packages (on Debian, &amp;lt;code&amp;gt;[https://packages.debian.org/build-essential build-essential]&amp;lt;/code&amp;gt; will pull in both at once).&lt;br /&gt;
&lt;br /&gt;
If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Downloading Linaro toolchains&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 sudo apt-get install lib32stdc++6 lib32z1 # These are ia32 binaries&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] to read and write [[images]] and thus requires [https://github.com/protobuf-c/protobuf-c C language bindings]. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and the &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; shared object is required at build and run time. [[CRIT]] also uses python language bindings for protocol buffers and requires the &amp;lt;code&amp;gt;descriptor.proto&amp;lt;/code&amp;gt; file typically provided by a distribution's protobuf development package.&lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest way is to install distribution packages.&lt;br /&gt;
&lt;br /&gt;
* RPM package names&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-devel&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;&lt;br /&gt;
* Debian package names&lt;br /&gt;
** &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;python-protobuf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt; packages first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To build protobuf-c&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
To cross-compile for ARM some more tricks will be required.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
For ARMv7&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf \&lt;br /&gt;
                         --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
For ARM8&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu \&lt;br /&gt;
                          --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other deps ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;python-ipaddr&amp;lt;/code&amp;gt; is used by CRIT to pretty-print ip.&lt;br /&gt;
* If &amp;lt;code&amp;gt;libbsd&amp;lt;/code&amp;gt; available, CRIU will be compiled with setproctitle() support. It will allow to make process titles of service workers to be more verbose.&lt;br /&gt;
* The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces. The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Linux Kernel ==&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself.&lt;br /&gt;
&lt;br /&gt;
=== Configuring the kernel ===&lt;br /&gt;
&lt;br /&gt;
Most likely the first thing to enable is the &amp;lt;code&amp;gt;CONFIG_EXPERT=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Configure standard kernel features (expert users)) option, which on x86_64 depends on the &amp;lt;code&amp;gt;CONFIG_EMBEDDED=y&amp;lt;/code&amp;gt; (General setup -&amp;gt; Embedded system) one (welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
* ''General setup'' options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE=y&amp;lt;/code&amp;gt; (Checkpoint/restore support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NAMESPACES=y&amp;lt;/code&amp;gt; (Namespaces support)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UTS_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; UTS namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IPC_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; IPC namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PID_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; PID namespaces)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NET_NS=y&amp;lt;/code&amp;gt; (Namespaces support -&amp;gt; Network namespace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_FHANDLE=y&amp;lt;/code&amp;gt; (Open by fhandle syscalls)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EVENTFD=y&amp;lt;/code&amp;gt; (Enable eventfd() system call)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_EPOLL=y&amp;lt;/code&amp;gt; (Enable eventpoll support)&lt;br /&gt;
* ''Networking support -&amp;gt; Networking options'' options for sock-diag subsystem&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG=y&amp;lt;/code&amp;gt; (Unix domain sockets -&amp;gt; UNIX: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG=y&amp;lt;/code&amp;gt; (TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG=y&amp;lt;/code&amp;gt; (Packet socket -&amp;gt; Packet: sockets monitoring interface)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG=y&amp;lt;/code&amp;gt; (Netlink socket -&amp;gt; Netlink: sockets monitoring interface)&lt;br /&gt;
* Other options&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER=y&amp;lt;/code&amp;gt; (File systems -&amp;gt; Inotify support for userspace)&lt;br /&gt;
** &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION=y&amp;lt;/code&amp;gt; (x86 only) (Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation)&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable the &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY=y&amp;lt;/code&amp;gt; (optional) (Processor type and features -&amp;gt; Track memory changes).&lt;br /&gt;
&lt;br /&gt;
Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
Simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
=== Compilation in Docker container ===&lt;br /&gt;
&lt;br /&gt;
There's a ''docker-build'' target in Makefile which builds CRIU in Ubuntu Docker container. Just run &amp;lt;code&amp;gt;make docker-build&amp;lt;/code&amp;gt; and that's it.&lt;br /&gt;
&lt;br /&gt;
=== Non-standard compilation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Building natively, but specifying built dependencies manually&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Cross Compilation for ARM&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
ARMv7&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
ARMv8&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
CRIU works perfectly even when run from the sources directory (with the &amp;quot;./criu&amp;quot; command), but if you want to have in standard paths run &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run &amp;lt;code&amp;gt;criu check --ms&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing. If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Dwangoac</name></author>
	</entry>
</feed>