Install Ubuntu 12.04 Server on Citrix XenServer 6.0.2

First, make a new template on your Dom0 xen host:

xe template-list name-label="Ubuntu Lucid Lynx 10.04 (64-bit)" --minimal
xe vm-clone uuid=[UUID from step 1 here] new-name-label="Ubuntu Precise Pangolin 12.04 (64-bit)"
xe template-param-set other-config:default_template=true other-config:debian-release=precise uuid=[UUID from step 2 here]

Create a new VM in XenCenter and choose the VM template you just created
Enter the following as install URL:

http://archive.ubuntu.net/ubuntu/

During Ubuntu Server install create a separate /boot partition with the size of 500Mb and set the type to ext3 as pygrub does not support ext4 very well.

After installation is complete, log in and make yourself root:

sudo -s

Next, install kernel with virtual support and remove default kernel:

apt-get install linux-virtual linux-image-virtual linux-headers-virtual
dpkg -l | grep generic
apt-get remove [all linux*generic packages from last command]

Update grub:

update-grub

Mount xs-tools to your VM dvd drive in XenCenter and install xen guest tools for VM monitoring:

mount /dev/xvdd /mnt
cd /mnt/Linux
dpkg -i *amd64.deb

Reboot:

reboot

Edit /etc/fstab and add nobarrier option to every virtual disk, example /etc/fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#                
proc                                      /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/xvda5 during installation
UUID=a4588f98-9db1-4e85-adf4-e03a6c5202d4 /               ext3    nobarrier           0       1
# /boot was on /dev/xvda1 during installation
UUID=12c79a36-e3b8-49c4-8d20-5d8c302c7faf /boot           ext3    nobarrier           0       2
# /home was on /dev/xvdb1 during installation
UUID=7558d15d-8c4b-4d50-8872-72fd2974c946 /home           ext3    nobarrier           0       2
# swap was on /dev/xvdb5 during installation
UUID=cb9aef04-d7ca-4eb9-940c-87d986729169 none            swap    sw                  0       0

Reboot:

reboot

That should do it, have fun with Ubuntu Server 12.04.

