Building XEN dom0 and domU Linux kernels


You need at least Linux v4.2 for the XEN dom0/U code to be available.

Slackware 14.2 has v4.4 so that’s fine – you could just recompile the sources provided from the K set.

Slackware current always tracks the latest longterm tagged kernel so that’s VERY fine also.

But let us get things staight with the very latest stable version. Oh, and we are also applying the latest available REISER4 patch to it (check it first to see what 5.x release it matches against).

As for domU, latest available TMEM kernel was 5.2.21.


This guide has been replaced and implemented as scripts already.

Quick & dirty for a minimal working XEN environemnt

Full-fledged kernel with many things incl. Docker support



slackpkg install elfutils bc


eventually grab the latest REISER4 patch


if so, also make sure you’ve installed REISER4PROGS onto your system

lynx -dump
lynx -dump
tar xzf ...

grab the latest stable kernel source tarball and verify

cd /usr/src/

gunzip linux-5.9.12.tar.gz
gunzip linux-5.2.21.tar.gz

#gpg2 --recv-keys 0x6092693E --keyserver
#TODO gpg --receive-keys 0x6092693E
gpg --verify linux-5.9.12.tar.sign
gpg --verify linux-5.2.21.tar.sign

Primary key fingerprint: 647F 2865 4894 E3BD 4571  99BE 38DB BDC8 6092 693E

or xen testing

#git clone git://
#cd tip/
#git reset --hard
#git checkout -b xen-next origin/linux-next
#git pull

you are now ready to run the kernel building scripts

screen -S kernel-build

./build0.bash # 14m24.761s for slackcurrent on ryzen5 laptop

Dom0 clean-up


eventually get rid of older and unused kernels (slackware 142)

#removepkg /var/log/packages/kernel-*4.4.*  

however if you get rid of kernel headers too early you get

kernel "fatal error: linux/errno.h: No such file or directory"

TODO try this once again once you’ve build the new kernel and rebooted

header symlinks

also make sure those are in place

ls -lF /lib/modules/`uname -r`/build
ls -lF /lib/modules/`uname -r`/source

==> should symlink against /usr/src/KERNEL

DomU modules

as XEM_TMEM module keeps being a module, we need to deliver it to the guests to use TMEM


cd /data/guests/$guest/
fsck.ext4 $guest.ext4
mkdir lala/
mount -o loop,rw $guest.ext4 lala/

mkdir -p lala/lib/modules/
ls -alkF lala/lib/modules/
rm -rf lala/lib/modules/*
#for ball in `ls -1 /data/kernels/lib.modules.*.tar.gz`; do
#        echo -n $ball...
#        tar xzf $ball -C lala/lib/modules/ && echo done
#done; unset ball
tar xzf /data/kernels/lib.modules.$version.tar.gz -C lala/lib/modules/
ls -alkF lala/lib/modules/

cat lala/etc/modules
echo tmem >> lala/etc/modules

umount lala/
rmdir lala/
xl create $guest -c

and verify that everything works as expected onto a new guest, including TMEM and Docker,

zcat /proc/config.gz | grep TMEM
zcat /proc/config.gz | grep CLEANCACHE
lsmod | grep tmem
watch free -m

zcat /proc/config.gz | grep OVERLAY
docker ps -a




Mainline Linux Kernel Configs

kernel config

Kernel/Traditional compilation

Complete Handbook/Building the Linux kernel

What exactly does Linux kernel’s make defconfig do?

Use the OverlayFS storage driver

CONFIG_IKCONFIG: Kernel .config support

Kernel/IKCONFIG Support

Chapter 8. Customizing a Kernel



Universal TUN/TAP device driver.