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
    (adjust the root device and the dom0 memory size if necessary)

And you might be able to get a working xen kernel…

2005-08-30 20:10:17+0900

miscellaneous, p.d.o

Both comments and pings are currently closed.

3 Responses to “Xen”

  1. Dick Davies Says:

    Did you see the announcement about xen sources for debian and ubuntu? Was up today on ubuntu-devel and xen-users ( though not debian-devel apparently ) – see http://lists.xensource.com/archives/html/xen-users/2005-08/msg00765.html .

    Hopefully should make all this a bit less painful – though I’m about to see if the stock dom0 kernel supports LVM roots, so I might end up eating my words…

  2. glandium Says:

    Unfortunately, the provided kernel is a default xen kernel, not a default debian kernel, so it gets almost no modules compiled.

  3. N. Clements Says:

    You might want to look at the Option-C unofficial Debian packages: http://www.option-c.com/xwiki/Debian_Xen_2.0.6_Packages and http://www.option-c.com/xwiki/Debian_Xen_2.0.7_Packages.

    Both have more modules than the default Xen configuration (although not things like soundcards, because they’ve been built with server installation in mind). LVM, NFS, most “standard” filesystems, and so forth are included.

    The feedback has been good from the people using it.