Compiling a Xen Dom0 Kernel for Ubuntu Jaunty

Distribution: Ubuntu Jaunty 9.04

Configure the environment for Compiling

From the menus choose to System -> Administration -> Software Sources you will see several check boxes.

  • Canonical-supported Open Source software (main)
  • Community-maintained Open Source software (universe)
  • Proprietary drivers for devices (restricted)
  • Software restricted by copyright or legal issues (multiverse)
  • Source code

you should checked all these 5 boxes then click ‘Close’. You should see a box that says “The information about available software is out of date”. Click on the reload button. When these boxes have gone:

/etc/apt/sources.list should contain at least these two lines:

    deb http://archive.ubuntu.com/ubuntu jaunty main universe multiverse restricted  
    deb-src http://archive.ubuntu.com/ubuntu jaunty main universe multiverse restricted

Now you should be able to use:

    apt-get install fakeroot build-essential   
    apt-get install crash kexec-tools makedumpfile   
    apt-get build-dep linux   
    apt-get install git-core libncurses5 libncurses5-dev

Download and Patch the Kernel

Copy in a suitable configuration

In order to create a configuration that created a bootable kernel I actually used the configuration file found in this package: linux-image-2.6.26-2-xen-686_2.6.26-15_i386.deb

You can download it from from here:

Kernel: http://packages.debian.org/lenny/i386/linux-image-2.6.26-2-xen-686/download Modules: http://packages.debian.org/lenny/i386/linux-modules-2.6.26-2-xen-686/download

and then install using

    sudo dpkg -i linux-image-2.6.26-2-xen-686_2.6.26-15lenny2_i386.deb linux-modules-2.6.26-2-xen-686_2.6.26-15lenny2_i386.deb

Its actually possible to run Xen with this debian kernel, and thats the subject of another post

You can now copy in the configuration from that kernel using:

    cd /usr/src/linux-  
    cp /boot/config-2.6.26-2-xen-686 .config

Configure and Build the Kernel

    cd /usr/src/linux-  
    make menuconfig  
    make vmlinuz  
    make modules_install

Copy the Kernel Image and Initial Ramdisk to /boot

    cd /usr/src/linux-  
    cp arch/x86/boot/vmlinuz  /boot/xen-test-vmlinuz  
    mkinitramfs -o /boot/initrd-test-

Create a Suitable Entry in /boot/grub/menu.lst

    title           TEST Xen 3.3.0 / Ubuntu 9.04  
    uuid            32ce16fb-1400-4d71-bb37-c98ef140e501  
    kernel          /xen-3.3.0.gz  
    module          /xen-test-vmlinuz root=/dev/vga/dom0 ro console=tty0  
    module          /initrd-test-

And your done!