26 thoughts on “Install Ubuntu 12.04 Server on Citrix XenServer 6.0.2

  1. Ulli says:

    Thank you for this round up! May I ask what settings and mount options you used for the boot partition?`Thank you!

  2. Hi there,

    Getting an error when attempting to mount xen-tools.iso. Says iso9660 error. any idea what causes this and how to rectify ?

  3. Tommy says:

    you should mount the xen-tools cd before removing the linux*generic or reboot the vm to get the iso9660.ko up from the linux*virtual.

  4. youngmin says:

    Hi
    I installed Ubuntu 12.04 and xs-tools completely. But I can’t see ipaddress on XenCenter. Can you see it??

  5. If you can’t see the IP in XenCenter, then the XenTools probably haven’t installed properly. Go and reinstall them and see if that fixes it. This guide worked for me! 🙂

  6. Phill says:

    Is it possible to do this in a way that will allow installation from a CD ISO? I’m trying to install Mythbuntu which I have a ISO file for but I don’t think there’s a URL available for it to install from (or if there is I don’t have any idea what it is).

  7. George says:

    I have tried your instructions about a month ago and installed without any problem 12.04. But today after finishing a new installation a get this error

    Traceback (most recent call last): – File “/usr/bin/pygrub”, line 808, in ? – fs = fsimage.open(file, part_offs[0], bootfsoptions) – IOError: Errno 95 Operation not supported

  8. Martijn says:

    Doesn’t seem to work with me. VM-CLONE doesn’t see the UUID’s of the templates, only the VM’s.

  9. Steph says:

    This is a great walk through. Some things to note – if for some reason you want to delete your template later, you’ll need to remove the default_template line or you’ll get an error

    xe template-param-remove uuid=VM-UUID param-name=other-config param-key=default_template

  10. Alexander says:

    @ Mario
    Did you add the nobarrier option in your fstab
    My options in fstab :”noatime,nodiratime,errors=remount-ro,barrier=0″

  11. Michael says:

    Great walk-through. I upgraded some VM’s from 10.04 to 12.04 recently, and the nobarrier option in fstab was one of the solutions I found. Ran into another today, which is the grub-legacy-ec2 package, which maintains a /boot/grub/menu.lst for pygrub parallel to grub2’s /boot/grub/grub.cfg. Thanks to this package I won’t have to edit the grub.cfg or files in /etc/grub.d to get pygrub to boot.

  12. Don says:

    FYI, for me I had to reboot before mounting the tools cd. It was complaining about the iso format. Once I rebooted, I could continue on.

  13. Jorge says:

    Does XenServer support GUI screen showing of Ubuntu 12.04? I ask this because I followed this procedure and installed the GUI, but i continue having just the terminal.

    • Adriana says:

      We’re trying to import Ubuntu 12.04 OVF created with VmWare. I only get command-line terminal when it boots and the file system is read-only. I’ve done this with Ubuntu 10.04 before and it worked fine.
      Came across this page and want to try instructions from above link, however, only see steps for creating a new VM. Is there a way to import a 12.04 VM?
      Thanks in advance for any suggestions…

  14. Suzethi says:

    I have this problem:

    root@geocr:~# apt-get install linux-virtual linux-image-virtual linux-headers-virtual
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    linux-headers-virtual is already the newest version.
    linux-image-virtual is already the newest version.
    linux-virtual is already the newest version.
    You might want to run ‘apt-get -f install’ to correct these:
    The following packages have unmet dependencies:
    linux-image-virtual : Depends: linux-image-3.2.0-38-virtual but it is not going to be installed
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
    root@geocr:~# apt-get -f install
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Correcting dependencies… Done
    The following extra packages will be installed:
    linux-image-3.2.0-38-virtual
    Suggested packages:
    fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
    The following NEW packages will be installed:
    linux-image-3.2.0-38-virtual
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    4 not fully installed or removed.
    Need to get 0 B/12.3 MB of archives.
    After this operation, 34.0 MB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    (Reading database … 58999 files and directories currently installed.)
    Unpacking linux-image-3.2.0-38-virtual (from …/linux-image-3.2.0-38-virtual_3.2.0-38.61_amd64.deb) …
    Done.
    dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-38-virtual_3.2.0-38.61_amd64.deb (–unpack):
    unable to create `/boot/config-3.2.0-38-virtual.dpkg-new’ (while processing `./boot/config-3.2.0-38-virtual’): Read-only file system
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Examining /etc/kernel/postrm.d .
    run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-38-virtual /boot/vmlinuz-3.2.0-38-virtual
    run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-38-virtual /boot/vmlinuz-3.2.0-38-virtual
    Errors were encountered while processing:
    /var/cache/apt/archives/linux-image-3.2.0-38-virtual_3.2.0-38.61_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    root@geocr:~#

    How can I fix it?

  15. Nimish says:

    I got this error:

    May 30, 2013 9:49:44 AM Error: Starting VM ‘mwright_ubuntu’ – Using to parse /grub/grub.cfg – WARNING:root:Unknown directive menuentry_id_option – WARNING:root:Unknown directive else – WARNING:root:Unknown directive menuentry_id_option – WARNING:root:Unknown directive export – WARNING:root:Unknown directive font – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive font – WARNING:root:Unknown directive load_video – WARNING:root:Unknown directive terminal_output – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive export – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive gfxmode – WARNING:root:Unknown image directive if – WARNING:root:Unknown image directive else – WARNING:root:Unknown image directive fi – WARNING:root:Unknown directive submenu – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive gfxmode – WARNING:root:Unknown image directive if – WARNING:root:Unknown image directive else – WARNING:root:Unknown image directive fi – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive if – WARNING:root:Unknown image directive else – WARNING:root:Unknown image directive fi – Traceback (most recent call last): – File “/usr/bin/pygrub”, line 850, in ? – raise RuntimeError, “Unable to find partition containing kernel” – RuntimeError: Unable to find partition containing kernel

    Any Suggestions?

  16. John Cope says:

    I was having trouble with this installation until I changed the installation URL from “http://archive.ubuntu.net/ubuntu/” to “http://us.archive.ubuntu.net/ubuntu/”.

    It seems that you need to add your locale code to the beginning for the installation to function. The page you listed just displays the default Apache “It works!” page.

Leave a Reply to Alexander Cancel reply

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

You must enable javascript to see captcha here!