We regularly receive requests from customers who want to boot their own kernel. The reason they want to do this often has to do with specialised modules they require, such as for VOIP services or disk partitions encrypted with FUSE. These customers can use PyGrub to load a Xen-compatible kernel within the VPS itself, in addition to our standard kernel. You must first activate this option within the XLS Interface.
What exactly is PyGrub?
PyGrub is a Python implementation of the grub bootloader, designed for booting virtual machines under Xen. It reads the grub configuration and uses it to select a kernel and a RAM-disk image to boot from, which it then passes on to the Xen hypervisor.
Installing your own kernel
In order to successfully boot via PyGrub, the following must be present on the VPS:
- A valid grub config in /boot/grub/menu.lst
- A Xen domU-compatible kernel
- An initrd with xenblk.ko and xennet.ko
To ensure that the xenblk and xennet drivers are loaded properly, it is a good idea to add the following two lines to /etc/modprobe.conf before installing the kernel package:
alias eth0 xennet
alias scsi_hostadapter xenblk
Then install grub, and finally the xen kernel. Under CentOS you do this as follows:
# yum install grub
# yum install kernel-xen
And under Debian:
# apt-get install grub
# apt-get install linux-image-xen-amd64
Make sure a valid /boot/grub/menu.lst has been created that points to the Xen kernel. Then switch the button in the XLS Interface to 'Custom Kernel' and shut down the VPS from the command line (a regular reboot is insufficient). The machine will then be restarted with PyGrub.