Virt-install&Virt-manager at Xen 4.0 (2.6.32.12 pvops) Dom0 on top Ubuntu Karmic Koala Server

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


12 Responses to Virt-install&Virt-manager at Xen 4.0 (2.6.32.12 pvops) Dom0 on top Ubuntu Karmic Koala Server

  1. Lurker says:

    It is no longer 2.6.32.10. Using the above git commands, the repository is 2.6.32.11. The walk-through is now stale.

  2. Lurker says:

    Error:

    >Add entry to /boot/grub/grab.cfg:-

    …should be…

    Add entry to /boot/grub/grub.cfg:-

    New release means changes to the following:

    OLD:

    menuentry “Xen 4.0-rc8 / Ubuntu 9.10 kernel 2.6.32.10 pvops” {
    insmod ext2
    set root=(hd1,8)
    multiboot (hd1,8)/boot/xen.gz
    module (hd1,8)/boot/vmlinuz-2.6.31.12 dummy=dummy root=/dev/sdb8 ro console=tty0
    module (hd1,8)/boot/initrd-2.6.31.12.img
    }

    …new…

    menuentry “Xen 4.0-rc8 / Ubuntu 9.10 kernel 2.6.32.11 pvops” {
    insmod ext2
    set root=(hd1,8)
    multiboot (hd1,8)/boot/xen.gz
    module (hd1,8)/boot/vmlinuz-2.6.32.11 dummy=dummy root=/dev/sdb8 ro console=tty0
    module (hd1,8)/boot/initrd-2.6.32.11.img
    }

    IMHO, this line is a bit vague: “and tune kernel to support Xen in Dom0”.

  3. Lurker says:

    Just tried to boot into the new kernel, I must be missing something. I get: “error: You need to load the multiboot kernel first”. Is anyone else reading this blog entry?

  4. Lurker says:

    Notes about: /boot/grub/grub.cfg

    In the instructions, they are specific to the author’s set up. Your set up will most likely be MUCH different. Examine your other entries in /boot/grub/grub.cfg and configure your settings appropriately. Use your already existing entries as a template.

  5. Hardeep Uppal says:

    Do you have instruction to compile and configure Xen-4.0 with ubuntu-9.04. I need to use the older version (9.04) of ubuntu for dom0 because I need TrustedGrub which is build on Grub-0.97. I would appreciate any help.

  6. dbaxps says:

    Same should work for 9.04

  7. dbaxps says:

    Funny question. Never.
    Run “git branch -r” to view available branches of remote Git
    repo.

  8. dbaxps says:

    In meantime we have :-
    root@ServerLnx:/usr/src/linux-2.6-xen# git branch -r
    origin/HEAD -> origin/xen/master
    origin/bugfix
    origin/fix-iopl
    origin/linux-2.6
    origin/linux-imq
    origin/mainline/net
    origin/mainline/x86-paravirt-fix
    origin/net/skb-must-copy
    origin/trace/core
    origin/trace/pvops
    origin/trace/pvops-old
    origin/vmap-disable-lazy
    origin/x86/brk
    origin/x86/fpu
    origin/x86/paravirt
    origin/x86/pci
    origin/x86/preempt-lazy-mmu
    origin/x86/unify
    origin/x86/unify-irq
    origin/x86/unify-kmemcheck
    origin/x86/untangle2
    origin/x86/virt
    origin/xen-novell
    origin/xen/balloon
    origin/xen/balloon-boot
    origin/xen/blkfront
    origin/xen/core
    origin/xen/core-freemem
    origin/xen/dev-evtchn
    origin/xen/dom0/acpi
    origin/xen/dom0/acpi-next
    origin/xen/dom0/acpi-parser
    origin/xen/dom0/agp
    origin/xen/dom0/apic
    origin/xen/dom0/apic-next
    origin/xen/dom0/apic-xiantao
    origin/xen/dom0/backend/blkback
    origin/xen/dom0/backend/blktap2
    origin/xen/dom0/backend/core
    origin/xen/dom0/backend/netback
    origin/xen/dom0/backend/netback-skb
    origin/xen/dom0/backend/netback-tasklet
    origin/xen/dom0/core
    origin/xen/dom0/drm
    origin/xen/dom0/gntdev
    origin/xen/dom0/konrad-swiotlb-2.6.32
    origin/xen/dom0/mce
    origin/xen/dom0/microcode
    origin/xen/dom0/msi
    origin/xen/dom0/new-interrupt-routing
    origin/xen/dom0/pci
    origin/xen/dom0/pciback
    origin/xen/dom0/pcpu-hotplug
    origin/xen/dom0/swiotlb
    origin/xen/dom0/swiotlb-new
    origin/xen/dom0/xenfs
    origin/xen/fbdev
    origin/xen/frontend
    origin/xen/hacky-highpte-non-fix
    origin/xen/hugepage-balloon
    origin/xen/master
    origin/xen/netchannel2
    origin/xen/netfront
    origin/xen/next
    origin/xen/next-2.6.33
    origin/xen/next-2.6.34-WIP
    origin/xen/oprofile
    origin/xen/pci
    origin/xen/pcifront
    origin/xen/pvhvm
    origin/xen/pvhvm-old
    origin/xen/pvhvm-sheng
    origin/xen/pvhvm-stefano
    origin/xen/pvhvm-stefano-rebase
    origin/xen/pvticketlock
    origin/xen/stable
    origin/xen/stable-2.6.31.x
    origin/xen/stable-2.6.32.x
    origin/xen/stable-2.6.33.x
    origin/xen/tmem
    origin/xen/vsyscall
    origin/xen/xenbus
    origin/xen/xenpredicate

  9. Hi there! I know this is kind of off-topic however I needed to ask.
    Does operating a well-established website such as yours require
    a lot of work? I am brand new to running a blog but I
    do write in my journal daily. I’d like to start a blog so I can easily share my personal
    experience and views online. Please let me know if you have any kind of suggestions or
    tips for new aspiring bloggers. Thankyou!

    • dbaxps says:

      I just do it mostly for myself . Easy to remind details. However , I would like people to understand clear what I mean.
      Any human may make mistakes and myself as well.

Leave a comment