[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


Creating a Xen DomU Guest

Installation

First, we must prepare a Slackware install in a virtual machine. You could always do this in Xen itself, however I recommend using something else, e.g. VirtualBox, KVM, VMWare or something because I suspect it will be faster. My experience of HVM (non-paravirtualised) Xen is that it is not as fast as KVM/VirtualBox, and we will need to recompile a kernel for this.

Select at a minimum disk sets A, AP, D, K, L and N sets. Install everything. You can try with less if you like, this is the way I've tested.

Make an Initrd

Now we must create an initrd.

# cd /boot
# mkinitrd -c

And of course, add it to LILO

image = /boot/vmlinuz
  root = /dev/sda1
  label = Linux
  read-only
  initrd = /boot/initrd.gz

UUID Root device

Next, we must setup lilo to boot using the UUID of the root partition instead of the device name (/dev/sda1 etc…)

Run the blkid program to list the UUIDs of the partitions, copy the one that matches the above partition, e.g

# blkid
/dev/sda1: UUID="43b8f058-1f75-4944-af9a-ee33ecc297aa" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c0baa0b2-01"

Add that UUID into your lilo.conf taking care to quote it correctly (the quotes go around the whole thing!)

image = /boot/vmlinuz
  root = "UUID=43b8f058-1f75-4944-af9a-ee33ecc297aa"
  label = Linux
  read-only
  initrd = /boot/initrd.gz

In /etc/fstab, change /dev/sda1 (or whatever your root partition was) in similar way, but you don't need any quotes this time:

UUID=43b8f058-1f75-4944-af9a-ee33ecc297aa     /                ext4        defaults
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro
...

After this you may wish to run lilo, check that your system still boots. All we have done is convert the root device to use UUID, nothing else. This is explained elsewhere in Slackware documentation but added here to speed things up.

Recompile the kernel

Get ready to recompile the kernel using the current config as a starting point.

# cd /usr/src/linux
# zcat /proc/config.gz > .config
# make menuconfig

Then select the following kernel options

Processor type 
 Processor type and features  ---> 
  [*] Linux guest support  ---> 
   [*] Xen guest support                  # sets CONFIG_XEN  and several others.

Device Drivers  --->
 [*] PCI support  --->  
  <*>   Xen PCI Frontend (NEW)                 # sets CONFIG_XEN_PCIDEV_FRONTEND
 [*] Block devices  --->
  <*>   Xen virtual block device support (NEW)         # sets CONFIG_XEN_BLKDEV_FRONTEND
 SCSI device support  ---> 
  [*] SCSI low-level drivers  --->
   <*>   XEN SCSI frontend driver        # sets CONFIG_XEN_SCSI_FRONTEND

 -*- Network device support  --->
  <*>   Xen network device frontend driver (NEW)      # sets CONFIG_XEN_NETDEV_FRONTEND

Sources

 howtos:misc:xen_domu_guest ()