Xen Kernels

Xen Kernel Booting
---------------

In a default Cloudmin install, all Xen virtual systems are setup to boot from a kernel file on the host system, typically in the /xen directory and named like vmlinuz-vm2-xenU. However, you may want to use a kernel from within the virtual system instead - this allows different systems to run different kernels, and for the kernel to be upgraded from within the Xen instance.

Xen uses with PyGrub or Pv-Grub to run grub , which in turn reads the /boot/grub/menu.lst file from within the Xen system. The Grub config file contains the path the kernel and other related files, which is then booted when the system is started.

Cloudmin will configure a Xen system to use the newer Pv-Grub bootloader if available, and fall back to PyGrub otherwise. Pv-Grub is recommended as it runs entirely within the virtual system, while PyGrub runs on the host system and thus is considered less secure.

Booting a Xen System From its own Kernel
-----------------------------------

To create a new Xen virtual system that boots from its own kernel, you will first need a system image that contains a kernel and Grub configuration file. The latest CentOS and Debian images provided by Virtualmin include these - if you have already downloaded images for those distributions, make sure you have version 1.7 or later, and if not re-download them.

Once you have an image that includes a kernel, you can create a system that uses it as follows :

1. On the left menu, go to *Create System* -> *Create Xen instance*.
1. Fill in the form as you would normally, making sure to select an image that contains a kernel.
1. Under *Advanced options*, change the *Kernel for Xen instance* option to *Use kernel from Xen system*.
1. Click the *Create System* button.

If all goes well, you will see a line in the creation output like *setup to boot Xen system's kernel with PyGrub* .

If you are creating a system from using the API and want to use the virtual system's kernel, add the --xen-pygrub true command line flag, or xen-pygrub=true URL parameter.

Booting an In-System Kernel By Default
--------------------------------

If you want Cloudmin to always setup virtual systems to boot from their own kernels without having to select this at creation time, do the following :

1. Go to *Cloudmin Settings* -> *Module Config*.
1. Choose *Xen settings* from the menu.
1. Change the *Default Xen kernel source* to *From Xen system using PyGrub or Pv-Grub*.
1. Click *Save*.

This will also effect systems created using the API. You can force the host kernel to be used instead with the --xen-pygrub false command line flag.