Setting Up Linux Open Source Xen Virtualization

While many different Linux distributions include packages for Xen, this page focuses on CentOS and Redhat Enterprise Linux, which we have found to be well supported and easy to setup. To make full use of Xen, you should be running one of these distributions on a machine with plenty of RAM (8 GB or more), enough disk space for all the filesystems of instances you want to host, and a CPU that supports either Intel's VTI extensions or AMD Pacifica. Also, the host system should have LVM setup and have plenty of free space in its volume group, so that Cloudmin can create VM disk images as logical volumes.

This documentation relates to the open source version of Xen only - the commercial variant supported by Citrix is treated separately by Cloudmin, and is covered on the Citrix Xen page.

Cloudmin GPL

The Cloudmin GPL install script should install a Xen-capable kernel and all other required packages
on the system it is run on, so none of the steps here are needed. All you need to do is reboot the system
after running the installer, and then verify that the kernel includes Xen support by running uname -r .

Automatic installation

Cloudmin versions 8.3 and above will offer to automatically setup a Debian, Ubuntu, CentOS or Redhat system as a Xen host when you attempt to add it on the Xen Host Systems page.
This includes installing the kernel and Xen tools, and creating a bridge if necessary. Only if this fails should you follow the manual installation steps below.

Manual installation on CentOS 5 and above

Once you have a freshly installed system running CentOS 5 and above, the steps to set it up for Xen hosting are :

  1. Login as root via SSH or at the console.
  2. On CentOS 6 and above, an additional YUM repository needs to be enabled to install the Xen kernel packages, as they are not included with CentOS 6 by default. To do this, run the command
    yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-5.noarch.rpm
  3. Install the Xen kernel with the command
    yum install kernel-xen kernel-xen-devel
  4. Once the new kernel has been installed, an entry for it will be automatically added to /boot/grub/menu.lst like :
    title CentOS (2.6.18-8.1.4.el5xen)
            root (hd0,2)
            kernel /xen.gz-2.6.18-8.1.4.el5
            module /vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            module /initrd-2.6.18-8.1.4.el5xen.img
  5. Edit /boot/grub/menu.lst and change the default= line to use the newly added Xen kernel, which will typically be the first one in the file (numbered 0).
  6. Install the Xen commands package with the command
    yum install xen parted
  7. Disable the virbr0 Qemu network interface with the command
    cat /dev/null >/etc/libvirt/qemu/networks/default.xml
  8. Make sure SElinux is disabled by editing /etc/sysconfig/selinux and changing the SELINUX line to SELINUX=disabled .
  9. Increase the limit on loopback devices by editing /etc/modprobe.conf and adding the line options loop max_loop=255 at the end .
  10. Reboot the system with the reboot command. If you are at the console, you should be able to see Xen-related messages during the kernel boot process.
  11. Verify that Xen is working with the command :
    xm list

    If you see a line starting with Domain-0, then all is good.

  12. Create the /xen directory, which Cloudmin uses by default for Xen system images, with the command
    mkdir /xen

And that's it! You can now register this system as a Xen host in Cloudmin.

Manual installation on Redhat Enterprise 5 and above

If your RHEL 5 system has the yum command installed and working, you can follow the exact same steps above. If not, use Redhat's up2date command instead :

  1. Login as root via SSH or at the console.
  2. Make sure all packages are up to date and your Redhat Enterprise subscription is working by running the command :
    up2date -u
  3. Install the Xen kernel with the command
    up2date kernel-xen kernel-xen-devel
  4. Once the new kernel has been installed, an entry for it will be automatically added to /boot/grub/menu.lst like :
    title Redhat Enterprise (2.6.18-8.1.4.el5xen)
            root (hd0,2)
            kernel /xen.gz-2.6.18-8.1.4.el5
            module /vmlinuz-2.6.18-8.1.4.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
            module /initrd-2.6.18-8.1.4.el5xen.img
  5. Edit /boot/grub/menu.lst and change the default= line to use the newly added Xen kernel, which will typically be the first one in the file (numbered 0).
  6. Install the Xen commands package with the command
    up2date xen
  7. Disable the virbr0 Qemu network interface with the command
    cat /dev/null >/etc/libvirt/qemu/networks/default.xml
  8. Make sure SElinux is disabled by editing /etc/sysconfig/selinux and changing the SELINUX line to SELINUX=disabled .
  9. Increase the limit on loopback devices by editing /etc/modprobe.conf and adding the line options loop max_loop=255 at the end .
  10. Reboot the system with the reboot command. If you are at the console, you should be able to see Xen-related messages during the kernel boot process.
  11. Verify that Xen is working with the command :
    xm list

    If you see a line starting with Domain-0, then all is good.

  12. Create the /xen directory, which Cloudmin uses by default for Xen system images, with the command
    mkdir /xen

