CentOS 5.2 Tutorials CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials

Installing XEN on CentOS 5.x

centosThis is a very simple installation of XEN visualization that I will be using in future posts as a reference.

# 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
title CentOS (2.6.18-92.1.10.el5xen)
        root (hd0,0)
        kernel /xen.gz-3.3.0
        module /vmlinuz-2.6.18-92.1.10.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-92.1.10.el5xen.img
title CentOS (2.6.18-92.1.10.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.1.10.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-92.1.10.el5.img
title CentOS (2.6.18-92.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.18-92.el5.img

Reboot the machine for new XEN kernel to take effect

# reboot

After the reboot check the Kernel to reflect the change

# uname -r


Install a CentOS 32 bit Virtual Machine using virt-install and your local YUM repository

# virt-install -p --location= --noautoconsole \
 --name=machine --ram=284 --file=/path/to/machine.img --file-size=5 --nographics -b xenbr0

Some useful commands

# xm list
# xm create vmmachine
# xm console vmmachine

By George

Technical Samurai specializing in open source IT Automation and Cloud Infrastructure.