Difference between pages "DVDless install" and "Compiling Xen"

From Wikislax
(Difference between pages)
Jump to: navigation, search
(Slackware setup)
 
(Updating go)
 
Line 1: Line 1:
 
{{RightTOC}}
 
{{RightTOC}}
  
The (local) network is an additional choice to install Slackware from when your hardware has this capability. Installing from the local network is much faster than from a DVD and is a good choice when playing around with the installation. This page explains how to configure a Slackware server for this usage. It was inspired by the [http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:pxe AlienBob's blog page] on the same topic. To install Slackware over the network we need :
+
== What is Xen ? ==
  
* A service to download the Slackware files during the Slackware setup. HTTP, FTP, or NFS can be used. In the example below we show how to use the NFS and FTP services included with Slackware.
+
[http://wiki.xen.org/wiki/Xen_Overview Xen] is an hypervisor, a thin software layer executing multiple virtual machines, each running its own operating system. Xen is normally used as a server virtualization platform, running on headless servers without graphical console and controlled through the network. However it is also possible to run Xen on graphical desktops, and with proper hardware virtualization, to dedicate the primary graphics card (and keyboard / mouse) to a virtual machine, making it possible to have high performance full 3D and video acceleration in a virtual machine (see [http://wiki.xen.org/wiki/Xen_VGA_Passthrough Xen VGA Passthru]). Xen is otherwise free and open source.
* A service implementing the TFTP protocol. TFTP is used to effectively download the bootstrap code from the server identified. We will use the TFTP protocol included with Slackware.
 
  
* A service implementing the BOOTP protocol. BOOTP is used by the PXE firmware to identify on the network a server to download the bootloader code from. The DHCP server included with the Slackware distribution has this capability.
+
== A few quirks ==
  
== Configuring NFS ==
+
The '''dev86-0.16.21-x86_64-1.txz''' package included with Slackware 14.2 does not afford compiling '''xen-4.9.0''' properly, and must be replaced by '''[{{SERVER}}/wikislax/download/dev86-0.16.17-x86_64-2.txz dev86-0.16.17-x86_64-2.txz]''', that can be found on the Slackware 13.37, 14.0, or 14.1 distribution disks, in directory '''slackware64/d'''. Trying to compile dev86 [http://v3.sk/~lkundrak/dev86/ from source] is not an alternative : dev86 source versions 0.16.18 to 0.16.21 have the same issue compiling xen-4.9.0, and older 0.16.17 does not compile on Slackware 14.2.
  
NFS is SUN's Network File System. It is lightning fast and can be used as a mount point, but depending on configuration may be unsecure and must be used locally only. Also, it uses some random port numbers that need to be fixed if firewalling. The directories used are defined in '''/etc/exports'''. Edit as follows. '''ro''' means read-only, '''sync''' makes sure that no asynchronous requests are made, '''insecure''' affords using different NFS ports from other NFS implementations, '''all_squash''' maps all uids and gids to the anonymous user for public access, '''no_subtree_check''' improves reliability in some circumstances. See '''man exports''' for more details.
+
# removepkg /var/log/packages/dev86-0.16.21-x86_64-1.txz
 +
# installpkg dev86-0.16.17-x86_64-2.txz
  
# See exports(5) for a description.
+
Also, the '''grub-2.00''' included with Slackware 14.2 does not afford booting xen. However, getting the latest version '''grub-2.02''' from source does work.
# This file contains a list of all directories exported to other computers.
 
# It is used by rpc.nfsd and rpc.mountd.
 
 
/var/pub      192.168.53.1/24(ro,sync,insecure,all_squash,no_subtree_check)
 
 
 
The NFS server is launched using '''/etc/rc.d/rc.nfsd'''. Make this script executable so as to use it on every boot. You can also '''start''' it to test it immediately. The NFS client is launched using '''/etc/rc.d/rc.rpc''' and affords using NFS mount points from other NFS servers. Make this script executable if you want to use it and have it started on every reboot. This can be handy to cross-test NFS machines. Otherwise it should not be necessary.
 
 
 
# chmod u+x /etc/rc.d/rc.nfsd
 
# chmod u+x /etc/rc.d/rc.rpc
 
  
== Configuring FTP ==
+
== Hardware requirements ==
  
As SSH affords encrypted authentication and transfers, FTP will be used on our site only for anonymous public downloads. FTP uses fixed port numbers so it is easy to firewall, but it is much slower than NFS. Slackware includes two FTPs : ProFTPd and vsFTP. We will use the latter. Using vsFTP requires very little configuration : setting the home directory of the ftp user to where we want our files to be downloaded from, uncommenting the correct '''ftp''' line in '''/etc/inetd.conf''' and '''/etc/rc.d/rc.inetd restart''', updating the firewall rules. For more details '''man vsftpd.conf'''.
+
Xen runs on Intel X86 hardware and requires a processor and motherboard supporting VT-x and optionally VT-d for hardware virtualization. See this [http://www.intel.com/support/motherboards/desktop/sb/cs-030922.htm page] for a list of Intel compatible motherboards and chipsets and this [http://ark.intel.com/ page] for a list of compatible processors. Our system running Xen successfully at the time of this writing (and since June 2012) is based on a DZ77GA70K Intel motherboard, an Intel® Core™ i7-3770 Processor (the overclockable i7-3770 "K" model does not afford virtualization), 32 Gb of PC12800 memory and an MSI GeForce G210 graphics board.
 
# usermod --home /var/pub ftp
 
. . .  
 
# Very Secure File Transfer Protocol (FTP) server.
 
ftp    stream  tcp    nowait  root    /usr/sbin/tcpd  vsftpd
 
. . .
 
# /etc/rc.d/rc.inetd restart
 
. . .
 
# services on local network FTP BOOTP HTTP NNTP IMAP HTTPS SUBMIT VNC VOIP
 
iptables -A INPUT -p tcp -j ACCEPT --dport 20 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 21 -m state --state NEW -s 192.168.0.0/16
 
  
== Putting the Slackware install files online ==
+
== Documentation difficulties ==
  
Copy the content of the slackware DVD to a disk directory, for instance '''/var/pub/slackware64-15.0'''
+
Although the software itself works well and is pretty straighforward, good quality Internet information is missing. The volume of information on the Xen wiki is plethoric, but mostly irrelevant as pertaining to old versions of everything. Building the big picture requires interpretation of tiny bits in forum messages, a pretty painful process, although I have to recognize that it worked for me in the end. An alternative is to use one of these old-style information repositories named "books". Yes it is pretty old-fashionned ;) but actually there are good ones on the topic. Here is [http://www.amazon.co.uk/The-Book-Xen-Practical-Administrator/dp/1593271867/ref=sr_1_1?s=books&ie=UTF8&qid=1341037874&sr=1-1 the most recent I found], it is a good value but of course you can find more on [http://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=xen&x=0&y=0 amazon(.co.uk)].
  
# mkdir /mnt/dvd
+
== Software constraints ==
# mkdir /var/pub/slackware64-15.0
 
# mount -o loop slackware64-15.0-install-dvd.iso /mnt/dvd
 
# cp -a /mnt/dvd/* /var/pub/slackware64-15.0/
 
# umount /mnt/dvd
 
  
During install, when asked for the source directory specify subdirectory '''slackware64''' that is, '''/var/pub/slackware64-15.0/slackware64'''
+
To make a long story short, at the time of this writing (and since June 2012) working with nVidia graphic boards on Xen and X11 requires the "nouveau" driver. Other drivers like nv or the nVidia proprietary driver do not support Xen and switch off the screen when launched or do not display properly. "Nouveau" requires a fairly recent version of X11. Slackware 13.37 or newer is required. "Nouveau" is available in kernel 3.4.2 upstream and was previously included as a staging driver. Xen dom0 support was included in kernel 3.0. To benefit from both Xen and "Nouveau", the best is to use kernel 3.4.2 upstream.
  
The Slackware network setup uses NFS version 3 meaning that directory paths are absolute.
+
== Compiling acpica ==
  
== Configuring TFTPBOOT ==
+
Xen requires acpica. [https://www.acpica.org/downloads Download] then install as below :
  
TFTP is the trivial ftp protocol (for use on a local network). Let's create the '''tftp bootp''' file structure under the default '''/tftpboot''' directory. The directory where we store the bootloader files is '''/tftpboot/slackware64-15.0''' :
+
# tar -C /usr/local -xvf acpica-unix-yyyymmdd.tar.gz
 +
# cd /usr/local
 +
# chown -R root:root acpica-unix-yyyymmdd
 +
# cd acpica-unix-yyyymmdd
 +
# make
 +
# make install
 +
# cd ..
 +
# rm -r acpica-unix-yyyymmdd
  
# mkdir /tftpboot
+
== Compiling yajl ==
# mkdir /tftpboot/slackware64-15.0
 
# mkdir /tftpboot/slackware64-15.0/pxelinux.cfg
 
# cp /usr/share/syslinux/pxelinux.0 /tftpboot/slackware64-15.0/
 
# cp /var/pub/slackware64-15.0/isolinux/message.txt /tftpboot/slackware64-15.0/
 
# cp /var/pub/slackware64-15.0/isolinux/f2.txt /tftpboot/slackware64-15.0/
 
# cp -a /var/pub/slackware64-15.0/kernels /tftpboot/slackware64-15.0/
 
# cp /var/pub/slackware64-15.0/usb-and-pxe-installers/pxelinux.cfg_default /tftpboot/slackware64-15.0/pxelinux.cfg/default
 
# cp /var/pub/slackware64-15.0/isolinux/initrd.img /tftpboot/slackware64-15.0/
 
  
Tftpboot is handled by '''inetd'''. To activate it, uncomment the tftp line in '''/etc/inetd.conf''' then '''/etc/rc.d/rc.inetd restart''' or reboot.
+
Xen requires yajl. [http://lloyd.github.io/yajl/ Download] then install as below. <u>Note</u> : there is no option to specify the target library directory so the files need to be moved manually.
  
  tftp dgram  udp    wait    root    /usr/sbin/in.tftpd in.tftpd -s /tftpboot -r blksize
+
  # tar -C /usr/local -xvf lloyd-yajl-x.y.z.66cb08c.tar.gz
 +
  # cd /usr/local
 +
# chown -R root:root lloyd-yajl-66cb08c
 +
# cd lloyd-yajl-66cb08c
 +
# ./configure
 +
# make
 +
# make install
 +
# cd ../lib
 +
  # mv libyajl* ../lib64
 +
# ldconfig
 +
# cd ..
 +
# rm -r lloyd-yajl-66cb08c
  
== Configuring DHCP ==
+
== Updating go ==
  
We configure '''/etc/dhcpd.conf''' as follows. Our subnet is '''192.168.53.0''', our network mask '''255.255.255.0''', our IP address is '''192.168.53.1''', our router address '''192.168.53.254'''. The IP DHCP range is '''192.168.53.154''' to '''192.168.53.253'''. For more details on other configuration possbilities, '''man dhcpd.conf'''.
+
Xen 4.19.1 requires the go language. Go is included as part of gcc but does not work "as is" and must be replaced by the version from the go web site.
  
  # dhcpd.conf
+
  # ls /var/log/packages | grep gcc-go
#
+
  gcc-go-11.2.0-x86_64-2
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
+
  # removepkg gcc-go-11.2.0-x86_64-2
#
+
. . .
+
# wget https://go.dev/dl/go1.23.5.linux-amd64.tar.gz
  # If this DHCP server is the official DHCP server for the local
+
  # tar -C /usr/local -xvf go1.23.5.linux-amd64.tar.gz
# network, the authoritative directive should be uncommented.
 
authoritative;
 
ddns-update-style none;
 
 
# Allow bootp requests
 
allow bootp;
 
 
# Point to the TFTP server:
 
next-server 192.168.53.1;
 
 
# Default lease is 1 week (604800 sec.)
 
default-lease-time 604800;
 
  # Max lease is 4 weeks (2419200 sec.)
 
max-lease-time 2419200;
 
 
subnet 192.168.53.0 netmask 255.255.255.0 {
 
    option domain-name "studioware.com";
 
    option broadcast-address 192.168.53.255;
 
    option subnet-mask 255.255.255.0;
 
    option domain-name-servers 192.168.53.1;
 
    option routers 192.168.53.254;
 
    range dynamic-bootp 192.168.53.154 192.168.53.253;
 
    use-host-decl-names on;
 
    if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
 
      filename "/slackware64-15.0/pxelinux.0";
 
    }
 
}
 
 
 
Next is to create a script '''/etc/rc.d/rc.dhcpd''' to launch dhcp. Our bridged interface is '''br0''' :
 
 
 
#!/bin/sh
 
#
 
# /etc/rc.d/rc.dhcpd
 
#      This shell script takes care of starting and stopping
 
  #     the ISC DHCPD service
 
#
 
 
# Put the command line options here that you want to pass to dhcpd:
 
DHCPD_OPTIONS="-q '''br0'''"
 
 
[ -x /usr/sbin/dhcpd ] || exit 0
 
 
[ -f /etc/dhcpd.conf ] || exit 0
 
 
start() {
 
      # Start daemons.
 
      echo -n "Starting dhcpd:  /usr/sbin/dhcpd $DHCPD_OPTIONS "
 
      /usr/sbin/dhcpd $DHCPD_OPTIONS
 
      echo
 
}
 
stop() {
 
      # Stop daemons.
 
      echo -n "Shutting down dhcpd: "
 
      killall -TERM dhcpd
 
      echo
 
}
 
status() {
 
  PIDS=$(pidof dhcpd)
 
  if [ "$PIDS" == "" ]; then
 
    echo "dhcpd is not running!"
 
  else
 
    echo "dhcpd is running at pid(s) ${PIDS}."
 
  fi
 
}
 
restart() {
 
      stop
 
      start
 
}
 
 
# See how we were called.
 
case "$1" in
 
  start)
 
        start
 
        ;;
 
  stop)
 
        stop
 
        ;;
 
  restart)
 
        stop
 
        start
 
        ;;
 
  status)
 
        status
 
        ;;
 
  *)
 
        echo "Usage: $0 {start|stop|status|restart}"
 
        ;;
 
esac
 
 
exit 0
 
 
 
Next is to make '''/etc/rc.d/rc.dhcpd''' executable, launch it from '''/etc/rc.d/rc.local''' and stop it from '''/etc/rc.d/rc.local_shutdown''' :
 
  
# chmod u+x rc.dhcpd
+
== Compiling Xen ==
. . .
 
# start dhcpd
 
if [ -x /etc/rc.d/rc.dhcpd ]; then
 
        /etc/rc.d/rc.dhcpd start
 
fi
 
. . .
 
# stop dhcpd
 
if [ -x /etc/rc.d/rc.dhcpd ]; then
 
    /etc/rc.d/rc.dhcpd stop
 
fi
 
  
== Firewalling NFS ==
+
[http://xen.org/products/xen_source.html Download Xen] from the official [http://www.xen.org xen.org] site. <u>Note</u> : File stubs-32.h is missing in the compiler includes so we add a link to the existing stubs-64.h. Also, some Xen Python scripts are installed in /usr/local/lib64/python-2.7/site-packages which python cannot find so we add links from the standard library as well.
  
Refer to [[IPTables]] for an introduction on packet filtering. NFS uses some random ports by defaults, that we need to fix if we want to be able to do proper packet filtering. To be precise, NFS uses sunrpc/111 and nfsd/2049, and random port numbers are used by other NFS daemons but it is possible to specify alternative port numbers on the command line or in the '''/etc/services''' file, to which we add :
+
# cd /usr/include/gnu
 +
# ln -s stubs-64.h stubs-32.h
 +
# cd
 +
# tar -C /usr/local -xvf xen-x.y.z.tar.gz
 +
# cd /usr/local
 +
# chown -R root:root xen-x.y.z
 +
# cd xen-x.y.z
 +
# ./configure --libdir=/usr/local/lib64 --with-initddir=/etc/rc.d
 +
# make world
 +
# make install
 +
# make clean
 +
# cd ../lib64/python2.7/site-packages
 +
# ln -s xen /usr/lib64/python2.7/site-packages
 +
# ln -s xen-3.0-py2.7.egg-info /usr/lib64/python2.7/site-packages
  
rpc.nfs-cb      32764/tcp  # RPC nfs callback
+
== Adjusting rc.local* ==
rpc.nfs-cb      32764/udp  # RPC nfs callback
 
status          32765/udp  # NFS status (listen)
 
status          32765/tcp  # NFS status (listen)
 
status          32766/udp  # NFS status (send)
 
status          32766/tcp  # NFS status (send)
 
mountd          32767/udp  # NFS mountd
 
mountd          32767/tcp  # NFS mountd
 
lockd          32768/udp  # NFS lock daemon/manager
 
lockd          32768/tcp  # NFS lock daemon/manager
 
rquotad        32769/udp  # NFS rquotad
 
rquotad        32769/tcp  # NFS rquotad
 
  
The '''/etc/rc.d/rc.nfsd''' and '''/etc/rc.d/rc.rpc''' scripts are modified to specify port numbers on the command lines :
+
Xen needs a couple of daemons to run to ensure VM management. Add these lines to rc.local and rc.local_shutdown :
  
  if [ -x /usr/sbin/rpc.rquotad ]; then
+
  PATH=/usr/local/sbin:/usr/local/bin:$PATH
  echo "  /usr/sbin/rpc.rquotad '''-p 32769'''"
+
  export PATH
  /usr/sbin/rpc.rquotad '''-p 32769'''
 
  fi
 
 
   
 
   
  if [ -x /usr/sbin/rpc.mountd ]; then
+
# start xencommons
  echo "  /usr/sbin/rpc.mountd '''-p 32767'''"
+
  if [ -x /etc/rc.d/xencommons ]; then
  /usr/sbin/rpc.mountd '''-p 32767'''
+
    /etc/rc.d/xencommons start
 
  fi
 
  fi
 
   
 
   
  if ! ps axc | grep -q rpc.statd ; then
+
# stop xencommons
  echo "Starting RPC NSM (Network Status Monitor):  /sbin/rpc.statd '''-p 32765 -o 32766'''"
+
  if [ -x /etc/rc.d/xencommons ]; then
  /sbin/rpc.statd '''-p 32765 -o 32766'''
+
    /etc/rc.d/xencommons stop
 
  fi
 
  fi
  
To make the lock daemon listen on port '''32768''' only and set the nfs callback port to '''32764''' we need to create file '''/etc/sysctl.d/nfs.conf''' :
+
== Compiling a dom0 Kernel ==
 
 
fs.nfs.nlm_udpport=32768
 
fs.nfs.nlm_tcpport=32768
 
fs.nfs.nfs_callback_tcpport=32764
 
 
 
Last BOOTP and the NFS ports must be added to '''/etc/rc.d/rc.firewall''' :
 
 
# BOOTP
 
iptables -A INPUT -p udp -j ACCEPT --dport 69 -s 192.168.0.0/16
 
 
# NFS ports
 
iptables -A INPUT -p udp -j ACCEPT --dport 111 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 111 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 2049 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 2049 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 32764 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 32764 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 32765 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 32765 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 32766 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 32766 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 32767 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 32767 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 32768 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 32768 -m state --state NEW -s 192.168.0.0/16
 
iptables -A INPUT -p udp -j ACCEPT --dport 32769 -s 192.168.0.0/16
 
iptables -A INPUT -p tcp -j ACCEPT --dport 32769 -m state --state NEW -s 192.168.0.0/16
 
 
 
== Slackware setup ==
 
 
 
A few pieces of advice to make your Slackware setup from network easier :
 
  
* For some reason Slackare might use an interface other than eth0. Just move the cable to the right slot or update (or remove) /etc/udev/rules.d/70-persistent-net.rules.
+
Domain-0 (dom0 for short) is a special guest (virtual machine) that the Xen hypervisor always loads on host startup. Dom0 is used to control and manage the Xen hypervisor, and provides virtual disks and networks for other unprivileged guests (=domUs). Dom0 support was introduced in Linux kernel 3.0. The kernel generated must include the .config file domU and [http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs#Configuring_the_kernel dom0 options]. Here is a minimal example of such a [{{SERVER}}/wikislax/download/config-dom0 .config dom0] file. Feel free to use it as a base, replacing device drivers as required. The rest of the kernel compilation is nominal :
  
* Slackware network setup uses NFS version 3 meaning that directory paths are absolute. For instance /var/pub/slackware64-14.2/slackware64.
+
# tar -C /usr/src -xvf linux-4.4.88.tar.bz2
 +
# cd /usr/local
 +
# rm linux
 +
# ln -s linux-4.4.88 linux
 +
# cd linux
 +
# make menuconfig
 +
# make
 +
# make modules_install
 +
# cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.4.88-dom0
 +
# cp System.map /boot/System.map-4.4.88-dom0
 +
# cp .config /boot/config-4.4.88-dom0
  
* The FTP directory paths are instead relative to the ftp user home directory.
+
We're now all set up, Xen is ready to be booted by grub2 !
  
 
<br/>
 
<br/>
  
{{pFoot|[[Managing partitions]]|[[Main Page]]|[[Installing Slackware]]}}
+
{{ pFoot |[[Compiling from Source]]|[[Main Page]]|[[Using Grub2]]}}

Revision as of 10:30, 4 February 2025

What is Xen ?

Xen is an hypervisor, a thin software layer executing multiple virtual machines, each running its own operating system. Xen is normally used as a server virtualization platform, running on headless servers without graphical console and controlled through the network. However it is also possible to run Xen on graphical desktops, and with proper hardware virtualization, to dedicate the primary graphics card (and keyboard / mouse) to a virtual machine, making it possible to have high performance full 3D and video acceleration in a virtual machine (see Xen VGA Passthru). Xen is otherwise free and open source.

A few quirks

The dev86-0.16.21-x86_64-1.txz package included with Slackware 14.2 does not afford compiling xen-4.9.0 properly, and must be replaced by dev86-0.16.17-x86_64-2.txz, that can be found on the Slackware 13.37, 14.0, or 14.1 distribution disks, in directory slackware64/d. Trying to compile dev86 from source is not an alternative : dev86 source versions 0.16.18 to 0.16.21 have the same issue compiling xen-4.9.0, and older 0.16.17 does not compile on Slackware 14.2.

# removepkg /var/log/packages/dev86-0.16.21-x86_64-1.txz
# installpkg dev86-0.16.17-x86_64-2.txz

Also, the grub-2.00 included with Slackware 14.2 does not afford booting xen. However, getting the latest version grub-2.02 from source does work.

Hardware requirements

Xen runs on Intel X86 hardware and requires a processor and motherboard supporting VT-x and optionally VT-d for hardware virtualization. See this page for a list of Intel compatible motherboards and chipsets and this page for a list of compatible processors. Our system running Xen successfully at the time of this writing (and since June 2012) is based on a DZ77GA70K Intel motherboard, an Intel® Core™ i7-3770 Processor (the overclockable i7-3770 "K" model does not afford virtualization), 32 Gb of PC12800 memory and an MSI GeForce G210 graphics board.

Documentation difficulties

Although the software itself works well and is pretty straighforward, good quality Internet information is missing. The volume of information on the Xen wiki is plethoric, but mostly irrelevant as pertaining to old versions of everything. Building the big picture requires interpretation of tiny bits in forum messages, a pretty painful process, although I have to recognize that it worked for me in the end. An alternative is to use one of these old-style information repositories named "books". Yes it is pretty old-fashionned ;) but actually there are good ones on the topic. Here is the most recent I found, it is a good value but of course you can find more on amazon(.co.uk).

Software constraints

To make a long story short, at the time of this writing (and since June 2012) working with nVidia graphic boards on Xen and X11 requires the "nouveau" driver. Other drivers like nv or the nVidia proprietary driver do not support Xen and switch off the screen when launched or do not display properly. "Nouveau" requires a fairly recent version of X11. Slackware 13.37 or newer is required. "Nouveau" is available in kernel 3.4.2 upstream and was previously included as a staging driver. Xen dom0 support was included in kernel 3.0. To benefit from both Xen and "Nouveau", the best is to use kernel 3.4.2 upstream.

Compiling acpica

Xen requires acpica. Download then install as below :

# tar -C /usr/local -xvf acpica-unix-yyyymmdd.tar.gz
# cd /usr/local
# chown -R root:root acpica-unix-yyyymmdd
# cd acpica-unix-yyyymmdd
# make
# make install
# cd ..
# rm -r acpica-unix-yyyymmdd

Compiling yajl

Xen requires yajl. Download then install as below. Note : there is no option to specify the target library directory so the files need to be moved manually.

# tar -C /usr/local -xvf lloyd-yajl-x.y.z.66cb08c.tar.gz
# cd /usr/local
# chown -R root:root lloyd-yajl-66cb08c
# cd lloyd-yajl-66cb08c
# ./configure
# make
# make install
# cd ../lib
# mv libyajl* ../lib64
# ldconfig
# cd ..
# rm -r lloyd-yajl-66cb08c

Updating go

Xen 4.19.1 requires the go language. Go is included as part of gcc but does not work "as is" and must be replaced by the version from the go web site.

# ls /var/log/packages | grep gcc-go
gcc-go-11.2.0-x86_64-2
# removepkg gcc-go-11.2.0-x86_64-2
. . .
# wget https://go.dev/dl/go1.23.5.linux-amd64.tar.gz
# tar -C /usr/local -xvf go1.23.5.linux-amd64.tar.gz

Compiling Xen

Download Xen from the official xen.org site. Note : File stubs-32.h is missing in the compiler includes so we add a link to the existing stubs-64.h. Also, some Xen Python scripts are installed in /usr/local/lib64/python-2.7/site-packages which python cannot find so we add links from the standard library as well.

# cd /usr/include/gnu
# ln -s stubs-64.h stubs-32.h
# cd
# tar -C /usr/local -xvf xen-x.y.z.tar.gz
# cd /usr/local
# chown -R root:root xen-x.y.z
# cd xen-x.y.z
# ./configure --libdir=/usr/local/lib64 --with-initddir=/etc/rc.d
# make world
# make install
# make clean
# cd ../lib64/python2.7/site-packages
# ln -s xen /usr/lib64/python2.7/site-packages
# ln -s xen-3.0-py2.7.egg-info /usr/lib64/python2.7/site-packages

Adjusting rc.local*

Xen needs a couple of daemons to run to ensure VM management. Add these lines to rc.local and rc.local_shutdown :

PATH=/usr/local/sbin:/usr/local/bin:$PATH
export PATH

# start xencommons
if [ -x /etc/rc.d/xencommons ]; then
    /etc/rc.d/xencommons start
fi

# stop xencommons
if [ -x /etc/rc.d/xencommons ]; then
    /etc/rc.d/xencommons stop
fi

Compiling a dom0 Kernel

Domain-0 (dom0 for short) is a special guest (virtual machine) that the Xen hypervisor always loads on host startup. Dom0 is used to control and manage the Xen hypervisor, and provides virtual disks and networks for other unprivileged guests (=domUs). Dom0 support was introduced in Linux kernel 3.0. The kernel generated must include the .config file domU and dom0 options. Here is a minimal example of such a .config dom0 file. Feel free to use it as a base, replacing device drivers as required. The rest of the kernel compilation is nominal :

# tar -C /usr/src -xvf linux-4.4.88.tar.bz2
# cd /usr/local
# rm linux
# ln -s linux-4.4.88 linux
# cd linux
# make menuconfig
# make
# make modules_install
# cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.4.88-dom0
# cp System.map /boot/System.map-4.4.88-dom0
# cp .config /boot/config-4.4.88-dom0

We're now all set up, Xen is ready to be booted by grub2 !


Compiling from Source Main Page Using Grub2