Update2: Switch from Xen to KVM. How and why.
Update: Also read my Article about current Virtualization Techniques
I got some strange errors when I tried to run OpenSolaris on Hardy as a HVM domain. These errors were fixed in 3.3, but Ubuntu Hardy doesn’t have Xen 3.3 and there were no backports at that time (don’t know if there are ones now) so I upgraded to Ubuntu Intrepid an then noticed that Canonical has dropped Xen Dom0 support. Great! Why the heck did they drop Xen? Because KVM is cooler? Or because they didn’t want to blame themselves by releasing another totally buggy self-patched Dom0 kernel? I mean they didn’t even manage to provide a working one later on so the community had to…and thats a LTS release? WTF?
O.K. well… You want Xen 3.3 with it’s improvements? You don’t want to switch the distro? You don’t want to compile on your own? Here’s how I did it with Ubuntu Intrepid:
I used the Xen 3.3 Hypervisor and Utils coming with Intrepid and then stole a Dom0 kernel from Debian. Debian has linux-image-2.6.26-1-xen-amd64 and linux-modules-2.6.26-1-xen-amd64. I installed both packages and by now everything works great.
O.K. I called this post How-To so here comes how to install the Debian packages on Ubuntu. I will only show you how to install them by hand, you could also add the Debian repos to your sources.list and use pinning.
1 2 3 4 5 6 7 8 |
wget http://ftp.de.debian.org/debian/pool/main/l/linux-2.6/linux-modules-2.6.26-1-xen-amd64_2.6.26-10_amd64.deb wget http://ftp.de.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.26-1-xen-amd64_2.6.26-10_amd64.deb sudo dpkg -i linux-modules-2.6.26-1-xen-amd64_2.6.26-10_amd64.deb sudo dpkg -i linux-image-2.6.26-1-xen-amd64_2.6.26-10_amd64.deb wget http://ftp.de.debian.org/debian/pool/main/l/linux-2.6/linux-modules-2.6.26-1-xen-amd64_2.6.26-12_amd64.deb wget http://ftp.de.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.26-1-xen-amd64_2.6.26-12_amd64.deb sudo dpkg -i linux-modules-2.6.26-1-xen-amd64_2.6.26-12_amd64.deb sudo dpkg -i linux-image-2.6.26-1-xen-amd64_2.6.26-12_amd64.deb |
Or find the latest using these links: modules kernel
That’s it. There are no other depends. Just reboot. The new kernel should now be the default one. But keep in mind that this is just a workaround.
If I should ever reinstall this Xen-Server: I WILL NOT USE UBUNTU ANYMORE! All these annoying stupid errors… Maybe Debian or CentOS. I mean… I like Ubuntu, it’s a great beginner distro and even lets the nerds control everything they want, but what Canonical delivered the last few months just sucks. All these annoying bugs they added by patching arround: Non-working sound, A buggy KDE4. O.K. you could say that’s all desktop related stuff, but on my server for example I had some very strange XFS errors with the Ubuntu-Server kernel that just disappeared with the (also newer, maybe that’s the point) Debian kernel.
This article has 24 comments
2008/12/17
because you don’t get security updates by simply installing a package. Plus these packages were intended for debian but ubuntu.
2009/01/01
Backport Intrepid Xen 3.3 Hypervisor to Ubuntu Hardy Dom0 (2.6.24-21-xen)
http://lxer.com/module/newswire/view/112045/index.html
2009/01/01
@Boris
thanks for the hint!
2009/01/01
Getting your stuff to work downloaded and installed:-
Xen 3.3 Hypervisor from repos plus
linux-modules-2.6.26-1-xen-amd64_2.6.26-12_amd64.deb
inux-image-2.6.26-1-xen-amd64_2.6.26-12_amd64.deb
Reboot.
eth1,peth1 show up same IP-address via ifconfig.
Network access to the Net via ADSL Modem is dead.
I had to comment out all xen-bridge definitions in
/etc/xen/xend-config.sxp and manually define bridge in /etc/network/interfaces:-
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth1
iface eth1 inet dhcp
auto br0
iface br0 inet static
address 192.168.1.45
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth1
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
Reboot.Only at this point i’ve got networking done on Xen 3.3 Ubuntu Intrepid Server Dom0 (kernel 2.6.26-1-xen-amd64).
root@IntrepidSRV:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001e8c25cca5 no eth1
pan0 8000.000000000000 no
root@IntrepidSRV:~# ifconfig
br0 Link encap:Ethernet HWaddr 00:1e:8c:25:cc:a5
inet addr:192.168.1.45 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21e:8cff:fe25:cca5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10387 errors:0 dropped:0 overruns:0 frame:0
TX packets:9072 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:23709253 (23.7 MB) TX bytes:937257 (937.2 KB)
eth0 Link encap:Ethernet HWaddr 00:1e:8c:25:d9:23
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
eth1 Link encap:Ethernet HWaddr 00:1e:8c:25:cc:a5
inet6 addr: fe80::21e:8cff:fe25:cca5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55382 errors:0 dropped:0 overruns:0 frame:0
TX packets:39418 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80800515 (80.8 MB) TX bytes:2916410 (2.9 MB)
Interrupt:16 Base address:0x6c00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:22797 errors:0 dropped:0 overruns:0 frame:0
TX packets:22797 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:117429741 (117.4 MB) TX bytes:117429741 (117.4 MB)
wlan0 Link encap:Ethernet HWaddr 00:15:af:51:c2:c0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wmaster0 Link encap:UNSPEC HWaddr 00-15-AF-51-C2-C0-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
2009/01/01
@Boris
thanks again. haven’t noticed that there is a new minor version of the linux image. i’ll update the post now
2009/01/01
it’s me again… your admin
@Boris
I replied to your post on your blog.
2009/01/03
Hi, you have twice the dpkg for the modules package.
Thanks for tips!
2009/01/03
fixed
2009/01/27
I was equally disappointed that Ubuntu dropped support for Xen. I was also very annoyed to run into several bugs in the 2.6.24-22-xen kernel from Hardy. Thanks for the tip on installing the kernel from Debian!
2009/11/22
Hi, thanks for posting this article. Do you know where I can find more information on this. Thanks
2009/12/10
I try with Karmic and don’t work, someone have tried with Karmic?
2009/12/29
Me! And does not work with Karmic neither with Intrepid. I just got to work with Ubuntu Hardy and the kernel-xen-blablabla… on the officials repositories. =/
But with CentOS , it’s ran like a charm.
@frankabel
2009/12/29
What do you mean doesn’t work? Do you get any errors? Runs reliable for more than a year now at my server with Intrepid. But I have to agreee that there are better distributions when it comes to Xen!
2010/02/02
Hi Chris,
I followed the steps, but when I rebooted to launch the Xen modified Kernel, it shows up : error: You need to load the Kernel first.
Am I doing something wrong ?
Thanks,
Vivek
2010/02/02
Please post your bootloader config.
2010/02/03
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default=”0″
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,7)
search –no-floppy –fs-uuid –set 0e870eb0-05b5-4d16-8af9-81bb2f9c3737
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640×480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don’t
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry “Ubuntu, Linux 2.6.31-14-generic-pae” {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search –no-floppy –fs-uuid –set 0e870eb0-05b5-4d16-8af9-81bb2f9c3737
linux /boot/vmlinuz-2.6.31-14-generic-pae root=UUID=0e870eb0-05b5-4d16-8af9-81bb2f9c3737 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic-pae
}
menuentry “Ubuntu, Linux 2.6.31-14-generic-pae (recovery mode)” {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search –no-floppy –fs-uuid –set 0e870eb0-05b5-4d16-8af9-81bb2f9c3737
linux /boot/vmlinuz-2.6.31-14-generic-pae root=UUID=0e870eb0-05b5-4d16-8af9-81bb2f9c3737 ro single
initrd /boot/initrd.img-2.6.31-14-generic-pae
}
menuentry “Ubuntu, Linux 2.6.26-1-xen-686″ {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search –no-floppy –fs-uuid –set 0e870eb0-05b5-4d16-8af9-81bb2f9c3737
linux /boot/vmlinuz-2.6.26-1-xen-686 root=UUID=0e870eb0-05b5-4d16-8af9-81bb2f9c3737 ro quiet splash
initrd /boot/initrd.img-2.6.26-1-xen-686
}
menuentry “Ubuntu, Linux 2.6.26-1-xen-686 (recovery mode)” {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search –no-floppy –fs-uuid –set 0e870eb0-05b5-4d16-8af9-81bb2f9c3737
linux /boot/vmlinuz-2.6.26-1-xen-686 root=UUID=0e870eb0-05b5-4d16-8af9-81bb2f9c3737 ro single
initrd /boot/initrd.img-2.6.26-1-xen-686
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry “Memory test (memtest86+)” {
linux16 /boot/memtest86+.bin
}
menuentry “Memory test (memtest86+, serial console 115200)” {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry “Windows NT/2000/XP (on /dev/sda3)” {
insmod fat
set root=(hd0,3)
search –no-floppy –fs-uuid –set e47a-f974
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the ‘exec tail’ line above.
### END /etc/grub.d/40_custom ###
2010/02/03
Your BL config looks like Grub2. Do you really run Intrepid? I haven’t had the time to test this workaround with newer Ubuntu releases.
But: I don’t see you telling the BL to boot the xen hypervisor first. In Grub(1) it looks like:
title Xen 3.3 / Ubuntu 8.10, kernel 2.6.24-21-xen
root (hd0,0)
kernel /boot/xen-3.3.gz
module /boot/vmlinuz-2.6.24-21-xen root=/dev/md0 ro console=tty0
module /boot/initrd.img-2.6.24-21-xen
quiet
You should try adjusting your BL configuration.
2010/02/03
Just to update, I had installed Ubuntu Enterprise Cloud (which comes with Ubuntu 9.10 Karmic). I needed the Xen hypervisor instead of KVM, and hence I followed your steps to have the Dom0 Kernel.
2011/12/01
As a hint, if you do this with 11.04 rsyslog will go haywire and consume 100% CPU as it fails to log kernel messages. Stop and/or fix kernel logging in rsyslog.conf.