Set up Xen 3.4.3-rc2 & Libvirt 0.7.0 Dom0 (with 2.6.31.8 xenified aka Suse kernel) on top of Ubuntu 9.10 Server

Install Libvirt 0.7.0 along with KVM creates environment with default Hypervisor QEMU . Two steps in procedure bellow make Xen default Hypervisor on Ubuntu 9.10 . First is commenting out (xend-unix-server yes) in /etc/xen/xend-config.sxp , second export variable

export VIRSH_DEFAULT_CONNECT_URI="xen:///"

in root’s .bashrc.
1.Installed KVM with no intend to work with it
# apt-get install ubuntu-virt-server ubuntu-virt-mgmt
# adduser $USER kvm
and configured bridge . This step is not required by Xen. It just allows to switch between Xen and QEMU :-

root@ServerKoala:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp

# Bridge definied
auto br0
iface br0 inet static
address 192.168.1.45
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off


Restart /etc/init.d/networking

2. Build Xen 3.4.3-rc1-pre.
First – install on Uubuntu 9.10 Server all packages required for Xen build:-

apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
python2.6-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc

Second step :-

# cd /usr/src
# hg clone http://xenbits.xensource.com/xen-3.4-testing.hg
# cd xen-3.4-testing.hg
Set in Config.mk
PYTHON = python
PYTHON_PREFIX_ARG =

Tuning Config.mk results Xen packages to be placed into /usr/local/lib/python2.6/dist-packages due to Changeset 19594 in xen-3.4-testing.hg. Otherwise, Xen packages would go to /usr/lib/python2.6/site-packages, which is not default location for python 2.6 on Ubuntu 9.10.

# make xen
# make tools
# make install-xen
# make install-tools

3. Edited xend-config.sxp set (xend-http-server yes) and commented all bridge declarations
4. Patched 2.6.31.8 kernel via
http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.31-9.tar.bz2
Untar linux-2.6.31.8.tar.bz2 and apply patches.

# cd /usr/src/build/
# bzcat linux-2.6.31.8.tar.bz2 | tar xf -
# mkdir -p xen-patches-2.6.31-9
# cd xen-patches-2.6.31-9
# bzcat ../xen-patches-2.6.31-9.tar.bz2 | tar xf -
# cd ../linux-2.6.31.8

Run script

#!/bin/bash
for P in `ls ../xen-patches-2.6.31-9/6*.patch1 | sort `
do
patch -p1 -s -i $P
if [ $? = 0 ]; then
echo $P applied
else
echo "Error processing "$P
exit 1
fi
done

5. Built kernel , previously tuned to support Xen at Dom0 , with built-in static command line (root=/dev/sdb11 ro console=tty0) and installed.
Created /boot/grub/grub.cfg entry:-

menuentry "Xen 3.4 / Ubuntu 9.10 kernel 2.6.31.8 xenified" {
insmod ext2
set root=(hd1,10)
multiboot (hd1,10)/xen-3.4.gz
module (hd1,10)/vmlinuz-2.6.31.8
module (hd1,10)/initrd-2.6.31.8.img
}

Rebooted the system

# ln -s /usr/local/bin/pygrub /usr/lib/xen-default/bin/pygrub

root@ServerKoala:~# export VIRSH_DEFAULT_CONNECT_URI="xen:///"
root@ServerKoala:~# virsh version
Connecting to uri: xen:///
Compiled against library: libvir 0.7.0
Using library: libvir 0.7.0
Using API: Xen 3.0.1
Running hypervisor: Xen 3.4.0

Virt-manager install F12 PV DomU via local Apache Mirror











Virt-install CentOS 5.4 PV DomU

virt-install -n VM54R -r 1024 -p --vnc \
--os-type=linux --os-variant=rhel5 --bridge=virbr0 \
-f /dev/sdb7 -l http://192.168.1.45/rhel54 --debug




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

%d bloggers like this: