The final target of this post is to demonstrate how flexible is Ubuntu Karmic Koala Server environment. Build Xen 4.0 and the most recent stable pvops kernel 2.6.32.12 ( with DRM support). Loading Xen Instance followed by install Ubuntu’s Libvirt environment, providing utility virt-install for creating PV and HVM DomUs, virt-manager completely functional to manage any DomU been built via virt-install. Change-set 21112 from xen-4.0-testing.hg back ported to Xen 4.0 to support grub2 notation ‘(hd0,1)’ specific for Ubuntu 10.04 aka Lucid Lynx.
First install required packages:
apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
python2.6-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc \
bridge-utils iasl \
dpkg-dev debhelper fakeroot
Second – build Xen from source
# cd /usr/src
At this point creare grub2-fix.patch1 as raw content of http://xenbits.xensource.com/xen-4.0-testing.hg?rev/065efaec5e71 Changeset 21112 pygrub: Fix Grub2 support for Ubuntu 10.04
gunzip xen-4.0.0.tar.gz
tar -xvf xen-4.0.0.tar
cd xen-4.0.0
patch -p1 -s -i ../grub2-fix.patch1
make xen
make tools
make install-xen
make install-tools PYTHON_PREFIX_ARG=
Set up xend,xendomains to run as services
update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20
Now checkout and build 2.6.32.12 pvops kernel
cd /usr/src
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
cd linux-2.6-xen
git checkout -b xen/stable-2.6.32.x origin/xen/stable-2.6.32.x
Build kernel in Debian way
make menuconfig # Enabled the dom0 support and the Xen backends
make -j(x)number_of_kernels
chmod g-s /usr/src -R
make deb-pkg
dpkg -i ../linux-image*2.6.32.12*.deb
depmod 2.6.32.10
update-initramfs -c -k 2.6.32.12
One more notice regarding /etc/modules editing :-
In case configuring kernel (1)
<M> Xen /dev/xen/evtchn device
echo “xen-evtchn” >> /etc/modules
In case configuring kernel (2)
<*> Xen /dev/xen/evtchn device
/etc/modules shouldn’t be touched.
With config bellow there is no need to touch /etc/modules at all

At this point kernel is installed
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 ( vs F12 ). Thus you won’t be able to start xend in Dom0.
Add entry to /boot/grub/grab.cfg:-
menuentry “Xen 4.0 / Ubuntu 9.10 kernel 2.6.32.12 pvops” {
insmod ext2
set root=(hd1,8)
multiboot (hd1,8)/boot/xen.gz
module (hd1,8)/boot/vmlinuz-2.6.32.12 dummy=dummy root=/dev/sdb8 ro console=tty0
module (hd1,8)/boot/initrd.img-2.6.32.12
}
Reboot system and install libvirt environment :-
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.
Then run:-
# apt-get install ubuntu-virt-server ubuntu-virt-mgmt
Now you should be able to install Ubuntu 10.04 Lucid Server HVM via virt-install :-
# virt-install -n LucidSRV -r 1024 --hvm --vnc -f /dev/sda8 -c /home/boris/Lucid.iso --debug
Create following XML LucidPVG-def.xml
<domain type='xen' id='1'>
<name>LucidPVG</name>
<uuid>118b9cb4-2ea5-daf6-abcd-710f3c7d2b8a</uuid>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>2</vcpu>
<bootloader>/usr/local/bin/pygrub</bootloader>
<bootloader_args>-q</bootloader_args>
<os>
<type>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sda8'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:3f:79:01'/>
<source bridge='eth0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif1.0'/>
</interface>
<console type='pty' tty='/dev/pts/0'>
<source path='/dev/pts/0'/>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5900' autoport='yes'/>
</devices>
</domain>
Then define and start via virt-manager Lucid RC PV DomU
# virsh define LucidPVG-def.xml

Posted by dbaxps 





