Virtualizer toolbox – Xen installation

Virtualizer toolbox - Xen installation


This is a set of simple instructions which will help you install Xen on CentOS 5.8 to play with virtual machines (no security or performance aspects addressed). For example, you may want to build different virtual machines to use them for Selenium testing inside your office and build your own QA lab.

It is recommended to check if your CPU supports hardware virtualisation before going any further. Here you can find the commands to use.

We assume that you have free space on your CentOS machine as you will need some to be able to put installation images, especially if you are going to install Windows as well as space for actual virtual machines and their snapshots, clones etc. Your installed virtual machine can reside in a file, partition or logical volume.

Installing Xen.

#yum install xen

Turn it on and put it into auto load mode on boot.

#chkconfig xend on
#service xend start

Adding into /etc/xen/xend-config.sxp (address that should be listened on for the VNC server if vnc is set):

(vnc-listen ’0.0.0.0′)

Installing Xfce – lightweight windows interface for Unix.

#yum install xfce-utils

Switch off your firewall.

#service iptables stop
#chkconfig iptables off

Switch off Selinux.

#sestatus
#setenforce 0

Adding into /etc/sysconfig/selinux

SELINUX=disabled

Install VNC server and create VNC password (123456 is a good one for our setup):

#yum install vnc-server
#vncpasswd

Create VNC start-up file …

#vi .vnc/xstartup

#!/bin/sh
 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
startxfce4 &

… and allow to execute it.

#chmod +x .vnc/xstartup

Install virt-viewer and virt-manager, which we will be using to create and browse virtual machines.

#yum -y install virt-viewer
#yum -y install virt-manager

If you create virtual machines on a logical volume – create a logical volume with your desired size.

#lvcreate --size 10G --name win7 vg0

Launch VNC server

#vncserver :1

Now we can go back to your PC and load VNC Viewer (vnc-4_1_3-x86_win32_viewer) and launch it.

Launch VNC viewer

Enter your Unix IP in this format – IP:1 (for example, 192.168.3.49:1) and password. Now we can launch Virtual Machine Manager …

Launch Virtual Machine Manager

… and start building virtual machines.

Create a new virtual machine

That was fast, isn’t it? Hope you got it up and running too. If not – post your question here.

Print this post | Home

Comments are closed.