Using pyGRUB on Squeeze to boot a domU kernel

Using pyGRUB from xen-utils-4.0, each domU can boot with its own kernel instead of using the dom0 kernel, which makes life easier for updates and multi distribution Xen installs. You need to have first a working domU. The domU FileSystem needs to be ext3.

On the dom0

Config snippet:

root        = '/dev/xvda2 ro'
disk        = [
                  'phy:/dev/vg05/test2.openforce.com-disk,xvda2,w',
                  'phy:/dev/vg05/test2.openforce.com-swap,xvda1,w',
              ]

On the domU

mkdir /boot/grub
apt-get install linux-image-2.6-xen-amd64

You don't need to install grub, you need to create a simple grub file which will be read by pygrub on the Dom0.

cat > /boot/grub/menu.lst

default         0
timeout         2

title           Debian GNU/Linux 6.0
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda2 ro 
initrd          /boot/initrd.img-2.6.32-5-xen-amd64

title           Debian GNU/Linux 6.0 (Single-User)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda2 ro single
initrd          /boot/initrd.img-2.6.32-5-xen-amd64

On the dom0

/usr/lib/xen-default/bin/pygrub /dev/vg02/my_domU-disk

which should great with the familiar grub menu, and then abort

bootloader      = '/usr/lib/xen-default/bin/pygrub'