Table of Contents

How To Use pv-grub on a VPS running CentOS 5

You first need to install the following packages as root using yum, below shows the command to do this.

yum install wget perl python python-devel python-setuptools gcc make patch

Next you need to install mercurial, you can do this using the command below

easy_install mercurial

In order for your VPS to boot you must build a kernel that already has Xen support and is new enough that pv-grub support is there. If you know your kernel already has support for both of these, you can skip this next step.

Xen Kernel Source (Optional)

Downloading the latest release from Xen will ensure this. Go to http://xenbits.xensource.com/ and look for the lastest kernel source. At this time it's linux-2.6.18-xen.hg and it's under the 3.3-testing.hg tree; this is what you need. Copy the link and use hg to download the source:

cd /usr/src
hg clone http://xenbits.xensource.com/linux-2.6.18-xen.hg
cd linux-2.6.18-xen.hg# cp buildconfigs/linux-defconfig_xenU_x86_32 .config 

You can now build your kernel as you normally would, Xen+PV-Grub require a few options, as long as you don't disable these you should be OK, the options required are below:

CONFIG_PARAVIRT_GUEST=y
CONFIG_XEN=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_CLOCK=y
CONFIG_XEN_BLKDEV_FRONTEND=y
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_HVC_XEN=y
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y

Another option is to use our config as a starting point, that way you know you have whats required and can add what you need. To go this route do the following inside the Linux source directory:

zcat /proc/config.gz > .config
make oldconfig
make menuconfig
make
make modules
make modules_install
make install

Setting Up Grub

You also need to setup Grub. Edit the menu.lst file which is located in /boot/grub/menu.lst. If it does not exist or that directory does not exist you need to create it and add the following lines. These lines will need to be modified to point to the correct kernel you just built:

default 0timeout 5title XenU kernel 2.6.xx-xxroot (hd0)kernel /boot/vmlinuz root=/dev/sda1 xencons=tty1initrd /boot/initrd.img

Last thing you need to do is go into the manager and edit your server profile, change the kernel to pv-grub-32, shutdown your VPS, and then start it back up. You will want to make sure you're connected to your console so you can make sure the kernel boots properly. If you need assistance doing this you can always contact us http://helpdesk.ndchost.com/