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:


Select the Ubuntu Precise Pangolin template and use the Ubuntu Archive URL “” in the following screen:


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.

Be Sociable, Share!

Related Posts

  • How To Install nginx on Ubuntu / Virtualmin Nginx is a lightweight webserver that supports most of the functionality of Apache, but is faster and uses less memory. It is suited to websites that have a large amount of static content, […]
  • Create swap partition on Ubuntu To create a swap partition after an Ubuntu installation create an empty partition that should have no holes. You can then format this partition with sudo mkswap /dev/sdx replacing […]
  • Installing XenServer Tools on Ubuntu 10.04 Ukoliko želite da iskoristite sve mogućnosti ubuntu servera na xen virtualizaciji potrebno je da se instalira xenserver-tools alatka. Međutim, montiranje slike diska i pokretanje […]
This entry was posted in Linux, Virtualizacija and tagged , , , . Bookmark the permalink.

3 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
    confirm generation of menu.lst

    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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>