Booting Xen with PV-Grub

Introduction

Ordinarily, Xen boots your VPS from kernels that reside on the host server. You don't need to have a kernel installed inside of your VPS. However, it is possible to install and boot from your own kernel, using the GRUB boot loader. There are many reasons why you would use PV-GRUB. For instance you may want to use a newer version of the Linux kernel than currently provided in the QCP.

You may use any PV OPS enabled Linux kernel, and many distributions offer these via their package managers.

Installing Grub inside your VPS

Your distributions package manager may be used to install Grub. Lilo is not compatible with Xen's pv-grub system.

To install grub on a Centos 5 VPS, type:

yum install grub -y

We may check the installation with:

rpm -qa | grep grub
grub-0.97-13.5

We are now ready to install the PV OPS enabled kernel that comes with Centos 5.

Installing a PV OPS enabled kernel inside your VPS

Installing the PV OPS kernel inside a Centos 5 VPS is done using Yum:

yum install kernel-xen -y

You will now see the xen kernel under /boot.

Grub must now be configured to load the kernel on boot.

Configuring Grub to boot the PV OPS kernel

We need to edit /boot/grub/grub.conf, and add an entry for the new kernel.
The QCP is looking for /boot/grub/grub.conf in that location on your VM's drive, so you may need to symlink to it to match your distributions way of setting up grub. I.e you may not even have the directory /boot/grub, and it will need to be created.

#Xen 3.4.x PV-Grub kernel
default=0
timeout=10
title vmlinuz-2.6.18-194.3.1.el5xen
root (hd0)
kernel /boot/vmlinuz-2.6.18-194.3.1.el5xen console=xvc0 root=/dev/xvda1 ro
initrd /boot/initrd-2.6.18-194.3.1.el5xen.img

Selecting the pv-grub kernel in the QCP

The final step is to login to the QCP and select "pv-grub-x86_32.gz" on the Distros page, under kernel select.

Now halt then boot your VPS. When you login, check to see what kernel you booted under:

Linux vps 2.6.18-194.3.1.el5xen #1 SMP Thu May 13 14:27:32 EDT 2010 i686 i686 i386 GNU/Linux

You even get a GRUB boot screen on your Xen console!


    GNU GRUB  version 0.97  (393216K lower / 0K upper memory)

 +-------------------------------------------------------------------------+
 | vmlinuz-2.6.18-194.3.1.el5xen                                           |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 |                                                                         |
 +-------------------------------------------------------------------------+
    Use the ^ and v keys to select which entry is highlighted.
    Press enter to boot the selected OS, 'e' to edit the
    commands before booting, or 'c' for a command-line.


    The highlighted entry will be booted automatically in 7 seconds.

 
About Us   Contact Us    Terms of Service     Privacy Policy  
 © Quantact Hosting Solutions, Inc. 2010