How to install XEN 3.4.1 on CentOS 5.4

centosxenWhat is Xen?

The Xen hypervisor, the powerful open source industry standard for virtualization, offers a powerful, efficient, and secure feature set for virtualization of x86, x86_64, IA64, ARM, and other CPU architectures. It supports a wide range of guest operating systems including Windows, Linux, Solaris, and various versions of the BSD operating systems.

Preliminary Note:

I’m using a CentOS 5.4 x86_64 base installation in this tutorial

  • server1.example.co.za (IP 10.0.0.100): CentOS 5.4 x86_64 Base installation

Install the Gitco repository

Browse to http://www.gitco.de/repo/ and grab the latest repo for your arch. (in this case x86_64)

# cd /etc/yum.repos.d/
# wget http://www.gitco.de/repo/GITCO-XEN3.4.1_x86_64.repo

Remove previous installations of XEN before re-installing XEN 3.4.1

# yum groupremove Virtualization
# yum groupinstall Virtualization

Edit grub.conf to reflect the correct default Kernel

# vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.7.1.el5xen)
        root (hd0,0)
        kernel /xen.gz-3.4.1
        module /vmlinuz-2.6.18-128.7.1.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-128.7.1.el5xen.img
title CentOS (2.6.18-128.1.16.el5xen)
        root (hd0,0)
        kernel /xen.gz-3.4.1
        module /vmlinuz-2.6.18-128.1.16.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-128.1.16.el5xen.img
title CentOS (2.6.18-128.el5xen)
        root (hd0,0)
        kernel /xen.gz-3.4.1
        module /vmlinuz-2.6.18-128.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-128.el5xen.img
title CentOS (2.6.18-164.el5xen)
        root (hd0,0)
        kernel /xen.gz-3.4.1
        module /vmlinuz-2.6.18-164.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-164.el5xen.img

Reboot the machine for new XEN kernel to take effect

# reboot

After the reboot check the Kernel to reflect the change

# uname -r
2.6.18-128.7.1.el5xen