Bashton Blog

Sep/08

23

Running an Ubuntu Hardy Xen domU under a CentOS dom0

As pretty much always with Linux there’s more than one way to do this, but here’s how I got a nicely working para-virtualized Ubuntu Hardy domU running under a CentOS 5.2 dom0:

  • Install hardy under an HVM using the standard ISO
  • Boot into your new hardy install and run sudo apt-get install linux-image-xen (make sure you have universe enabled)
  • Add appropriate settings to your /boot/grub/menu.lst – here’s what I added:


title Ubuntu 8.04.1, kernel 2.6.24-19-xen
root (hd0,0)
kernel /vmlinuz-2.6.24-19-xen root=/dev/mapper/dsk-root ro
initrd /initrd.img-2.6.24-19-xen

  • Add a console on xvc0: sed -e 's/tty1/xvc0/' /etc/event.d/tty1 | sudo tee /etc/event.d/xvc0
  • Power off your Ubuntu VM
  • On your CentOS dom0, alter the Xen VM configuration file to boot using pygrub, very basic example below:


bootloader = '/usr/bin/pygrub'
memory = 1024
name = "ubuntu-test"
vif = [ '' ]
disk = [ 'phy:/dev/san1/ubuntu-test,xvda1,w']

  • Restart your Hardy VM and enjoy massively improved performance

One thing missing from the para-virtualized VM is VNC support – you have to use the console via the ‘xm console’ command.

The procedure should be similar for Citrix XenServer, although it will involve some messing with the xe vm-param-set command rather than editing the config file.  When I have a chance I’ll document this too.

Update, 30/9/08:

To enable a VNC console, do the following as well as the above:

  • Add the framebuffer drivers into the initramfs

echo "fbcon" | sudo tee -a /etc/initramfs-tools/modules
echo "vga16fb" | sudo tee -a /etc/initramfs-tools/modules
sudo sed -ie 's/^blacklist vga16fb$/#&/' /etc/modprobe.d/blacklist-framebuffer

  • Re-generate the initramfs

sudo update-initramfs -u -k all

  • Alter your grub menu.lst to include the boot options console=tty1 vga=normal (best done via the defoptions line, I tend to remove quiet and splash from here too)

Reboot, and you can now use a VNC console as well as the Xen xm console command.

RSS Feed

1 Comment for Running an Ubuntu Hardy Xen domU under a CentOS dom0

Robin Bowes | October 2, 2008 at 10:13 am

Nice. I’ll be making use of this in the near future…

R.

Leave a comment!

<<

>>

Find it!

Theme Design by devolux.nh2.me