Board index Linux Virtualization Citrix XenServer

Moderator: chandranjoy

Install and Setup XEN Server on CentOS5.x Linux?

Postby chandranjoy » Sun Nov 21, 2010 6:38 pm

How to Install and Setup XEN Virtualization Software on CentOS Linux 5?
Xen is a free open source software virtual machine monitor for Intel / PowerPC architectures. It is software that runs on a host operating system and allows several guest operating systems to be run on top of the host on the same computer hardware at the same time (just like VMWare software). Luckily Installing and managing XEN is quite easy under CentOS 5 Linux.

Login as the root and type the following commands:
# yum install xen virt-manager kernel-xen
# chkconfig xend on
# reboot

Note: Please make sure that you boot CentOS server using XEN kernel.

Creating A Virtual Machine:
CentOS comes with a nice tool called virt-install with which we can create virtual machines for Xen. To start it, we simply run

Installing CentOS 5.3 guest using the Internet:

virt-install is a command line tool for provisioning new virtual machines using the "libvirt" hypervisor management library. Type the following command to install CentOS v5.3 64 bit as guest operating system in /vm:
# mkdir /vm
If you are using SELinux, enter:
# semanage fcontext -a -t xen_image_t "/vm(/.*)?"
# restorecon -R /vm
# ls -dZ /vm

Above will provide security context of Xen images. Finally, install CentOS 5.3 using the Internet mirror:
# virt-install \
--paravirt \
--name webserver01 \
--ram 512 \
--file /vm/ \
--file-size 10 \
--nographics \

Installing CentOS 5.3 guest using DVD

Install a CentOS guest, using LVM partition, virtual networking, booting from the host CDROM, using VNC server/viewer (insert DVD into drive):
# virt-install \
--connect qemu:///system \
--name mailserver
--ram 500 \
--file /dev/HostVG/ \
--network network:default \
--accelerate \
--vnc \
--cdrom /dev/cdrom

Note you need qemu and virt-viewer installed on the host system.
Installing Fedora guest using DVD iso image stored on hard disk

Install a Fedora Linux, with a real partition (/dev/sdc), using a local DVD ISO image:
# virt-install \
--name www2 \
--ram 1000 \
--file /dev/sdc \
--network bridge:eth1 \
--cdrom /tmp/fedorabootdvd.iso

XEN Server Status Monitoring Command Cheat Sheet:

The xm command is the main command line interface for managing Xen guest domains. The program can be used to create, pause, and shutdown domains. It can also be used to list current domains, enable or pin VCPUs, and attach or detach virtual block devices.

Please note that before running any one of the following command you must run xend ( Xen control daemon aka service) and must be run as privileged user. Running xm command as non root will return an error.

I hope following XEN status monitoring cheat sheet will save your time.

Displays uptime for a domain
xm uptime

Monitors a host and its domains in real time
xm top

Displays domain information
xm list

Displays host information
xm info

Lists domain virtual processors
xm vcpu-list

Lists domain virtual network interfaces
xm network-list

Displays node information
virsh nodeinfo

Displays domain virtual processor information
virsh vcpuinfo

Displays the xend log
xm log

Displays domain information
virsh dominfo

Reads the xend daemon’s message buffer just like dmesg
xm dmesg

Reference Url: ... mands.html ... howto.html

Enjoy friends :)
Site Admin
Posts: 283
Joined: Fri Oct 23, 2009 11:19 pm

Return to Citrix XenServer

Who is online

Users browsing this forum: No registered users and 1 guest