Slackware Linux as a XEN host (dom0)

slackware dom0 | from source | multilib

Install

sbopkg -i acpica
sbopkg -i yajl
sbopkg -i xen-nox

Setup

without autoballoon nor anything specific (default network type is bridge already)

#mv -i /etc/xen/xl.conf /etc/xen/xl.conf.dist
#grep -vE '^[[:space:]]*(#|$)' /etc/xen/xl.conf.dist #empty
#vi /etc/xen/xl.conf

#https://xenbits.xen.org/docs/4.11-testing/man/xl.conf.5.html
#https://xenbits.xen.org/docs/unstable/man/xl.conf.5.html
#autoballoon="on"
#vif.default.bridge="xenbr0"
#vif.default.script="vif-bridge"
#vif.default.script="vif-openvswitch"

now we want to enable the XEN daemons at boot time alright.

ls -lF /etc/init.d/xen*
vi /etc/rc.d/rc.local

we keep using xendomains because otherwise, guests live alone while dom0 shuts down. also, the default scheduler is now Credit2, since 4.10 or 4.12 – load it AFTER xencommons!

echo XEN
/etc/init.d/xencommons start
/etc/init.d/xendomains start
/usr/local/sbin/xl sched-credit2 --domain=0 --weight=512
/usr/local/sbin/xl sched-credit2
echo

and shutdown

vi /etc/rc.d/rc.local_shutdown

#!/bin/sh

echo XEN DOWN
/etc/init.d/xendomains stop
/etc/init.d/xencommons stop
echo

chmod +x /etc/rc.d/rc.local_shutdown
grep rc.local_shutdown /etc/rc.d/rc.*

Dom0 kernel

slackpkg search kernel

No need for those

removepkg kernel-huge
removepkg kernel-modules
removepkg kernel-source

but it’s good to keep those

slackpkg install kernel-firmware
slackpkg install kernel-headers

and you can now proceed with dom0 kernel building

Booting

Choose either GRUB2 or SYSLINUX — LILO is not an option here (unless you want to play with mbootpack)

Networking

see network

Ready to go

cat /sys/hypervisor/properties/capabilities
cat /proc/xen/capabilities
/etc/init.d/xencommons status
xl li

Handy scripts

It took me a while to figure out with my slackware/XEN servers were lagging and even refusing to provide a prompt when NFS was failing. It was because I had the bad idea to put /data/xen in the PATH. And that was on the NFS share. Therefore it is better to have a separate copy of the repository on each node (here in /root/).

cd ~/
git clone git@github.com:pbraun9/xen.git
git clone https://github.com/pbraun9/xen.git

Tuning

more loops

max_loop=128

Xen dom0 complains about not enough free loop devices when trying to start a new domU or when trying to “mount -o loop” from the cmdline https://wiki.xenproject.org/wiki/Xen_Common_Problems#Xen_dom0_complains_about_not_enough_free_loop_devices_when_trying_to_start_a_new_domU_or_when_trying_to_.22mount_-o_loop.22_from_the_cmdline

How to add more /dev/loop* devices on Fedora 19 https://unix.stackexchange.com/questions/98742/how-to-add-more-dev-loop-devices-on-fedora-19

\3. Adding Support for More Loop Devices https://www.tldp.org/HOWTO/CDServer-HOWTO/addloops.html

libvirt capable (optional)

slackpkg install libpciaccess
sbopkg -i libvirt
sbopkg -i libvirt-python
sbopkg -i virt-manager
sbopkg -i virt-viewer

cat /etc/sysctl.d/60-libvirtd.conf
sysctl fs.aio-max-nr=1048576

/usr/sbin/libvirtd -d
cat >> /etc/rc.local <<-EOF

echo -n starting libvirt...
/usr/sbin/libvirtd -d && echo done
EOF

virsh list

OBSOLETE

mounted by xencommons,

cat >> /etc/fstab <<-EOF
xenfs /proc/xen xenfs defaults 0 0
EOF
mount /proc/xen/

eventually fix an anoying bug into seabios,

grep -r BXSSDTSUSP *
vi tools/firmware/seabios-dir-remote/src/fw/ssdt-misc.dsl

BXSSDTSUSP --> BXSSDTSU

grep -r BXSSDTPCIHP *
vi tools/firmware/seabios-dir-remote/src/fw/ssdt-pcihp.dsl

BXSSDTPCIHP --> BXSSDTPC

MOAR TROUBLES

/data/host/xen-4.12.3/tools/libxl/dsdt_pvh.asl   3339:         Processor ( PR7F, 127, 0x0000b010, 0x06 ) {
Warning  3168 -                                                              ^ Legacy Processor() keyword detected. Use Device() keyword instead.

/tmp/cc7ADtII.s: Assembler messages:
/tmp/cc7ADtII.s:3: Error: junk at end of line, first unrecognized character is `{'
Makefile:88: Test harness not built, use newer compiler than "gcc"

while building tools

ERROR: Cannot find Ninja

–> pip install ninja

while booting dom0

(XEN) ERROR: Will only load images built for the generic loader or Linux images (Not '' and '') or with PHYS32_ENTRY set

–> dom0 kernel is not XEN-capable

Resources

Dom0 Kernels for Xen https://wiki.xenproject.org/wiki/Dom0_Kernels_for_Xen

Getting Started with Xen on Slackware http://amree.github.io/2012/09/12/getting-started-with-xen-on-slackware/

Xen Documentation https://xenbits.xen.org/docs/unstable/

Xen Project 4.16 Release Notes https://wiki.xenproject.org/wiki/Xen_Project_4.16_Release_Notes

Xen versions and features support matrix https://xenbits.xen.org/docs/unstable/support-matrix.html


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun