The Perfect Xen 3.0.3 Setup For Debian Sarge - Page 6

5 Installing The Binary Package

Run the following commands:

apt-get remove exim4 exim4-base lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig
apt-get install screen ssh debootstrap python python2.3-twisted iproute bridge-utils libcurl3-dev


5.1 Install Xen

Then download xen-3.0.3_0-install-x86_32.tgz from, unpack it, and run the install script:

cd /usr/src
tar xvzf xen-3.0.3_0-install-x86_32.tgz
cd dist/
mv /lib/tls /lib/tls.disabled

Now Xen is installed. In order to start the Xen services at boot time, do the following:

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

We need a ramdisk for our new Xen kernel, therefore we do the following:


apt-get install libhtml-template-perl libparse-recdescent-perl

dpkg -i yaird_0.0.12-8bpo1_i386.deb

(The original yaird package was located in, but was removed in the meantime, so I've made the package available under

mkinitrd.yaird -o /boot/initrd.img-

The last command creates the ramdisk /boot/initrd.img-

Next we add our new kernel to Grub, our bootloader. Edit /boot/grub/menu.lst, and before the line ### BEGIN AUTOMAGIC KERNELS LIST add the following stanza:

vi /boot/grub/menu.lst

title Xen 3.0.3 / XenLinux 2.6
root (hd0,0)
kernel /xen.gz  dom0_mem=64000
module /vmlinuz-2.6-xen root=/dev/hda6 ro max_loop=255
module /initrd.img-


Make sure that /dev/hda6 is your / partition. Keep in mind what I said about Grub and partitioning in chapter 1! I added max_loop=255 to the module line to make sure that enough loop devices are available because or virtual machines will be mounted as loop devices.

Now reboot the system:

shutdown -r now

At the boot prompt, Grub should now list Xen 3.0.3 / XenLinux 2.6 as the first kernel and boot it automatically. If your system comes up without problems, then everything is fine!

Share this page:

8 Comment(s)

Add comment


From: harm at: 2006-10-20 12:17:22

Falko, although this is interesting to use with Sarge on relatively old hardware its useless on new hardware... eg. mainboards with Intel's ICH7 bridge will simply not function with Sarge's kernel (2.6.8) and your better of with Etch in that case. And Etc gets Xen with an easy apt-get :)

From: decep at: 2006-10-24 14:35:06

Compiling separate dom0 and domU kernels is considered to be the "old way" of doing things.  Ever since Xen 3 was released, a single kernel can be used for both dom0 and domU.

From: at: 2006-11-15 10:32:50

I just wanted to add a precision about the command :

mv /lib/tls /lib/tls.disabled 

Xen team advise users to disable TLS (Thread Local Storage) because of performance issues. It's not absolutly needed.

See the Xen team explanation.

From: at: 2006-12-09 05:45:45

If you're trying to compile Xen under a minimal Sarge net installation, 2 additional packages need to be installed prior to running "make world" : xlibs-dev libncurses5-dev Without these packages, the compile will fail near the end (very frustrating 30 minutes into the process). Adding build-essential to the apt-get install statement at the top of the page couldn't hurt either for completeness. Other than this, an excellent howto.

From: at: 2007-01-24 15:44:32

In my case it was mandatory that I install the build-essential package for "make world" to succeed. Thanks

 Additionally, I was getting kernel panics when the mem statement was present in the grub menu config. Removing it eliminated the kernel panic.

From: at: 2007-02-15 01:02:34

gcc-3.3 installed but did not leave a link to gcc. 

ln -s /usr/bin/gcc-3.3 /usr/bin/gcc

ln -s /usr/bin/gccbug-3.3 /usr/bin/gccbug

 Fixed this and I could start step 4.1.

From: at: 2006-11-15 14:22:18

/vserver/images/mail.img is not a block special device.

With this tutorial, the right message should be :

/vserver/images/vm_base.img is not a block special device.


From: at: 2007-05-06 16:13:39

During the make world command I had an issue not shure if it was due

to x86_64 or just the version of gcc I had.  I was getting errors like :


         LD      .tmp_vmlinux1
         init/built-in.o: In function `try_name':
         do_mounts.c:(.text+0x5d5): undefined reference to `__stack_chk_fail'
         init/built-in.o: In function `name_to_dev_t':


         initramfs.c:(.init.text+0x4001): undefined reference to   `__stack_chk_fail'

         arch/x86_64/kernel/built-in.o:(.text+0x3509): more undefined     references to  `__stack_chk_fail' follow

         make[1]: *** [.tmp_vmlinux1] Error 1

         make[1]: Leaving directory `/home/costin/linux-'

         make: *** [debian/stamp-build-kernel] Error 2


It took a while but when I used -fno-stack-protector  like:

All compiled like it was supposed to.  I am just now finishing my custom kernel to reboot to.