Sunday, May 20, 2012

How to install Xen 4.1 on Ubuntu 11.10

I was trying to make Windows DomU work on Ubuntu+Xen setup. I have to spend couple of hours to find out in what sequence we should do the installation and configuration.

Ubuntu support xen officially from 11.10 version. But there is some issue while creating DomU. Here find some easy step to configure xen 4.1 on 64 bit version of ubuntu 11.10 and solve issue in DomU creation.

1. Install xen and utilities

  1. $sudo apt-get install xen-hypervisor-4.1-amd64 xen-utils-4.1 xenwatch xen-tools xen-utils-common xenstore-utils  
  2. $sudo apt-get install virtinst  
  3. $sudo apt-get install virt-viewer virt-manager  

2.Restart OS and Select Xen KernalVerify the Xen installation using

  1. $sudo xm info  

If this command does not return any error, then the installation is correct.

3.Xend Configuration
/etc/xen/xend-config.sxp and uncomment this line

(xend-unix-server no)

and change to
  1. (xend-unix-server yes)  
Edit .bashrc file using

  1. #vi ~/.bashrc  
, add the following line:
  1. export VIRSH_DEFAULT_CONNECT_URI="xen:///"  

4. Restart OS and Select Xen Kernel

Verify libvirt Installation

  1. $sudo virsh version   

  1. Compiled against library: libvir 0.8.3  
  2. Using library: libvir 0.8.3  
  3. Using API: Xen 3.0.1  
  4. Running hypervisor: Xen 4.0.0  
If got output like this, you have installed every package correctly.
5.Creating VM using virt-manager
Here I am telling about virtual machine creation using virt-manger
Type $sudo virt-manager for getting GUI for virt-manager
Create new VM using virt-manager(Learn More)
Solution for common error during DomU is given below..
1. Show Something like this

Fix it using
  1. $sudo mkdir /usr/lib64/xen -p  
  2. $sudo cp /usr/lib/xen-4.1/* -r /usr/lib64/xen/  
2. Get like this
Solve it using

  1. $sudo mkdir  /usr/share/qemu  
$sudo cp -r /usr/share/qemu-linaro/keymaps /usr/share/qemu/
 If you have : 
  1. WARNING!  Can't find hypervisor information in sysfs!
    Error: Unable to connect to xend: No such file or directory. Is xend running?
    It’s not that bad. It’s just that GRUB2 start the kernel without the hypervisor (the “right” line in the menu exists, but it’s in second position). So, you need to put Xen hypervisor first, and the “good” way to do this is :

    mv /etc/grub.d/10_linux /etc/grub.d/50_linux


    to get the supported disk

    install apt-get install qemu-kvm

    qemu-img convert source.vhd -O vmdk destination.vmdk

    2. If for some reason you wish to enable the root account, simply give it a password:
    sudo passwd
    sudo adduser [user name] admin

    Grub issue

    virsh version give error- do not use sudo


No comments: