Alexander Jung

CS PhD Student @LancasterUni

Posted on 2 mins read Tag: Xen, CentOS, VMs

Xen is a powerful hypervisor designed for the immediate instantiation and destruction of Virtual Machines (VMs) on a host machine. This enables the containment of many isolated OS environments (known as “guests”) running on the same physical machine, with the ability to distribute and control their resources precisely as desired.

A testement to Xen’s success is illustrated through its continued use on Amazon’s EC2 clusters, its supported for many architectures, including x86, x86_64 and ARM, and the veriaty of platforms it can run including Linux, Windows and Solaris. However, Xen requires a custom kernel supported by the guest OS before it can be used.

Whilst the debate between the choice of VM provider, such as KVM, Docker and Vagrant, is worth a seperate discussion in itself, this tutorial aims to provide a break down of the steps required for installing Xen on a REHL based distribution of the Linux Kernel, namely CentOS 7. This flavour of linux is stable, well-maintained and used widely as a server environment.

Prerequisits

CentOS 7 must be installed on the host environment, with access to internet.

Method

It’s actually pretty easy to install Xen on CentOS. Below is an extract from this snippet which automates the process.

#!/bin/sh

# Make sure everything is up to date
yum update -y

# Enable Xen repository + dev tools
yum install -y centos-release-xen sudo passwd bzip2 patch nano which tar wget \
xz libvirt libvirt-daemon-xen
yum groupinstall -y "Development Tools"

# Xen4 provides an updated kernel; pull in the new kernel in:
yum update -y

# Install Xen itself
yum install -y xen

# Force update GRUB
grub-bootxen.sh

Et viola ici!