install XEN in Centos 5.4

Xen (pronounced /zɛn/) is a virtual-machine monitor for x86, x86-64, Itanium and PowerPC 970 architectures. It allows several guest operating systems to execute on the same computer hardware concurrently. The University of Cambridge Computer Laboratory developed the first versions of Xen; as of 2010 the Xen community develops and maintains Xen as free software, licensed under the GNU General Public License (GPL2).


Xen systems have a structure with the Xen hypervisor as the lowest and most privileged layer.[1] Above this layer come one or more guest operating systems, which the hypervisor schedules across the physical CPUs. The first guest operating system, called in Xen terminology “domain 0” (dom0), boots automatically when the hypervisor boots and receives special management privileges and direct access to all physical hardware by default. The system administrator can log into dom0 in order to manage any further guest operating systems, called “domain U” (domU) in Xen terminology. (source Wikipedia)

Lets create partitions where to save virtual machines , for example

[pirat9@localhost ~]$ sudo mkdir /vmw
[pirat9@localhost ~]$

boot etc lib lost+found mnt proc sbin srv tmp var
[root@unixmen ~]#

The Selinux Configutaion shouldm be disabled . shoudl be like:

[root@unixmen ~]# more /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
# targeted – Targeted processes are protected,
# mls – Multi Level Security protection.

when you disable your Selinux please reboot your machine with

#yum install kernel-xen xen


after reboot check if the XEN kernel is started


[pirat9@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.18-164.11.1.el5xen #1 SMP Wed Jan 20 08:06:04 EST 2010 x86_64 x86_64 x86_64 GNU/Linux

check if Xen is started with

[root@localhost ~]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 5613 4 r—– 308.4
[root@localhost ~]#

now we have to start installing virtual machines

install from the host http :

-n = name of vbox

-r ram in MB

-f the file image

-s size of the disk

-l install source host (http pr ftp)

[root@localhost ~]# virt-install -n vmx -r 256 -f /vmw/vmx.img -s 4 -l

Starting install…
Retrieving file vmlinuz… | 1.9 MB 00:04
Retrieving file initrd.img… | 7.1 MB 00:13
Creating storage file… | 4.0 GB 00:00
Creating domain… | 0 B 00:01

the installation will connect directly to the console to complete the installation

Verry fine. now some useful commands to use to manage your Vm machines

Login under  root   with

[pirat9@localhost ~]$ su –

check xm commandswith

[root@localhost ~]# xm help


how to join your vm machines listed

[root@localhost pirat9]# xm list
Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 4818 4 r—– 2839.7
vmz 4 665 1 -b—- 16.8



Now join the VMZ domain  from terminal

[root@localhost pirat9]# xm console vmz
Bootdata ok (command line is ro root=/dev/VolGroup00/LogVol00)

CentOS release 5.4 (Final)
Kernel 2.6.18-164.el5xen on an x86_64

localhost.localdomain login:

Now  you can login to vmz  machine. and  good  luck 

Please shareShare on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0Share on Reddit0Digg thisShare on StumbleUpon0Share on VKBuffer this page