Setting Up Ubuntu DomU on Xen: Ubuntu 10.10 on Fedora Xen Dom0

Setting up Ubuntu 10.10 DomU on top of Fedora Xen Dom0 is introduced in this post. The process of setting up Ubuntu 10.10 DomU is the same as Setting Up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0 This post only show the difference which is specific to Ubuntu and different from Fedora.

We assume one virtual hard disk (xvda) for this DomU is already set up no matter it is file backed or LVM backed. In this example, we use a LVM backed xvda as the example.

Ubuntu installation media

Unfortunately, the Ubuntu 10.10 Live CD, which is widely used, can’t boot on Xen. We use Ubuntu’s netboot iso image to install Ubuntu. The iso image for Ubuntu 10.10 can be retrieved from:

http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/

The file is mini.iso. It can be directly downloaded by wget:

$ wget http://archive.ubuntu.com/ubuntu/dists/maverick/main/installer-amd64/current/images/netboot/mini.iso

Create Xen DomU configuration file

Then we create a configuration file for this Ubuntu Xen DomU. Please be aware that we make some assumption as aforementioned file address (the disk) and network interface (the vif) here. The ubuntu-install.run file’s content:

name="10.1.1.228"
vcpus=2
memory=2048
vif=['bridge=eth2']
disk = ['file:/lhome/xen/mini.iso,xvdc:cdrom,r', 'phy:vg_xen/vm-10.1.1.228,xvda,w']
bootloader="/usr/bin/pygrub"
on_reboot='restart'
on_crash='restart'

Start Ubuntu Xen DomU and start installation

We can start the DomU now by:

# xm create -c ./ubuntu-install.run

The command line installation interface will appear. We can install Ubuntu 10.10 step by step just following the wizard.

Start DomU

To start the Ubuntu DomU is similar to start the Fedora DomU. Remember to remote the virtual cdrom from “disk” in the configuration file.

As pygrub doesn’t support Ubuntu 10.10 well, we copy the kernel and ramdisk out from Ubuntu’s /boot/ directory to Dom0’s directory and provide DomU the kernel and ramdisk from Dom0’s directory. Please also be aware that Ubuntu requires the ‘root=UUID=…’ kernel parameter. This UUID can also be got from /root/grub/grub.cfg in DomU’s disk. We can simply mount DomU’s disk to Dom0 and get the files and UUID.

This is the configuration file that works well in our cluster:

name="10.1.1.228"
vcpus=2
memory=1024
vif=['bridge=eth2']

kernel="/lhome/xen/vm-10.1.1.228/vmlinuz-2.6.35-28-generic"
ramdisk="/lhome/xen/vm-10.1.1.228/initrd.img-2.6.35-28-generic"
extra='root=UUID=4412ceeb-2c40-452f-82e2-8ddbaca681a9'

disk = ['phy:vg_xen/vm-10.1.1.228,xvda,w']
on_reboot='restart'
on_crash='restart'

Last, enjoy it! More posts on Xen is in Xen Solutions.

Eric Zhiqiang Ma

Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

3 comments:

  1. I, successfully, installed and configured Ubuntu Maverick as DomU on CentOS v5.4. But, I am unable to boot and run this guest. When I execute the command:

    xm create -c GUEST

    I get the following error message:

    ValueError: invalid literal for int(): msdos1
    No handlers could be found for logger “xend”
    Error: Boot loader didn’t return any data!

    Any help is greatly appreciated.

    1. Would you mind posting your configuration and version of Xen here?

      One point that should be concern is that, in the post, Ubuntu DomU uses kernel from Dom0’s disk rather than it’s disk:

      kernel=”/lhome/xen/vm-10.1.1.228/vmlinuz-2.6.35-28-generic”
      ramdisk=”/lhome/xen/vm-10.1.1.228/initrd.img-2.6.35-28-generic”
      extra=’root=UUID=4412ceeb-2c40-452f-82e2-8ddbaca681a9′

      and does not use this:

      # bootloader = “/usr/bin/pygrub”

      The pygrub doesn’t work with Ubuntu 10.10 on Xen 3.4.3.

Leave a Reply

Your email address will not be published. Required fields are marked *