Linode Library Home
Categories
Getting Started
Beginner's Guide
Using Linux
Linode Manager
Networking
LAMP Guides
LEMP Guides
Web Servers
Web Applications
Email Guides
High Availability
SSL Guides
Databases
Server Monitoring
Development
Communications
Advanced
Troubleshooting
How to Contribute
Sitemap
Linode Library RSS Feed
Linode Library Home :: Advanced Linode Guides :: Run a Distribution-Supplied Kernel with PV-GRUB
Print View Download PDF Download RST

Run a Distribution-Supplied Kernel with PV-GRUB

Author: Phil ParadisExternal Link
Published: September 9, 2009
Revised: July 15, 2010

PV-GRUB makes it possible to run your own kernel on your Linode, instead of using a host-supplied kernel. This is useful in cases where you'd like to enable specific kernel features, or for cases where you'd prefer handling kernel upgrades directly.

This guide assumes you have already followed the steps outlined in our getting started guide, and that your Linode is in a functional state. These steps should be performed as root on your Linode via an SSH session.

If you'd like to run a custom distro on your Linode in combination with PV-GRUB, please follow our custom distro guide before taking these steps.

These instructions work with the Linode platform. If you don't have a Linode yet, sign up for a Linux VPS and get started today.

Ubuntu 10.04 LTS (Lucid) Link

Before proceeding, make sure your package repositories and installed packages are up to date by issuing the following commands:

apt-get update
apt-get upgrade --show-upgraded

Issue the following commands to install the default kernel for Ubuntu 10.04 LTS and create a directory for your menu.lst file:

apt-get install linux-virtual
mkdir /boot/grub

Create a file named /boot/grub/menu.lst with the following contents. Adjust the "title", "kernel", and "initrd" lines to reflect the actual filenames found in the /boot directory.

File: /boot/grub/menu.lst

timeout 5

title           Ubuntu 10.04 LTS, kernel 2.6.32-23-generic-pae
root            (hd0)
kernel          /boot/vmlinuz-2.6.32-23-generic-pae root=/dev/xvda console=hvc0 ro quiet
initrd          /boot/initrd.img-2.6.32-23-generic-pae

In the Linode Manager, edit your Linode's configuration profile to use either pv-grub-x86_32 or pv-grub-x86_64 as the "Kernel", depending on the version of Ubuntu you have deployed (32-bit or 64-bit). Make sure the root device is specified as xvda. Save your changes by clicking "Save Profile" at the bottom of the page, and reboot your Linode from the "Dashboard" tab.

Once your Linode has rebooted, log back into it and issue the command "uname -a". You should see output similar to the following, indicating you're running the native kernel:

Linux li175-165 2.6.32-23-generic-pae #37-Ubuntu SMP Fri Jun 11 09:26:55 UTC 2010 i686 GNU/Linux

Note that if you install an updated kernel, you'll need to add an entry for it to your menu.lst file. By default, the first kernel in the list will be booted.

Debian 5 (Lenny) Link

Before proceeding, make sure your package repositories and installed packages are up to date by issuing the following commands:

apt-get update
apt-get upgrade --show-upgraded

Issue the following commands to install the default kernel for Debian 5 (Lenny) and create a directory for your menu.lst file.

32-bit Debian:

apt-get install linux-image-xen-686
mkdir /boot/grub

64-bit Debian:

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

Create a file named /boot/grub/menu.lst with the following contents. Adjust the "title", "kernel", and "initrd" lines to reflect the actual filenames found in the /boot directory.

File: /boot/grub/menu.lst

timeout 5

title           Debian GNU/Linux, kernel 2.6.26-2-xen-686
root            (hd0)
kernel          /boot/vmlinuz-2.6.26-2-xen-686 root=/dev/xvda ro quiet
initrd          /boot/initrd.img-2.6.26-2-xen-686

In the Linode Manager, edit your Linode's configuration profile to use either pv-grub-x86_32 or pv-grub-x86_64 as the "Kernel", depending on the version of Debian you have deployed (32-bit or 64-bit). Make sure the root device is specified as xvda. Save your changes by clicking "Save Profile" at the bottom of the page, and reboot your Linode from the "Dashboard" tab.

