Monday, May 16, 2011

Ubuntu 11.04 on Citrix XenServer 5.5, Part 5

This is part 5 (and final!) of a series on installing Ubuntu 11.04 (Natty Narwhal) on Citrix XenServer 5.5 in paravirtualization (PV) mode. [Part 1] [Part 2] [Part 3] [Part 4]

The last issue to resolve is detecting the hard drive at boot time. My recommendation is to install the kernel for virtual installations:

# apt-get install linux-image-virtual

IMPORTANT:  Because XenServer 5.5 is not compatible with grub 2, you will need to update the path to the kernel and initrd images of the VM (by modifying the PV-boot-loader-args parameter as shown in Part 4) for every kernel upgrade.  Verify the paths in /boot/grub/grub.cfg and update before rebooting the VM.

Another option is to add the xen block device driver to initrd:

# echo xen-blkfront >> /etc/initramfs-tools/modules
# update-initramfs -u

Your installation should be complete and booting without intervention.... now go have fun!

10 comments:

  1. Nice series! Just what I needed; I installed my first xenserver 5.5 a week ago and I was looking for exactly this. Thanks! But there's one problem, being used to compiling my kernel by my self I don't have a clue how to add missing modules (ie reiserfs) to the virtual "edition" of Ubuntu's kernel. Any ideas?

    ReplyDelete
  2. Hi Urban,

    You can add other modules during boot up the same way xen-blkfront was added:

    echo reiserfs >> /etc/initramfs-tools/modules
    update-initramfs -u

    ReplyDelete
  3. Ah, but I later last evening found a bug report regarding reiserfs not being included in the virtual kernel package. So, it won't work.

    ReplyDelete
  4. Interesting. I'd probably stick to using the stock kernel and use option 2 to include xen-blkfront at boot-up.

    ReplyDelete
  5. Had problem after upgrading VM to natty on xenserver 5.6 fp1. During boot, VM showed something like "/init: line 244 ... 0x44d2fb7c-47ee-4b27-9f68-aeb0d9d6c62d ...". where 44d2fb7c-47ee-4b27-9f68-aeb0d9d6c62d was /dev/xvda1 UUID. next, init crashes /kernel panic.

    It started to work after
    xe vm-param-set uuid=$VMUUID PV-args="root=/dev/xvda1 ro console=hvc0 splash quiet vt.handoff=7

    ReplyDelete
  6. Thanks Justin... good to know!

    ReplyDelete
  7. Maybe needless to say but you should just do:

    ln -s /boot/vmlinuz-xxxxxxx /boot/vmlinuz
    ln -s /boot/initrd.img-xxxxx /boot/initrd.img

    And specify in de PV params --kernel=vmlinuz --ramdisk=initrd.img

    That way you only need to update the symlinks, and not the Xen configs, which takes considerably less time ;)

    ReplyDelete
  8. Aren't those symlinks maintained automatically when new kernels are installed?

    ReplyDelete
  9. Just remove grub2 and install grub. From my notes:

    ===============================
    First of all we have to remove grub-pc and install grub, so Xen’s pygrub loader can understand how to boot our system:
    sudo apt-get purge grub-pc grub-common
    sudo rm -rf /boot/grub/*
    sudo apt-get install grub
    sudo update-grub
    Then change indomU=detect to indomU=false in your /boot/grub/menu.lst and type:
    sudo update-grub
    sudo grub-install /dev/sda

    =============================

    ReplyDelete
  10. Hello, i have one problem...
    i choose reiserfs too... but i dont use :

    "echo reiserfs >> /etc/initramfs-tools/modules
    update-initramfs -u"

    i can put from :
    "xe-edit-bootloader -n LinuxTemplate2 -p3 -f /etc/initramfs-tools/modules"
    but cant update-initramfs -u ... have other way to do that?

    ty and nice tutorial

    ReplyDelete