Installing XenServer Tools on Ubuntu 10.04

Please note that this article was written in 2010. Since then XenServer 6 has been introduced which supports Ubuntu 10.04 and makes it a lot easier to install Ubuntu 10.04 with guest tools. Please take a look at this newer article which describes this procedure.

XenServer supports a lot of Linux and Windows operating systems out of the box, but Ubuntu isn’t one of them. This means that running Ubuntu is slower, because it uses HVM (hardware-assisted virtualisation) instead of PV (paravirtualization). This article will explain how to create a paravirtualized Ubuntu 10.04 VM with the XenServer Tools installed. Many thanks go to the author of the article “Ubuntu 10.04 LTS paravirtualised on Citrix XenServer” (link no longer available).

We start with creating and installing a VM with HVM.

  • Create a VM from the Other install media template
  • Attach the Ubuntu 10.04 ISO to the DVD drive of the VM
  • Start the VM
  • At the disk partitioning stage make sure to replace Ext4 with Ext3, or create a specific boot partition with Ext3
  • Select at least the OpenSSH server package to be able to log in to the VM remotely
  • Finish installation and boot the VM

We now create a new console and edit the boot settings.

  • Connect to the VM using SSH
  • Create a new console for Xen
sudo cp /etc/init/tty1.conf /etc/init/hvc0.conf
sudo vi /etc/init/hvc0.conf
  • Replace all occurrences of tty1 with hvc0
  • Read /boot/grub/grub.cfg
sudo vi /boot/grub/grub.cfg
  • Copy the contents of menuentry near the bottom to a temporary text file, to be used as input for the script that we will use later on
menuentry 'Ubuntu, with Linux 2.6.32-21-server' --class ubuntu --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 02899ea9-1876-4e7b-8ef8-2b09b598cedb
        linux   /boot/vmlinuz-2.6.32-21-server root=UUID=02899ea9-1876-4e7b-8ef8-2b09b598cedb ro quiet
        initrd  /boot/initrd.img-2.6.32-21-server
  • Make special note of /boot/vmlinuz…, root=UUID=… and /boot/initrd.img
  • Shutdown the VM

As an extra precaution, please create a snapshot of the current VM. If the next steps fail – for some people they do – you can revert easily to the VM you now have.

We now convert the VM to PV.

  • Connect to the XenServer host with SSH
  • Copy the script (download from here) to the XenServer host and make it executable
chmod +x
  • Run the script, replacing my-vm-name with the actual name of your VM my-vm-name

Finally we install the XenServer tools.

  • Boot the VM and log in with SSH
  • In XenCenter, attach xs-tools.iso to the DVD drive of the VM
  • Mount xs-tools.iso, install the correct XenServer Tools package (replace amd64 with i386 if necessary) and unmount xs-tools.iso
sudo mount /dev/cdrom1 /mnt
sudo dpkg -i /mnt/Linux/xe-guest-utilities_5.5.0-466_amd64.deb
sudo umount /mnt
  • In XenCenter, detach xs-tools.iso from the DVD drive of the VM (this ensures that XenServer does not complain about too many bootable devices)
  • Reboot the VM and log in with SSH
  • Make sure the services run at boot time
sudo update-rc.d -f xe-linux-distribution remove
sudo update-rc.d xe-linux-distribution defaults
  • Reboot the VM for the last time
  • Restart XenCenter to be able to log in to the console of the VM

