Xen Dom0 on Debian Sarge

From ConShell
Jump to: navigation, search

Guide to deploying Xen 2.0.x on Debian Sarge

Last updated: 2005-Dec-06

Note: I am not using the debian packages. I do not think they are even maintained.

This guide explains how to compile, install and setup Xen 2.0.x on Debian Sarge (a.k.a. stable). Feel free to add or clarify any sections if you have the knowledge.

Any questions can be directed to Mark Foster <mark@foster.cc>

REFERENCES

PROCEDURE

Prepare the base system by installing Debian Sarge and a few packages. I prefer using the debian-installer CD to get Sarge up and running.

important.gif You may need to manually edit the apt sources.list in the installer to point to stable (sarge) sources, instead of testing (sid). This is because rc3 came out prior to sarge becoming stable.

 aptitude install iproute iproute-dev bridge-utils twisted 
 aptitude install libcurl3 libcurl3-dev bzip2 ncurses-dev
 aptitude install make python python2.3-dev

Download Xen the source code from http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads.html

 cd /usr/src
 wget http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-2.0.7-src.tgz


Untar, compile and install. You must use GCC 3, GCC 4 will fail.

 tar xzvf xen-2.0.7-src.tgz
 cd xen-2.0/
 make world
 make install

If you encounter any problems in the steps above, double-check that your pre-requisite packages got installed correctly! Read the Xen user documentation and FAQ. Check the logs at /var/log/xend.log and /var/log/xend-debug.log

Only after doing the proper amount of research should you utilitize the xen-users email list for help.

Now we need to add the xen0 kernel to the grub menu reboot. This will vary depending on your setup. For instance, you will want the root= line to reference your / partition. I add the nousb kernel option to skip loading of USB code which has reportedly caused some problems on Dell PowerEdge hardware.

Here is an example of the xen kernel entry in /boot/grub/menu.lst

 title Xen 2.0 / XenLinux 2.6.11
   root  (hd0,1)
   kernel /xen.gz dom0_mem=128000 noreboot console=tty0
   module /vmlinuz-2.6.11-xen0 root=/dev/sda1 nousb

The xen developer team recommendeds we move the native TLS libraries on the Dom0 system out of the way as they are a real drag on performance.

 mv /lib/tls /lib/tls.disabled

Now it is safe to reboot - make sure to choose the Xen kernel when the system comes back up. It can also be made the default in /boot/grub/menu.lst

 reboot

Once you have rebooted into the Xen kernel, start the xen daemon.

 xend start

Next, see Debian Sarge on Xen or Centos-4 on Xen to setup some virtual machines (aka DomUs). or setup your own. You can choose from NetBSD, just about any flavor of Linux, and soon FreeBSD, Win2K3/XP etc.


Kernel customization

If you need extra modules for your hardware or environment, it will be necessary to configure a custom Xen kernel. Here is how. This example is enabling autofs4 on a Debian Sarge platform. As noted in the make world step above, the module in question is NOT built as desired.

 Kernel automounter version 4 support (also supports v3) (AUTOFS4_FS) [N/m/y/?] n

So we'll need to change that.

 aptitude install ncurses-dev
 cd /usr/local/src/xen-2.0/linux-2.6.11-12-xen0
 make ARCH=xen menuconfig

Choose

 <*> Kernel automounter version 4 support (also supports v3) from the filesystems menu, then Exit.
 cd ..
 time make -j2 kernels
 time make -j2 install-kernels

important.gif Once a .config file is in linux-2.6.11-10-xen0 it will NOT be overwritten, If the .config file is not found, the one from dist/install/boot/config-2.6.11-12-xen0 will be used (copied into .config).

important.gif Turning off USB support (both in the kernel config, in the grub entry (nousb) and at the BIOS level may help with lockup issues.