Sunday, August 30, 2009

Loading Xen via GRUB2 on top Ubuntu Karmic Server

Update file /etc/default/grub as follows

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
# Uncomment to disable graphical terminal (grub-pc only)
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
# Uncomment to disable generation of recovery mode menu entrys

Update /etc/grub.d/40_cutom as follows

exec tail -n +3 $0
# This file is an example on how to add custom entries
menuentry "Xen 3.4 / Ubuntu 9.10 kernel" {
insmod ext2
set root=(hd0,13)
multiboot (hd0,13)/xen-3.4.gz
module (hd0,13)/vmlinuz-
module (hd0,13)/initrd-

Then run
# update-grub
To generate grub.cfg entry for loading Xen Host.

I've tested and 2.6.30 xenified aka Suse kernels been
built with static cmd string per Christian Tramnitz

Setting CONFIG_CMDLINE_BOOL=y in .config allows to assign desired value via make menuconfig:

Symbol: CMDLINE [=root=/dev/sda14 ro console=tty0]
Prompt: Built-in kernel command string
Defined at arch/x86/Kconfig:1644
Depends on: CMDLINE_BOOL
-> Processor type and features
-> Built-in kernel command line (CMDLINE_BOOL [=y])

The rest is supposed to be tuned exactly as in [1]
When building Xen 3.4.1 from source installed

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

Then set

# cd /usr/src
# tar zvxf xen-3.4.1.tar.gz
# cd xen-3.4.1
Set in
PYTHON = python

and build

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

Tuning 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 F11 ). Thus you won’t be able to start xend in Dom0.

1.Building Xen 3.4.1 Dom0 via xenified kernel on top Ubuntu 9.04 Server