Configuring Xen on Ubuntu Feisty
With the advent of Supercomputers and the need for highly scalable and reliable systems, Xen was formed. Xen can be considered to be a superior but esoteric attempt at Virtualization than VMWare ever was. This blog post seeks to educate immature and inexperienced greenhorns like myself on the easiest and possibly least efficient(less hassles involved) way of setting up Xen on a machine running Ubuntu 7.0(Fiesty).
Our boot loader(the program that loads up the operating system) must be a grub boot loader.
We must ensure that our processor supports virtualization. Virtualization can be of 2 types:
1. Para Virtualized Guest Systems
2. Fully Virtualized Guest Systems
For Para Virtualized Guests, the Intel processor must have the PAE extension and as for AMD x86_64 & ia64 processors support this mode of virtualization.
##################################################
$ grep pae /proc/cpuinfo
flags :fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts
##################################################
For Fully Virtualized Guests, the Intel processor must have the VMX flag or in the case of AMD SVM flag.
Once we determine our processor supports some form of virtualisation, we can then get into the nitty gritty of virtualization…;-)
1. Ensure our universal repository is enabled.
#################################################
sudo vi /etc/apt/sources.list
#################################################
2. Update all our repositories
#################################################
sudo apt-get update
#################################################
3. Install Xen from the Ubuntu repository
#################################################
sudo apt-get install ubuntu-xen-server
#################################################
4. Reboot the Ubuntu Machine and on startup boot into the Xen Kernel
5. Ensure that the host machine(Domain-0) is running
#################################################
sudo xm list
#################################################
6. Edit our Xen configuration file:
#################################################
sudo vi /etc/xen/xend-config.sxp
#################################################
7. Uncomment out this line:
(network-script network-bridge)
8. Comment out the following line:
(network-script network-dummy)
9. Restart xend
################################################
sudo xend restart
################################################
10. Create two Xen images -A virtual OS image and its associated swap file- using the disk dump utility and place in any directory of choice(mine is xen_images)
#######################################################
dd if=/dev/zero of=/xen-images/fedora_base.img bs=1024k count=2000
dd if=/dev/zero of=/xen-images/fedora_base_swap.img bs=1024k count=500
#######################################################
11. Format both images to their different file systems
###############################################
mkfs.ext3 /xen-images/fedora_base.img
mkswap /xen-images/fedora_base_swap.img
###############################################
12. Changing permissions on the images to ensure their integrity and prevent unauthorized tampering.
###############################################
chmod 640 /xen-images/fedora_base*
###############################################
13. We create a mount directory where our image will be mounted for an installation of any operating system of choice.
###############################################
mkdir /xen-images/mnt
###############################################
14. We can then mount the image
###############################################
mount -o loop /xen-images/fedora_base.img /xen-images/mnt
###############################################
to be cont’d

Leave a Reply