Step-by-Step Guide to Installing Xen Virtualization on CentOS 6
This tutorial walks through installing Xen virtualization on a CentOS 6.6 system, covering environment setup, required packages, kernel configuration, bridge networking, libvirt tools, and creating and cloning virtual machines using command‑line utilities.
Installing Xen Virtualization on CentOS 6
Since Red Hat stopped native Xen support from RHEL 6 and moved to KVM, many administrators still prefer Xen for its stability. This guide uses the third‑party Xen Made Easy repository to install Xen 4 on CentOS 6.6.
1. Environment
Hardware: HP DL360 G6 (E5520, 16 GB, 2×146 GB). System version: CentOS‑6.6‑x86_64‑minimal.iso
2. System Initialization
wget http://blog.linuxeye.com/lnmp-full.tar.gz
tar xzf lnmp-full.tar.gz
cd lnmp
./install.sh # choose "no" for all prompts
chkconfig iptables off # disable iptables3. Install bridge-utils
yum -y install bridge-utils4. Add the crc.id.au repository
yum -y install http://au1.mirror.crc.au/repo/el6/x86_64/kernel-xen-release-6-7.noarch.rpm5. Install Xen hypervisor
yum -y install xen
ls -l /boot/xen.gz6. Install Xen kernel
yum -y install kernel-xenNote: kernel‑xen depends on kernel‑xen‑firmware; because the packages are large, it is recommended to download them locally and install with yum -y localinstall kernel‑xen*.
7. Configure GRUB
Edit /boot/grub/grub.conf to boot the Xen kernel (see screenshot).
8. Enable Xen daemon
chkconfig xend on # enable xend at boot9. Configure bridge networking
Create /etc/sysconfig/network-scripts/ifcfg-xenbr0 with the following content:
DEVICE=xenbr0
TYPE=Bridge
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.3.20
NETMASK=255.255.255.0
GATEWAY=192.168.3.1Modify /etc/sysconfig/network-scripts/ifcfg-eth0 to attach it to the bridge:
DEVICE=eth0
HWADDR=F4:CE:46:85:64:34
TYPE=Ethernet
ONBOOT=yes
BRIDGE=xenbr0
NM_CONTROLLED=no service network restart # restart networking10. Reboot the server
After reboot, the system should start with the Xen kernel (see screenshot).
11. Install virtualization management tools
yum -y install libvirtLibvirt provides a hypervisor‑agnostic API for securely managing guest operating systems. It was originally designed for Xen and later extended to support multiple hypervisors.
service libvirtd start
yum -y install python-virtinstThe python-virtinst package supplies commands such as virt-install and virt-clone for creating and cloning VMs.
12. Configure installation source
Mount the CentOS‑6.6 ISO on a web server (e.g., 192.168.3.10:81) and copy its contents to /var/www/html/centos6.6 so that other hosts can access it via http://192.168.3.10:81/centos6.6. Ensure the .treeinfo file contains the following section:
[images-xen]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img13. Install a guest OS via the console
mkdir -p /data/xen
virt-install -n vm21 -r 2048 --vcpus=2 --nographic \
--disk path=/data/xen/vm21.img,size=20 \
--location http://192.168.3.10:81/centos6.6 \
--bridge=xenbr0,model=virtioKey virt-install options:
-n, --name Guest VM name
-r, --ram Memory size (MB)
--uuid Guest UUID
--vcpus=NUM Number of virtual CPUs
--hvm Full virtualization
--paravirt Paravirtualization
--location=PATH Installation source (local or URL)
--vnc Enable VNC console
--cdrom=DEVICE CD‑ROM installation media
--file=PATH Disk image file
--disk=OPTIONS Disk configuration14. Clone the VM
virt-clone -o vm21 -n vm22 -f /data/xen/vm22.imgAfter cloning, start the new VM with virsh start vm22.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
