Setting Up Linux Xen Virtualization

Posted 2009-06-16 12:01 by andreychek

While many different Linux distributions include packages for Xen, this page focuses on CentOS 5 and Redhat Enterprise 5, 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 (2 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.

CentOS 5

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

  1. Login as root via SSH or at the console.
  2. Install the Xen kernel with the command
    yum install kernel-xen kernel-xen-devel
  3. 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
  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. Install the Xen commands package with the command
    yum install xen
  6. Disable the virbr0 Qemu network interface with the command
    cat /dev/null >/etc/libvirt/qemu/networks/default.xml
  7. Make sure SElinux is disabled by editing /etc/sysconfig/selinux and changing the SELINUX line to SELINUX=disabled .
  8. 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.
  9. Verify that Xen is working with the command :
    xm list

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

  10. 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.

Redhat Enterprise 5

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. 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.
  10. Verify that Xen is working with the command :
    xm list

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

  11. Create the /xen directory, which Cloudmin uses by default for Xen system images, with the command
    mkdir /xen
When will there be

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

Posted by christefano on Fri, 2009-07-03 04:30
Soon. Jamie has setup the

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.

Posted by Joe on Fri, 2009-07-03 13:00