56 thoughts on “Installing XenServer Tools on Ubuntu 10.04

  1. Permalink  ⋅ Reply


    June 8, 2010 at 2:55pm

    The script can’t handle VM names with spaces. This is because the lines 15, 20 and 32 don’t wrap the variables with double quotes. Change the lines as follows and it will work with spaces:

    Line 15: if [ -z “$1″ ]
    Line 20: VM=”$1″
    Line 32: UUID=$(xe vm-list name-label=”$VM” params=uuid –minimal)

  2. Permalink  ⋅ Reply


    June 24, 2010 at 10:04am

    Thanks for the tutorial!

    I think there is another problem with the script regarding special characters:
    # ./ my-vm-name (Ubuntu 10.04)
    -bash: syntax error near unexpected token `(‘

  3. Permalink  ⋅ Reply


    June 24, 2010 at 10:50am

    Thanks for the great tutorial. Everythings works fine with XenServer 5.6 and Ubuntu 10.04!

    In the XenCenter now I see the “Virtualization state” is set to “Optimized (version 5.6 installed)”. Nevertheless I have the problem, that the guest console in the XenCenter is not working anymore. I see a login prompt that says:

    Ubuntu 10.04 LTS my-vm-name hvc0
    my-vm-name login:

    My keyboard input is not accepted (nothing happens); so I’m not able to login to the system using the guest console. Is there something wrong with the hvc0 console? I copied the file /etc/init/tty1.conf and made the replacements (tty1 -> hvc0).

    Maybe this is not a big problem as long as I could login using ssh, but if the ssh service is down there is no way to login.

  4. Permalink  ⋅ Reply


    June 24, 2010 at 11:19am

    Sorry, me again :).
    I found that solved the “keyboard input problem”. Maybe this is a bug in XenCenter 5.6. As written in the post I was also able to paste text with the middle mouse click and in result restarting XenCenter fixed the problem… Sometimes the easiest things are not the best 🙂

    One comment about the tutorial:
    The last steps could fail if you mount the xs-tools.iso before starting the VM with an error like “too many bootable devices”. Of course, mounting the iso after booting the VM works as accepted.

    Anyway, thanks for the instructions!

    • Permalink  ⋅ Reply


      June 24, 2010 at 11:21am

      Should be: “Sometimes the easiest things are the best” 🙂

  5. Permalink  ⋅ Reply


    June 24, 2010 at 11:58pm

    After installing the apache2 web server the system requires the package “grub-pc”, but unfortunately the installation failed:

    Setting up grub-pc (1.98-1ubuntu6) …
    dpkg: error processing grub-pc (–configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    Does this problem result from the modified boot options?

    • Permalink  ⋅ Reply


      June 30, 2010 at 9:24am

      has this Apache issue been solved ??

      We want to create a virtual webserver and obviously, if we can not install Apache, this is problematic.


    • Permalink  ⋅ Reply


      July 9, 2010 at 2:15pm

      Me again,
      the problem was not caused directly by apache (the installation of apache2 ran without any problems). The error was caused by the grub-pc package which (I think) is a dependency of apache2 package even if the package is not needed to run the webserver. I think the cause of the problem is that the grub-pc package does not know how to handle the virtual disks (/dev/xvdX). I found this bug After applying the patch attached in the bug report, I was able to install grub-pc.

  6. Permalink  ⋅ Reply


    July 1, 2010 at 9:49am


    I managed to install Apache2, MySQL and PHP without any trouble…

    But, I did wonder about something else though…
    When we run on the XenServer, we hard code kernel data
    Should we rerun after a Kernel update ?


  7. Permalink  ⋅ Reply


    July 7, 2010 at 7:29pm

    Great article!!
    I’m working with Ubuntu 9.04 and everything worked great to get it going in Paravirt mode. (MUCH MUCH faster, however, I was unable to get the “Tools not installed” message to disappear from the XenCenter console. Any other suggestions on where I can look?

    I’ve started the service by hand and tried removing/readding the server to the startup, all of which appears to work and I see xen processes with ps -ef but XenCenter is showing me no love with the “Tools not installed” error.


  8. Permalink  ⋅ Reply

    Andy Burton

    July 14, 2010 at 7:12pm


    Can’t get this one to work.

    When i run the and boot the VM i get the following:

    fsck from util-linux-ng 2.17.2
    fsck from util-linux-ng 2.17.2
    /dev/mapper/webserver–01-root: Superblock last mount time (Wed Jul 14 18:00:48 2010,
    now = Mon May 3 09:28:25 2010) is in the future.

    /dev/mapper/webserver–01-root: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
    (i.e., without -a or -p options)
    /dev/xvdb1: Superblock last mount time (Wed Jul 14 18:00:50 2010,
    now = Mon May 3 09:28:25 2010) is in the future.

    (i.e., without -a or -p options)
    mountall: fsck / [235] terminated with status 4
    mountall: Filesystem has errors: /
    mountall: fsck /boot [234] terminated with status 4
    mountall: Filesystem has errors: /boot

    This is in my grub.cfg:

    menuentry ‘Ubuntu, with Linux 2.6.32-21-server’ –class ubuntu –class gnu-linux –class gnu –class os {
    insmod ext2
    set root='(hd0,1)’
    search –no-floppy –fs-uuid –set 8cef9119-81c1-498d-aaa6-8b1a21780a04
    linux /vmlinuz-2.6.32-21-server root=/dev/mapper/webserver–01-root ro quiet
    initrd /initrd.img-2.6.32-21-server



  9. Permalink  ⋅ Reply


    July 24, 2010 at 5:12pm

    When I follow all instructions (no error messages) I get the following error when I try to boot the ubuntu VM:

    Starting VM ‘webserver’ – The bootloader for this VM returned an error — did the VM installation succeed? Error from bootloader: too many bootable disks (2 disks)

    Anyone have an idea what could be wrong?

    • Permalink  ⋅ Reply


      July 24, 2010 at 7:40pm

      You should first detach xentools.iso before booting the VM. It now sees two possible boot devices: the hard disk and the xentools “dvd player”.

  10. Permalink  ⋅ Reply


    July 26, 2010 at 10:26pm

    Why ext3? I plan to try this, but my Ubuntu virt is already installed with Ext4. Is this merely a preference or would I need to reinstall the virt?

    • Permalink  ⋅ Reply


      July 27, 2010 at 2:24pm

      You could always try with ext4 and see what happens, but I’m pretty sure it won’t work. The sources I’ve used to put together this article point out that it is necessary to use ext3.

  11. Permalink  ⋅ Reply


    August 17, 2010 at 9:41pm

    Great instructions! I too had the problem with the console stuck where I couldn’t type anything. Closing XenCenter and re-opening it fixed it for me though.

  12. Permalink  ⋅ Reply


    September 27, 2010 at 10:29pm

    Update to my previous question – ext4 did not work as the boot partition. I did end up having to reinstall, but my virt has been humming along quite happily for a while now. Just wanted to also thank the poster for the solution to the VM Console not working after install. I set up another Ubuntu VM today and was worried I had broken something during the install, but restarting XenCenter did the trick!

  13. Permalink  ⋅ Reply


    October 18, 2010 at 6:42am

    Hello Jan:

    Thank you very much for you great tutorial. Most appreciated.

    Question – I know longer have a Gnome Desktop starting on the VM. I have verified through a new of resources that this is normal. When I VNC to the VM I get a basic, minimal desktop. Is there any way to get the Gnome Desktop back. Or be able to start it only on the Vnc4server session. Any information would be appreciated. Thank you.


  14. Permalink  ⋅ Reply


    November 20, 2010 at 11:14am

    Hi there! Nice write up!

    One question: Must /boot be ext3, or can it be ext2?

    Because somehow the Ubuntu 10.04 installer I have automatically makes an ext2 /boot partition.

    • Permalink  ⋅ Reply


      November 23, 2010 at 8:40am

      I suppose ext2 will work as well, but I’m not sure.

  15. Permalink  ⋅ Reply


    November 23, 2010 at 3:12pm

    @pepoluan: I tried with the default installation of Ubuntu 10.04 with ext2 on /boot and it works without any problems.

  16. Permalink  ⋅ Reply


    December 20, 2010 at 2:49am

    How to start the grafical mode of Ubuntu after this configuration?

  17. Permalink  ⋅ Reply


    December 29, 2010 at 10:29am

    Is this specific to xen server 5.6 or will this work for 5.5 aswell?
    I’ve tried it but the vm refuses to start because of an error in pygrub, can this problem be solved for 5.5 or do I need to upgrade to 5.6 to make Ubuntu 10.4 work in pv mode?
    I did replace GRUB2 with GRUB and it booted up to, since 5.5 can’t handle it.

    I get this error:
    29-12-2010 10:09:15 Error: Starting VM ‘Ubuntu’ – The bootloader for this VM returned an error — did the VM installation succeed? Error from bootloader: Return code: 1; Log = Traceback (most recent call last):
    File “/usr/bin/pygrub”, line 711, in ?
    raise RuntimeError, “Unable to find partition containing kernel”
    RuntimeError: Unable to find partition containing kernel

    • Permalink  ⋅ Reply


      January 3, 2011 at 10:37am

      When I wrote this article I used 5.5, so it should work in that version.

  18. Permalink  ⋅ Reply


    January 31, 2011 at 7:20pm

    How about if the guest is set up to use LVM?

  19. Permalink  ⋅ Reply


    February 5, 2011 at 12:02am

    I tested it on XenServer 5.6 host for a Zentyal 2.0.3 (Ubuntu 10.04 amd64) virtual machine, and it run at the first atempt.
    Thanks for this very helpful post.
    – Sergio –

  20. Permalink  ⋅ Reply


    February 7, 2011 at 1:41pm

    Hi. I used this config several times and worked great!

    Tough, on an install I cannot see boot log. I just see fsck, and when boot is done I see login, cannot see boot messages!
    I tried removing “quiet” from cmd line options but with no change at all.
    And I have problems on this Ubuntu 10.04 VM and I cannot see what’s going bad!

    Any idea what could I do to see boot log?

  21. Permalink  ⋅ Reply


    February 23, 2011 at 10:49am

    Hi! Thanks for the tutorial. I have now a virtual machine (Ubuntu Server 10.04.2) with XenServer Tools installed. I’m wondernig if anyone has successfully done a live migration on a ubuntu vm between two xen hosts in a pool? I have tried but ending up with a vm not responding on the new host. When I try to make a shutdown or reboot from XenCenter on the vm I get the following message in the XenCenter eventlog: VM didn’t acknowledge the need to shutdown.

    In the vm console in XenCenter I get:
    [ 287.317012] [] mpage_bio_submit+0x20/0x30
    [ 287.317012] [] do_mpage_readpage+0x37a/0x730
    [ 287.317012] [] ? _spin_lock+0xd/0x10
    [ 287.317012] [] ? __inc_zone_page_state+0x1d/0x20
    [ 287.317012] [] ? add_to_page_cache_locked+0xc0/0x120
    [ 287.317012] [] mpage_readpages+0xc7/0x100
    [ 287.317012] [] ? ext3_get_block+0x0/0x110
    [ 287.317012] [] ? __alloc_pages_nodemask+0xc6/0x170
    [ 287.317012] [] ? ext3_readpages+0x0/0x20
    [ 287.317012] [] ext3_readpages+0x1e/0x20
    [ 287.317012] [] ? ext3_get_block+0x0/0x110
    [ 287.317012] [] __do_page_cache_readahead+0x144/0x200
    [ 287.317012] [] ra_submit+0x26/0x30
    [ 287.317012] [] filemap_fault+0x3dc/0x410
    [ 287.317012] [] ? kmap_atomic_prot+0x4c/0x110
    [ 287.317012] [] __do_fault+0x4c/0x520
    [ 287.317012] [] ? do_wp_page+0x104/0x910
    [ 287.317012] [] ? kmap_atomic_prot+0x4c/0x110
    [ 287.317012] [] handle_mm_fault+0x198/0x4a0
    [ 287.317012] [] do_page_fault+0x10d/0x3a0
    [ 287.317012] [] ? do_page_fault+0x0/0x3a0
    [ 287.317012] [] error_code+0x73/0x80
    [ 287.317012] [] ? lapic_setup_esr+0x84/0xdc

    After that I need to force shutdown or force reboot the vm in XenCenter to get the vm up and running again.

    XenServer version is 5.6.0 on the hosts.

    Regards, Daniel

  22. Permalink  ⋅ Reply


    March 12, 2011 at 1:26am

    Sig: I think your problem is when you run the script you type in on the vmlinuz part do not type in root= only the line before. then it ask for parameters..
    I dis this myself and got the error you got.

    Copy the contents of menuentry near the bottom to a temporary text file, to be used as input for the script that we will use later on

    linux /boot/vmlinuz-2.6.32-21-server
    initrd /boot/initrd.img-2.6.32-21-server

    I tried this with 10.10 and it works but console freez up at login. I had to use quiet insted of single… in boot para..
    I can login via SSH. but I can not mount CD.

  23. Permalink  ⋅ Reply


    March 12, 2011 at 1:36am

    Strange I did a snapshot and then a new vm from snapshot and now console works 😛 well I’m a happy buntu now ..

  24. Permalink  ⋅ Reply


    March 30, 2011 at 3:57pm

    I tried this but when starting the vm I get from Xenserver: error:internal error:XenguestHelper.Xc_dom_linus_build_failure(2,”elf_xen_note_check:ERROR:Will only load built “”

  25. Permalink  ⋅ Reply


    May 13, 2011 at 10:32am

    I have the same problem as Daniel : my Ubuntu Server 10.04.2 LTS crash when trying to migrate from one host to the other one. Its Xenserver 5.5 update 1. Have anyone a solution?

  26. Permalink  ⋅ Reply


    July 5, 2011 at 6:53pm

    I get this on start up:

    05/07/2011 17:39:42 Error: Starting VM ‘PHD Virtual Backup Test (1)’ – The bootloader for this VM returned an error — did the VM installation succeed? Error from bootloader: Return code: 1; Log = Traceback (most recent call last):
    File “/usr/bin/pygrub”, line 664, in ?
    part_offs = get_partition_offsets(file)
    File “/usr/bin/pygrub”, line 90, in get_partition_offsets
    if not is_disk_image(file):
    File “/usr/bin/pygrub”, line 44, in is_disk_image
    fd =, os.O_RDONLY)
    OSError: [Errno 2] No such file or directory: ‘/vmlinuz-2.6.32-24-server’

    Here is my menuentry:
    menuentry ‘Ubuntu, with Linux 2.6.32-24-server’ –class ubuntu –class gnu-linux –class gnu –class os {
    insmod ext2
    set root='(hd0,1)’
    search –no-floppy –fs-uuid –set 93527f3b-2273-4aab-97c9-f65cb36c5ba7
    linux /vmlinuz-2.6.32-24-server root=/dev/mapper/ARGUWEB01-root ro quiet
    initrd /initrd.img-2.6.32-24-server

    Not sure why?


  27. Permalink  ⋅ Reply


    July 6, 2011 at 11:55am

    Slightly different issue now – when the VM boots I get ALERT! /dev/mapper/ARGUWEB01-root does not exist. Dropping to a shell!

  28. Permalink  ⋅ Reply


    July 12, 2011 at 1:43pm

    I have the same problem as GJO and Daniel, we’re using XENServer 5.5.
    Ubuntu 10.04.2 Server 64 bit (2.6.32-28-server) works just fine, but kernel panics after showing “migrated” in XenCenter. It can only be “force rebooted”.
    Ubuntu 8.04.4 Server 64 bit set up in the same manner (slightly different of course) migrates fine without a glitch.

    Anyone got that solved?

    • Permalink  ⋅ Reply


      July 15, 2011 at 12:54pm

      Problem is solved with Kernel 2.6.32-33-server #70! Just in time… I’m happy 🙂

      • Permalink  ⋅ Reply


        December 16, 2011 at 12:07am

        I had the same migration problem with kernel 2.6.32-36-generic. I therefore tried to install the -server kernel, resulting in a boot configuration that could not find my boot and root disks anymore. I can go back to the -generic kernel. Does anybody know the specific difference between the -generic and -server kernels that could cause the difference in behaviour when life migrating?

      • Permalink  ⋅ Reply


        December 18, 2011 at 9:50pm

        Update on my previous post: I managed to fix the problem with the -server version of the kernel. In the -server version of the kernel, xen_blkfront is compiled as a module, but is required to mount the root file system. So if the initrd system is loaded by grub, it does not know how to mount /dev/xvda1, because xen_blkfront is not loaded. I added xen-blkfront to /etc/initramfs-tools/modules. I also created a hard-link from /lib/modules/2.6.32-36-server/kernel/drivers/block/
        /xen-blkfront.ko to /lib/modules/2.6.32-36-server/initrd/. Afterwards, i recreated the initrd image with update-initramfs (use the correct options to create the initrd image also for the kernel that is not currently running). I don’t which of the two (adding to modules, or lining to the initrd directory) did the trick, so maybe only one of the two is required.

        This makes that the -server version boots perfectly, but migration still fails. Anybody any idea how to fix that?

  29. Permalink  ⋅ Reply


    July 21, 2011 at 11:16pm

    This works perfect!!! Thanks a million. You saved me a ton of headache!

  30. Permalink  ⋅ Reply


    August 19, 2011 at 8:13pm

    I followed all the steps however still the xenserver shows virtualization xs-tools not installed

  31. Permalink  ⋅ Reply


    August 30, 2011 at 10:37am

    GREAT TUTORIAL! Thanks for the script, too! Worked as a charm on XenServer 5.6SP2 and Ubuntu 10.4 Server x64.

  32. Permalink  ⋅ Reply


    September 15, 2011 at 9:36pm

    Did not work when I tried it and now I have to convert it back to HVM. Might have to hack the script to go back and forth. Should be able to detect if the specified machine is in HVM or PV and ask user if he wants to conver it to the other, right?

  33. Permalink  ⋅ Reply

    Justin Kintzele

    September 23, 2011 at 5:14pm

    This works great, thank you. I have a question.
    What would be the best way to clone an Ubuntu system, that you have performed this operation on?
    I made a copy of a VM after doing this, but now I’m worried that the same disk UUID will become a problem. Is there a way to change this, or should I be concerned?

  34. Permalink  ⋅ Reply


    January 11, 2012 at 2:15pm

    I`m trying to use this how to but im stuck on the following error

    11-1-2012 13:10:23 Error: Starting VM ‘snorby02’ – Internal error: XenguestHelper.Xc_dom_linux_build_failure(2, ” elf_xen_note_check: ERROR: Will only load images built “”)

    This is my menu entry

    menuentry ‘Ubuntu, with Linux 2.6.32-37-generic’ –class ubuntu –class gnu-linux –class gnu –class os {
    insmod ext2
    set root='(hd0,1)’
    search –no-floppy –fs-uuid –set 240ff737-43ec-4276-8c5e-8d254939acdb
    linux /boot/vmlinuz-2.6.32-37-generic root=UUID=240ff737-43ec-4276-8c5e-8d254939acdb ro
    initrd /boot/initrd.img-2.6.32-37-generic

    and i am pasting the following lines when running the script

    root=UUID=240ff737-43ec-4276-8c5e-8d254939acdb ro

    Why is this going wrong do i have to past more or less information (can u add an example step after the run my-vm-name )

  35. Permalink  ⋅ Reply


    March 10, 2012 at 12:54pm

    Nice tutorial. This worked like a charm with XenServer 6

    One question though, what happens when I install a kernel update on Ubuntu? Do I have to go through the steps again?

  36. Permalink  ⋅ Reply


    July 2, 2012 at 10:20am

    I updated your script. It’ll ensure that vms can boot after a kernel update. As far as I can say, it works. I don’t take any responsibility for wrecked vms (take snapshots 😉 ). Important: remove /boot/grub/menu.lst before convertig it, as xenserver tries to read this file in favor of /boot/grub/grub.conf !

  37. Permalink  ⋅ Reply


    October 23, 2012 at 11:51am

    Worked like a charm with: Xen 5.5 / Ubuntu 10.04 Server – x86_64 . Had to modify the script to allow the use of spaces, but otherwise… many thanks for this great guide!

  38. Permalink  ⋅ Reply


    June 11, 2014 at 10:41am

    Worked like a charm with: Xen 6.2 / Ubuntu 14.04 Server – x86_64
    Thank You for this script!

  39. Permalink  ⋅ Reply


    December 27, 2014 at 4:09pm

    on ubuntu 14.04, xenserver 6.1, /dev/cdrom to be replaced with /dev/xvdd

    sudo mount /dev/xvdd /mnt/

Leave a Reply

Your email will not be published. Name and Email fields are required.