On this page

Installing Xen 3.3 With Kernel 2.6.27 On Ubuntu 8.10 (x86_64)

Version 1.0
Author: Falko Timme

This tutorial shows how you can install Xen 3.3 on an Ubuntu 8.10 host (dom0). Xen 3.3 is available from the Ubuntu 8.10 repositories, but the Ubuntu 8.10 kernels (2.6.27-x) are domU kernels, i.e., they work for Xen guests (domU), but not for the host (dom0). Therefore we need to build our own dom0 kernel. This guide explains how to do this with a 2.6.27 kernel.

I do not issue any guarantee that this will work for you!

1 Preliminary Note

I'm using an Ubuntu 8.10 x86_64 system with the hostname server1.example.com and the IP address 192.168.0.100 as the host system (dom0). I will use Debian Lenny for the virtual machines (domU).

This guide will explain how to set up image-based virtual machines and also LVM-based virtual machines.

I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:

sudo su

2 Installing Xen

First upgrade your system...

apt-get upgrade

... and install the latest kernel from the Ubuntu repositories:

apt-get install linux-image-server linux-server

Next we install Xen 3.3 and the prerequisites for building our dom0 kernel:

As you see, there's a new kernel, 2.6.27.5, but no ramdisk for it; therefore we build one...

depmod 2.6.27.5
update-initramfs -c -k 2.6.27.5

... and update our bootloader:

update-grub

Afterwards we open /etc/modules and make sure that we have the line loop max_loop=64 in it (this step is needed only if you want to create image-based virtual machines - you can skip it if you want to create LVM-based virtual machines):

Falko Timme is an experienced Linux administrator and founder of Timme Hosting, a leading nginx business hosting company in Germany. He is one of the most active authors on HowtoForge since 2005 and one of the core developers of ISPConfig since 2000. He has also contributed to the O'Reilly book "Linux System Administration".

10 Comment(s)

Comments

Hi, I am able to compile successfully but when I do an ls -l I can't see an entry like the one below which means that for some reason this has not been downloaded into /boot. As such I can't boot into any kernel since this has to be loaded first.

I followed this very useful description and successfully made my new XEN kernel for amd_64. However after compilation the kernel didn't boot on my rented webserver. As I have no console access during the bootphase the cause was not directly visible.

When I compared the size of the /lib/modules directory and the original initrd files I realized that it was probably due to missing drivers (raid support etc). So I modified the kernel generation by copying the original kernel config file

cp /boot/config-2.6.27-11-server ~/build/linux-2.6.27-xen/.config

before running the menuconfig. So all the kernel setting were similar to the normal Ubuntu kernel and the similar modules were compiled and added. However with the default setting the created initrd was 50 Mbytes in size compared to the normal 9Mbytes.

This can be controlled by changing the /etc/initramfs-tools/initramfs.conf The change of

MODULES=most

to

MODULES=dep

before creating the new initrd let the system only included the used modules in the initrd.