How to Install Xen on CentOS and create your private Cloud for testing

1. Installation of CentOS in VirtualBox

This is easy so I wont’be writing too much. Ask me question if you have any problems.

2. OK. CentOS is installed on!

You need to setup your network so you have access to the Internet.

a).

Check by issuing command $ifconfig

if you have’nt got eth0 then

$ifconfig eth0 up

Job done you are great!

$dhclient

So we now have IP configuration set up . Yupi!

can you ping Google DNS 8.8.8.8 $ping 8.8.8.8

YES! You can’t I know that 1 point score for you! 0:1 for me 😦

Lets install XEN!!!!!!!!!!!!!!!!!!!!!!! HYPER DUPER SUPER virtualization enviroment.

yum install centos-release-xen
yum install xen

:) easy isn't it ?

I am using Cent OS 6.5 minimal instal version so 73mb to downlad

The Xen hypervisor runs above the linux kernel, and we need to tell grub to boot it first and then chain boot the linux kernel for our dom0. In order to do that, a script is provided as part of the centos-release-xen rpm, lets run that now:

/usr/bin/grub-bootxen.sh

At this point if you look at your /boot/grub/grub.conf it should have something like this:

 

title CentOS (3.4.46-8.el6.centos.alt.x86_64)
        root (hd0,0)
        kernel /xen.gz dom0_mem=1024M,max:1024M loglvl=all guest_loglvl=all
        module /vmlinuz-3.4.46-8.el6.centos.alt.x86_64 ro root=/dev/mapper/vg_xen01-lv_root rd_LVM_LV=vg_xen01/lv_swap rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=uk rd_NO_MD LANG=en_GB rd_LVM_LV=vg_xen01/lv_root SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_DM rhgb quiet
        module /initramfs-3.4.46-8.el6.centos.alt.x86_64.img

and this should be set as your default boot kernel. Once you reboot, verify that the 3.x kernel is running with:

uname -r

and verify that xen is running with:

xm info

At this point you are now ready to bring up your first VM, and there are multiple ways of achieving this. For new users, who are looking for the easiest install path, the Libvirt process is recommended. Advanced users looking to hand setup the network, the backing filestore and the xen environment will most likely want to use the xen command line tools.

  • With Xen CLI tools, including xm and xl: /Xen4Cli

  • Using LibVirt/ Virt-install and Virt-Manager with xen4centos: /Xen4Libvirt

 

I normally like to add a couple of packages to every minimal install, and some things later may need these packages. Install them via this command:

 

yum install rsync wget vim-enhanced openssh-clients

 

Installing libvirt (on the Dom0 machine)

First we need to install the basic packages required for libvirt:

 

yum install libvirt python-virtinst libvirt-daemon-xen
After the install, restart your Dom0 machine. 


That is it to start of now you can create your virtual inside virtual machine ;)

 

 

Advertisements

One thought on “How to Install Xen on CentOS and create your private Cloud for testing

  1. You really make it seem so easy along with your presentation but I
    to find this topic to be actually one thing which I feel I would
    never understand. It sort of feels too complex and very
    broad for me. I am looking ahead on your subsequent publish, I will try to get the hold of it!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s