Mar3

Written by:David Aldridge
3/3/2011 10:58 PM 

First you have to enable virtualization on your processor and motherboard.  Most recent AMD chips support hardware virtualization.  Intel chips also do, but it is not as widely deployed as AMD.  In both cases you will have to enable it in the BIOS settings and then reboot the machine.

Once the machine comes back up you can check for the presence of hardware virtualization by running the following commands:

egrep ‘(vmx|svm)’ /proc/cpuinfo

If this command returns anything then you have sucessfully enabled hardware virtualization.  VMX is intel and SVM is AMD.

Now you need to install the Xen, virtual manager and Xen Kernel packages by using the following command:

yum install xen xen-devel kernel-xen virt-manager

This will install all of the required packages.

You now need to edit /boot/grub/grub.conf and change the 'default=1' to 'default=0' to enable the xen hypervisor kernel.

Now reboot the machine.  Once it comes back up, you can check the status using :

uname -r

Which should return the xen hypervisor kernel.

Now you can install a virtual machine using the virt-install command as follows:

virt-install --name 'myvirtual' --ostype=windows --os-variant=win2k8 --ram 1024 --vcpus=1 --hvm --cdrom=/path/to/iso.iso --disk path=/path/to/file.img,size=60 --network=bridge:xenbr0 --vnc --vncport=5901

What this says is to install a fully hardware virtualized Windows 2008 instance with 1Gb of Ram, 1 virtual cpu, a 60GB hard disk from the iso file specified in the --cdrom entry and bridged networking.  You will be able to access it during and after install by using VNC to connect to port 5901.

After the install is completed, you can monitor the virtual machines using the xm command:

xm list

will return a list of running virtual machines.
 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
You must be logged in and have permission to create or edit a blog.