Once your Linode has rebooted, log back into it and issue the command "uname -a". You should see output similar to the following, indicating you're running the native kernel:

Linux li175-165 2.6.26-2-xen-686 #1 SMP Mon Jun 21 10:37:05 UTC 2010 i686 GNU/Linux

Note that if you install an updated kernel, you'll need to add an entry for it to your menu.lst file. By default, the first kernel in the list will be booted.

Fedora 13 Link

Before proceeding, make sure your package repositories and installed packages are up to date by issuing the following command:

yum update

Issue the following commands to install the default kernel for Fedora 13:

32-bit Fedora:

yum install kernel-PAE.i686

64-bit Fedora:

yum install kernel.x86_64

Create a file named /boot/grub/menu.lst with the following contents. Adjust the "title", "kernel", and "initrd" lines to reflect the actual filenames found in the /boot/ directory.

File: /boot/grub/menu.lst

timeout 5

title           Fedora 13, kernel 2.6.33.6-147.fc13.i686.PAE
root            (hd0)
kernel          /boot/vmlinuz-2.6.33.6-147.fc13.i686.PAE root=/dev/xvda ro quiet
initrd          /boot/initramfs-2.6.33.6-147.fc13.i686.PAE.img

In the Linode Manager, edit your Linode's configuration profile to use either pv-grub-x86_32 or pv-grub-x86_64 as the "Kernel", depending on the version of Fedora you have deployed (32-bit or 64-bit). Make sure the root device is specified as xvda. Save your changes by clicking "Save Profile" at the bottom of the page, and reboot your Linode from the "Dashboard" tab.

Once your Linode has rebooted, log back into it and issue the command "uname -a". You should see output similar to the following, indicating you're running the native kernel:

Linux li175-165 2.6.33.6-147.fc13.i686.PAE #1 SMP Tue Jul 6 22:24:44 UTC 2010 i686 i686 i386 GNU/Linux

Note that if you install an updated kernel, you'll need to add an entry for it to your menu.lst file. By default, the first kernel in the list will be booted.

License Link

This guide is licensed under a Creative Commons Attribution-No Derivative Works 3.0 United States LicenseExternal Link. Please feel free to redistribute unmodified copies of it as long as attribution is provided, preferably via a link to this page.

Comments

Comment poster gravatar. Submitted by Ryan Tucker on Sunday, December 6 2009 at 20:40:33 GMT

On Ubuntu 9.10 (Karmic), the indomU=false setting is still a good idea -- it didn't need it the first time, but somehow, running update-grub on subsequent boots ignored the "non-Xen" kernel. I suppose it's an improvement... :-)

Also, while 9.04 (Jaunty) worked with the linux-image-server meta kernel, this now points at the linux-image-generic-pae meta kernel. That one doesn't want to boot under PV-GRUB. I did, however, boot linux-image-ec2 with no problem:

Code:
Linux warewolves 2.6.31-302-ec2 #7-Ubuntu SMP Tue Oct 13 19:06:04 UTC 2009 i686 GNU/Linux

Comment poster gravatar. Submitted by Cliff Cunnington on Thursday, August 26 2010 at 21:15:07 GMT

Hi,

Information about CentOS-5.X under this topic might be useful for others. I've appended my notes below for that purpose.

Regards,
Cliff
---

CentOS/5.X - not supported

The stock kernel-xen package doesn't work with Linode's pv_grub - the kernels do not include the CONFIG_PARAVIRT and other options required by the Linode environment (see: CentOS Bug 3372).

(The post-2.6.18 kernel in the forthcoming CentOS/6.X release is expected to work under the Linode/pv_grub setup.)

Note: While under CentOS/5.X it is possible to set up /boot/grub/menu.lst and the rest (adapted from the Fedora instructions above) the initrd fails with these errors:

Quote:
Red Hat nash version 5.1.19.6 starting
mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!

Got a comment?

BBCode formatting is allowed. Email addresses are confidential, and are only used for gravatars and sending document/comment updates if requested. Please refer to our privacy policy. All comments are moderated and may take some time to appear on this page.