Installing Ubuntu 12.04 LTS on a XenServer VM

The following steps can be taken to install Ubuntu 12.04 LTS on a VM running on XenServer 6.

Unfortunately there is no standard template for Ubuntu 12.04 (at least in XenServer 6.0.2 which I used for testing), so we need to make a clone of the “Ubuntu Lucid Lynx 10.04″ template and set another value for the distribution. First log into the console of the XenServer host and perform the following command:

xe template-list | grep -B1 "Ubuntu Lucid Lynx 10.04 (64-bit)"

This will show you (among other things) the UUID of the template we need to clone. Use this UUID in the following command:

xe vm-clone uuid=UUID_OF_LUCID_LYNX_TEMPLATE new-name-label="Ubuntu Precise Pangolin 12.04 (64-bit)"

The output will be yet another UUID, that of the newly created template for Ubuntu 12.04. Use this UUID in the following command:

xe template-param-set other-config:default_template=true other-config:debian-release=precise uuid=UUID_OF_PRECISE_PANGOLIN_TEMPLATE

Now go back to XenCenter and create a VM based on the new template:

xenserver-select-a-vm-template

Select the Ubuntu Precise Pangolin template and use the Ubuntu Archive URL “http://archive.ubuntu.com/ubuntu/” in the following screen:

xenserver-locate-installation-media

When you boot the newly created VM, the Ubuntu installer starts off. Do as you normally do to finish the installer.

When you boot into the freshly installed VM, it will sometimes (or often) happen that the filesystem is mounted read-only. I found an article that explains how to fix this. You just need to append the option “barrier=0″ to the mount options of the root filesystem in /etc/fstab. Mine now looks like this:

UUID=95ce7b93-18c7-4f64-9788-510d3bc909cb / ext4 errors=remount-ro,barrier=0 0 1

Finally we add the guest tools. In XenCenter, attach xs-tools.iso to the DVD drive of the VM. Then mount xs-tools.iso, install the correct XenServer Tools package (replace amd64 with i386 if necessary) and unmount xs-tools.iso:

sudo mount /dev/cdrom /mnt
sudo dpkg -i /mnt/Linux/xe-guest-utilities_6.0.2-756_amd64.deb
sudo umount /mnt

In XenCenter, detach xs-tools.iso from the DVD drive of the VM and reboot the VM.

http://www.jansipke.nl/installing-ubuntu-12-04-lts-on-a-xenserver-vm/

This entry was posted in Hosting, Linux, Virtualizacija and tagged , , , , . Bookmark the permalink.

4 Responses to Installing Ubuntu 12.04 LTS on a XenServer VM

  1. TEMPLATE_UUID=`xe template-list name-label=”Ubuntu Lucid Lynx 10.04 (64-bit)” params=uuid –minimal`
    NEW_TEMPLATE_UUID=`xe vm-clone uuid=$TEMPLATE_UUID new-name-label=”Ubuntu Trusty 14.04 (64-bit)”`
    xe template-param-set other-config:default_template=true other-config:debian-release=trusty uuid=$NEW_TEMPLATE_UUID

  2. Aleksandar says:

    resolve grub problem:
    When the installaion reaches the grub2 installation point, select Go back. The install menu will appear. Scroll down to execute shell option. Execute the following

    chroot /target
    apt-get install grub
    grub-install /dev/xvda
    update-grub
    confirm generation of menu.lst

    exit
    exit
    in the menu press finish installation.

  3. Aleksandar says:

    Fix grub problem On XenServer after Ubuntu guest upgrade

    xe-edit-bootloader -n your_vm_name -p 1

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.