Using Custom Kernels
Zerigo Servers use a host-supplied kernel by default. Most of the time this is sufficient. However, we also provide you with the option to use your own kernel if you desire.
Installing a custom kernel is an advanced operation. If all the steps are not performed right, your server may no longer boot. Consider taking a snapshot (especially for servers with under 5-10GB of disk used) or using a temporary test server.
There are just a few steps to get things setup. Please read this entire document before starting anything. There are a number of notes and caveats for some distributions.
1. Install a Kernel
Install a Xen compatible kernel on your server. This may be a distribution-provided kernel, a self-compiled kernel, or kernel from somewhere else. The only requirement is that it must have support for Xen compiled in (a pv-ops compatible kernel or an older Xenified kernel).
CentOS and Fedora both require that the following be run (as root or via sudo) before installing the kernel (technically before mkinitrd is run):
cat <<TXT >> /etc/modprobe.conf
alias eth0 xennet
alias scsi_hostadapter xenblk
TXT
We have successfully tested the following distribution-supplied kernels:
| Distribution | Package | Tested versions |
|---|---|---|
| CentOS 5.5 32bit | kernel-xen.i686 | 2.6.18-194.26.1.el5 |
| CentOS 5.5 64bit | kernel-xen.×86_64 | 2.6.18-194.26.1.el5 |
| Debian 5.0 32bit | linux-image-xen-686 | 2.6.26+17+lenny1 (2.6.26-25lenny1) |
| Debian 5.0 64bit | linux-image-xen-amd64 | 2.6.26+17+lenny1 (2.6.26-25lenny1) |
| Debian 6.0 32bit | linux-image-xen-686 | 2.6.32+28 (2.6.32-27) |
| Debian 6.0 64bit | linux-image-xen-amd64 | 2.6.32+28 (2.6.32-27) |
| Fedora 14 64bit | kernel-PAE.i686 | 2.6.35.6-48.fc14 |
| Fedora 14 64bit | kernel.×86_64 | 2.6.35.6-48.fc14 |
| Ubuntu 10.04 32bit | linux-generic-pae | 2.6.32.25.27 |
| Ubuntu 10.04 64bit | linux-server | 2.6.32.25.27 |
| Ubuntu 10.10 32bit | linux-virtual | 2.6.35.23.25 (2.6.35-23.41) |
| Ubuntu 10.10 64bit | linux-virtual | 2.6.35.23.25 (2.6.35-23.41) |
Kernels for 32bit servers must have PAE enabled.
2. Configure Virtual Grub
Zerigo’s Virtual Grub bootloader is compatible with Grub version 1 (v0.97) configuration files. Do not install Grub on your server. Instead, simply create a basic Grub configuration file in /boot/grub/menu.lst (running mkdir -p /boot/grub may be necessary first). An example menu.lst:
timeout 10
default 0
title Linux 2.6.32
root (hd1)
kernel /boot/vmlinuz-2.6.32-5-xen-amd64 root=/dev/xvda2 ro
initrd /boot/initrd.img-2.6.32-5-xen-amd64
Ensure that the specific kernel and initrd files match what’s actually on your filesystem—the above example probably doesn’t match exactly.
It is also important to ensure that Grub knows which virtual disk holds your root partition. You can verify this in our control panel under Configuration → Virtual Hardware. Be sure to update both the ‘kernel’ line (line 5 above) and the ‘root’ line (line 4 above).
| Kernel: root= | Kernel: root= for Ubuntu 10.10 |
Grub: root |
|---|---|---|
| /dev/xvda1 | /dev/sda1 | (hd0) |
| /dev/xvda2 | /dev/sda2 | (hd1) |
If your kernel or distribution doesn’t use initrd (initramfs) images, then leave that line out.
Fedora Notes
Standard Fedora kernels also require that selinux=0 be appended to the kernel ... line in menu.lst.
Ubuntu 10.10 Notes
Standard Ubuntu 10.10 kernels use sdaX instead of xvdaX for the names of the virtual disks. This must be reflected on the kernel ... line in menu.lst and must also in /etc/fstab.
3. Enable Virtual Grub
Once your server is ready to go, change the selected kernel for your server under Configuration → Kernel. Select the Virtual Grub option that matches your kernel architecture (32bit or 64 bit).
Note for CentOS: If your current CentOS kernel is 2.6.26 or greater, contact support to be moved to a Zerigo supplied 2.6.18 kernel first. Then you will be able to select the version of Virtual Grub compatible with 2.6.18 kernels.
Your server will reboot when the kernel setting is changed. If everything has gone right, you should be up and running on your new kernel!
Hint: Remember to update /boot/grub/menu.lst any time you upgrade your kernel.