Manual installation on Ubuntu Linux 8.04

  1. Login as root via SSH or at the console.
  2. Update your package database with the command :
    apt-get update
  3. Install the Xen capable kernel and support packages with the command :
    apt-get install ubuntu-xen-server libc6-xen xen-tools xen-utils-3.2 xen-hypervisor-3.2 parted
  4. Edit /boot/grub/menu.lst and change the default= line to use the newly added Xen kernel, which will typically be the first one in the file (numbered 0).
  5. Increase the limit on loopback devices by editing /etc/modules and adding the line loop max_loop=255 at the end .
  6. Reboot the system with the reboot command. If you are at the console, you should be able to see Xen-related messages during the kernel boot process.
  7. Verify that Xen is working with the command :
    xm list

    If you see a line starting with Domain-0, then all is good.

  8. Create the /xen directory, which Cloudmin uses by default for Xen system images, with the command
    mkdir /xen

Manual installation on Debian Linux 4.0 / 5.0

  1. Login as root via SSH or at the console.
  2. Update your package database with the command :
    apt-get update
  3. Install the Xen capable kernel and support packages with the command :
    apt-get install xen-linux-system libc6-xen xen-tools xen-utils-3.2-1 xen-hypervisor-3.2-1-i386 parted

    On a 64-bit system, replace the xen-hypervisor-3.2-1-i386 package above with xen-hypervisor-3.2-1-amd64.

  4. Edit /boot/grub/menu.lst and change the default= line to use the newly added Xen kernel, which will typically be the first one in the file (numbered 0).
  5. Increase the limit on loopback devices by editing /etc/modules and adding the line loop max_loop=255 at the end .
  6. Reboot the system with the reboot command. If you are at the console, you should be able to see Xen-related messages during the kernel boot process.
  7. Verify that Xen is working with the command :
    xm list

    If you see a line starting with Domain-0, then all is good.

  8. Create the /xen directory, which Cloudmin uses by default for Xen system images, with the command
    mkdir /xen

Debian Linux6.0

  1. Login as root via SSH or at the console.
  2. Update your package database with the command :
    apt-get update
  3. Install the Xen capable kernel and support packages with the command :
    apt-get install xen-linux-system parted
  4. Activate the Xen-capable kernel as documented on http://wiki.debian.org/Xen . The quickest command to do this is mv -i /etc/grub.d/10_linux /etc/grub.d/21_linux ; upgrade-grub
  5. Enable the Xen network bridge by editing /etc/xen/xend-config.sxp and un-commenting the line (network-script network-bridge)
  6. Reboot the system with the reboot command. If you are at the console, you should be able to see Xen-related messages during the kernel boot process.
  7. Verify that Xen is working with the command :
    xm list

    If you see a line starting with Domain-0, then all is good.

  8. Create the /xen directory, which Cloudmin uses by default for Xen system images, with the command
    mkdir /xen

Comments

When will there be documentation here for Debian- and Ubuntu-based systems?

Joe's picture
Submitted by Joe on Fri, 07/03/2009 - 16:00 Pro Licensee

Soon. Jamie has setup the apt repos, and is populating them now. The build stuff for Cloudmin will probably move over to me now that we're launched (while in beta, Jamie was rolling releases very frequently; and we were pretty specific about target platforms to reduce variables).

There will also be a version of the install script for Debian and Ubuntu.

Still no docs for debian/utbuntu