Sunday, June 8, 2014

XEN Hypervisor & Virtual machine installation Process

Creating Domain-0 which access hardware resource

Following packages must be installed:

apt-get install xen-hypervisor-4.1-amd64
apt-get install xenwatch
apt-get install xen-tools

Now you have installed everything you need to run your dom0. Before you restart your system edit and add the following (rather uncomment)

(xend-unix-server yes)

Next restart your system and pick the xen-kernel from the grub menu (if you want you can edit /etc/default to pick the correct kernel automatically). Now you are good to go.

Simply run or , you will see your system is running.

Creating a domU

Now Here are the steps to create an Ubuntu Lucid guest (domU) using xen-create-image utility, for that follow following steps.

Step1: go to /etc/xen-tools (edit xen-tools.conf or create a new conf file)
Step 2: Configure it as follows

dir = /mnt/xen
install-method = debootstrap
size = 6Gb # Disk image size.
memory = 1024Mb # Memory size
swap = 128Mb # Swap size
# noswap = 1 # Don't use swap at all for the new system.
fs = ext3 # use the EXT3 filesystem for the disk image.
dist = lucid # Default distribution to install.
image = sparse
dhcp = 1
nameserver = IP address of DNS Server
bridge = virbr0
kernel = /boot/vmlinuz-`uname -r`
initrd = /boot/initrd.img-`uname -r`
mirror =
ext3_options = noatime,nodiratime,errors=remount-ro
ext2_options = noatime,nodiratime,errors=remount-ro
xfs_options = defaults
reiserfs_options = defaults
btrfs_options = defaults
boot = 1
passwd = 1
serial_device = hvc0
disk_device = xvda

Step 3: Creating image
xen-create-image –hostname=ubuntulucid

In the middle of the image creation it will ask for the root password, simply put the password you like. Your domain will start automatically”

For Logging
xm console ubuntulucid

For Terminating VM
xm destroy ubuntulucid
For Restarting VM
xm create –c /etc/ubuntulucid.cfg

1 comment: