Setting up Xen hosts and guests can be repetitive.  Here are some scripts to automate the installation of Xen dom0 and domU using Ubuntu Server 12.04 LTS.


Perform a clean install of Ubuntu Sever 12.04.  During the installation, use LVM while partitioning, and don’t install any optional packages other than the OpenSSH server.  Once the installation is complete, and you have done any required customizations (network, hostname, etc.), run the following script (as sudo/root) to install and customize the Xen hypervisor.  By default, the script assigns 512MB of RAM to dom0.  Adjust line 24 to suit your needs.  Also note that the script grants VNC access from everywhere – adjust line 29 to limit access.

When the script has finished, reboot the machine. [TODO:  add tweaks to /etc/xen/xend-config.sxp for dom0-min-mem and to disable balooning]


Once the Xen hypervisor is installed, the following script will do a network-install of Ubuntu Server 12.04 as a para-virtualized guest.  There are some user-configurable values at the top of the script.   Run as sudo/root:



Tagged with →  
Share →

3 Responses to How To Install Ubuntu as Xen dom0 and domU

  1. doug182 says:

    i follow step by step this tuto, but when im trying to run this command

    xm create /etc/xen/ubuntu.cfg -c

    after add the line

    bootloader= pygrub

    i get this error

    Error: (2, ‘Invalid kernel’, ‘elf_xen_note_check: ERROR: Will only load images built for the generic loader or Linux images’)

    can you help me please?

    thanks in advance!

Leave a Reply

Your email address will not be published.