etch or 4.0 is an obsolete Debian release that doesn't have security or any other kind of support. Use newer releases!

This information is preserved only for completeness

Upstream documentation can be found in the xen-docs-3.0 package (in /usr/share/doc/xen-docs-3.0/user.pdf.gz). It's also available online.

Dom0 (host)

The xen-linux-system packages of interest are (Install the correct one for your architecture):

If you need to apply some modifications to the kernel with the xen patch, then one way to do it is described DebianKernelCustomCompilation.

Serial console access

To get output from grub, XEN, the kernel and getty (login prompt) via both vga and serial console to work, here's an example of the right settings when using etch kernels and Xen 3.0.3:

In /boot/grub/menu.lst:

serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console
[...]
title           Xen 3.0.3-1-i386-pae / Debian GNU/Linux, kernel 2.6.18-6-xen-686
root            (hd0,0)
kernel          /boot/xen-3.0.3-1-i386-pae.gz com1=9600,8n1 console=com1,vga
module          /boot/vmlinuz-2.6.18-6-xen-686 root=/dev/md0 ro console=tty0 console=ttyS0,9600n8
module          /boot/initrd.img-2.6.18-6-xen-686

In /etc/inittab you need at least these lines:

1:2345:respawn:/sbin/getty 38400 tty1
T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100

DomU (guests)

The easiest way to create a domU is to use xen-tools (and, if this doesn't do what you need, Steve Kemp is keen and fast in implementing useful suggestions).

If you do not wish to use xen-tools, you could use this alternative guide, to setup the system using debootstrap.

Xen boots domUs using kernels stored on dom0, so you only need to install the corresponding linux-modules package in the domU. Alternatively, you can use PyGrub to boot kernels on the domU filesystem.

On i386, make sure you install libc6-xen.

If you install lenny domU on etch dom0, make sure you read this entry on XenFaq when you see messages on the console like 4gb seg fixup, process klogd (pid 2075), cs:ip 73:b7e25870. After applying the echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf && ldconfig, in the dom0 system, reboot, or, if you don't like rebooting (which requires you to stop domU's), restart all processes mentioned in the log messages (e.g. /etc/init.d/ssh restart, init q, etc..)

Notes on kernel version compatibility

In general:

For those who want to test the 2.6.32 kernel domU on an earlier dom0, you have to make sure that the xen-blkfront domU driver is loaded, and can find the root and other disk partitions. This is no longer the case if you still use the deprecated hda* or sda* device names in domU .cfg files. Switch to xvda* devices, which also work with 2.6.18 and 2.6.26 dom0 kernels.

There are also the backward-looking options: