Using pygrub to boot a domU kernel
Using pygrub, each domU can boot with its own kernel instead of using the dom0 kernel, which lifes easier for updates and multi distribution xen installs. You need to have first a working domU.
On the domU
- Install the xen kernel and grub
aptitude install linux-image-2.6-xen-amd64 grub
- Create the environment needed for running update-grub
mkdir /boot/grub echo "(hd0) /dev/sda" > /boot/grub/device.map mknod /dev/sda b 202 0
- Create first /boot/grub/menu.lst based on the content of /boot
update-grub
Check the default grub root matches the partition where /boot/grub lives. If /boot/grub is on /dev/sda2, you need to have # groot=(hd0,1) in your /boot/grub/menu.lst.
After editing this file, you need to re-run update-grub to propagate the changes.
sed -i -e 's/^# groot=(hd0)/# groot=(hd0,1)/' \ /boot/grub/menu.lst update-grub
On the dom0
- Replace the kernel and ramdisk parameters in the domU config file with
bootloader = '/usr/lib/xen-3.2-1/bin/pygrub'
If you get Error: Boot loader didn't return any data! you need to have the system partition as the first partition comming in your domU.cfg something akin to
disk = [
'phy:/dev/vg02/sandbox.openforce.com-disk,sda2,w',
'phy:/dev/vg02/sandbox.openforce.com-swap,sda1,w',
]