Set up Xen 3.4.3 Dom0 via xenified 2.6.31.12 kernel on top of Ubuntu 9.10 Server

Following bellow is build Xen Host on top Ubuntu 9.10 Server.It is based on direct clone via “hg” and build Xen 3.4.3-rc4 from xensource.com , applying Andrew Lyon’s 2.6.31 patch set V12 to vanilla kernel 2.6.31.12 along with tuning patched kernel via “make menuconfig” and building aka Suse xenified kernel in Ubuntu 9.10 environment.Notice that forward porting of original patch set was done by Jan Beulich for 2.6.31.8 kernel on OpenSuse 11.2. Built in patched kernel open-source NVIDIA and Radeon HD drivers work just fine on Ubuntu 9.10, providing Gnome Desktop Environment right away.

# cd /usr/src/build/
# wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.31-12.tar.bz2

4.Untar linux-2.6.31.12.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-12
# cd xen-patches-2.6.31-12
# bzcat ../xen-patches-2.6.31-12.tar.bz2 | tar xf -
# cd ../linux-2.6.31.8

Run script

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

Build kernel :-

# make menuconfig

Processor type and features ->
[*] Symmetric multi-processing support
[ ] Support sparse irq numbering
[*] Enable MPS table
[*] Enable Xen compatible kernel
[*] Single-depth WCHAN output
Processor family (Generic-x86-64) --->
[ ] Configure Maximum number of SMP Processors and NUMA Nodes
(64) Maximum number of CPUs
Preemption Model (No Forced Preemption (Server)) --->
[ ] Machine Check Exception

Device Drivers -> XEN
[*] Privileged Guest (domain 0)
<*> Backend driver support
<*> Block-device backend driver
<*> Block-device tap backend driver
<*> Block-device tap backend driver 2
>*> Network-device backend driver
(8) Maximum simultaneous transmit requests (as a power of 2)
[ ] Pipelined transmitter (DANGEROUS)
< > Network-device loopback driver
<*> PCI-device backend driver
PCI Backend Mode (Virtual PCI) --->
[ ] PCI Backend Debugging
< > TPM-device backend driver
<M> SCSI backend driver
<M> USB backend driver
<M> Block-device frontend driver
<M> Network-device frontend driver
<M> Network-device frontend driver acceleration for Solarflare NICs
<M> SCSI frontend driver
<M> USB frontend driver
[*] Taking the HCD statistics (for debug)
<*> User-space granted page access driver
<*> Framebuffer-device frontend driver


# make -j(x)(number_of_cores)
# make modules_install install
# mkinitramfs -o /boot/initrd-2.6.31.12.img 2.6.31.12

Different option is to install pvops enabled kernel 2.6.32.9 via download :-

# 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 origin/xen/stable -b xen/stable

Notice :-

# git checkout origin/xen/master -b xen/master

will result building the most recent 2.31.6 version of pvops kernel. Branch above , actually is not required to be checked out . It’s default branch of “git clone”. Difference in meantime is “acpi” branch not merged yet to xen/stable. However, APIC rework has been committed for 2.6.32.9.

# make menuconfig
# make
# make modules_install install
# mkinitramfs -o /boot/initrd-2.6.32.9.img 2.6.32.9




With the most recent 2.6.32.9 i was able to enable DRM for Radeon and get positive dmesg report on F12 and Ubuntu Karmic Koala Server.





To test 2.6.31.12 xenified aka Suse kernel setup Xen 3.4.3 on to top of Ubuntu Karmic Server. First – install on Ubuntu Karmic Server all packages required for Xen build along with Ubuntu-Desktop ( via tasksel). Of course, Xen Host doesn’t require GUI. Install Ubuntu-Desktop just make work comfortable and faster.

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 – build Xen from source

# 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 =
# make install-xen
# make install-tools
# make install-stubdom

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. Same thing happens when building Xen Unstable on Ubuntu 9.10 Server.
Add entry to /boot/grub/grab.cfg:-

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

and rebooted into xen host.Tested OSOL 133 PV DomU,F12 PV DomU, Ubuntu Kamic HVM and PV DomUs sharing same image device.



References
1.Gentoo-xen-kernel
2.2.6.31 dom0 Xen patches

8 Responses to Set up Xen 3.4.3 Dom0 via xenified 2.6.31.12 kernel on top of Ubuntu 9.10 Server

  1. i was searching on yahoo and found your site, you have great information and very nice site.

  2. Nikolay says:

    I am from Russia. Now I help to translate interesting articles and short
    messages about Linux / Unix and Open Source and to publish it’s russian
    translation on site http://rus-linux.net/ “Russian virtual Library on Linux”. I
    add links to original articles, sites, and authors. Could I translate and
    republish message and articles from your site? With links to you, and to each
    your article.

  3. dbaxps says:

    У меня к Вам несколько вопросов
    Позвоните мне домой 863-267-52-87 (Skype is installed)
    См. также :-

    Set up Xen 3.4.3 Dom0 via xenified 2.6.31.12 kernel on top of Ubuntu 9.10 Server
    http://www.linuxtoday.com/high_performance/2010031502335OSSV

  4. hlavacek says:

    Hello,
    I try to install xen on fedora11 or ubuntu9.10 but both without any success 😦 I think the problem is in nvidia drivers.
    I download linux kernel linux-2.6.31.12 and patch it,make it, make xen hypervisor, add grub entry just like this is written on this website and when i reboot to xen kernel – its writing that it is installing nvidia driver and then boot in console. Then I want to start X and nothing happend, just black screen. The same problem as in fedora 11.

    At the top of this article you have written, that thist patch also include nvidia drivers, so is there right?

    Where could be problem?

    I am very desperate 😦 Could you help please?

    Sorry for my english.

  5. GigaTux says:

    Great page – thank you for the detailed patching instructions. I can’t wait for the day that dom0 is fully in the kernel mainline!

  6. dbaxps says:

    It’s xen patches forward porting, what would never merge mainline linux. Jeremy Fitzharding patches – pvops kernel line could merge mainline linux. But it’s principally different technique pushing forward by Citrix.inc.

  7. dave says:

    Your blog has been extremely helpful in my ventures with xen and ubuntu so far. I’m finding many resources on the net however are quickly obsolete when it comes to instructions, the source code for all the involved projects is constantly evolving. I’d really like to get your take on vga passthrough with xen. It’s been incredibly difficult to get it all working right together.

    Thanks for the great tuts, hope you stay with it. The geek community at large needs people like you that share.

  8. Wonderful beat ! I would like to apprentice
    even as you amend your website, how could i subscribe
    for a blog website? The account helped me a applicable deal.
    I were tiny bit acquainted of this your broadcast offered
    brilliant clear idea

Leave a comment