I’ve been playing a bit with xen the last few days, and it really rocks. It’s been quite tricky to put up, though. I’ve been following two different guides, but they were missing some stuff for what i wanted to try.
I wanted to build the most generic kernel possible, so that it would be easily useable on most installations, like the generic debian kernels. Well, it has been quite painful. Trying to build in a sid chroot, I hit the first issue : while the xen patch doesn’t apply to linux 2.6.12, linux 2.6.11 doesn’t build with gcc 4.0. You get build errors in I2C, generic serial, and much more other stuff. Then, a bunch of drivers can’t be built because of being unsupported.
When you finally succeed in building the kernel as a generic debian one, i.e. with an initrd, you realize the generated package (built with make-kpkg) doesn’t build the initrd for you, and doesn’t correctly build the modules dependencies (which prevent the initrd to be any useful), even though everything is (supposedly) correctly set-up.
So, after solving all these, I finally was able to boot on a generic xen system and to run some virtual machines. Main issue remaining : xen doesn’t want to find an IRQ for the firewire controller, so i can’t access my external hard-disk…
I’ll try to finalize a clean generic kernel package that does all it is supposed to do, but in the meanwhile, here are the hints if you want to build your own domain 0 kernel :
- install kernel-source-2.6.11 and kernel-patch-xen, and decompress /usr/src/kernel-source-2.6.11.tar.bz2
- copy /boot/config-2.6.11-1-686 in /usr/src/kernel-source-2.6.11/.config
- add CONFIG_XEN=y and CONFIG_XEN_PRIVILEGED_GUEST=y in it (otherwise, a whole bunch of modules get disabled)
- run the following command in the kernel source directory : MAKEFLAGS=”CC=gcc-3.4″ PATCH_THE_KERNEL=YES make-kpkg –arch xen –append-to-version xen0 –revision 1 –initrd –config menuconfig kernel_image
- adjust your configuration if you need (you might want to disable network and block device frontends for the dom0 kernel)
- install the generated kernel
- run depmod 2.6.11xen0 and check your /lib/modules/2.6.11xen0 is correct
- run mkinitrd -o /boot/initrd.img-2.6.11xen0 /lib/modules/2.6.11xen0
- add the following to your /boot/grub/menu.lst file:
title Xen 2.0 / XenLinux 2.6 kernel /boot/xen.gz dom0_mem=131072 module /boot/xen-linux-2.6.11xen0 root=/dev/hda1 ro module /boot/initrd.img-2.6.11xen0
And you might be able to get a working xen kernel…