Version 9 (modified by price, 16 years ago) (diff)

more context

Xen supports two different types of virtualization: Hardware-supported virtualization (HVM) and paravirtualization (ParaVM).

XVM VMs installed from a boot CD are HVMs. HVMs virtualize a full machine, down to the metal. They use special processor capabilities to do this. This allows you to run an unmodified operating system. For example, this is the only way to run Windows under Xen. However, I/O performance suffers as a result of this virtualization approach.

ParaVMs on the other hand, modify the guest operating system to remove privileged operations, replacing them with calls to the Xen hypervisor. ParaVMs have significantly better performance, but require a modified kernel. Only a few operating systems have support for running as a paravirtualized Xen guest: Linux, NetBSD, OpenBSD, FreeBSD, and OpenSolaris being the most well known.

Because of the performance benefits, you should consider using a ParaVM if possible. The easy way to do this is to use the autoinstaller. If you have an HVM that you want to keep, you can convert it into a ParaVM with the steps below.

Converting a Linux Guest to ParaVM

These steps presume you have a working HVM machine and want to make it boot as a ParaVM. If you use the autoinstaller you can get a ParaVM from the beginning.

Installing the Necessary Packages

The following packages need to be installed on a Debian guest to get a Xen-capable kernel:

  • linux-image-xen-amd64
  • linux-headers-xen

On an Ubuntu system, install the following packages:

  • linux-image-xen
  • linux-headers-xen

Fix Grub

By default, the update-grub script which generates the /boot/grub/menu.lst file will not add Xen kernels when not currently booted as a Xen guest. In order to change this behavior, edit /usr/sbin/update-grub and apply the following patch:

--- update-grub.orig    2008-04-25 16:16:15.000000000 -0400
+++ update-grub 2008-04-25 16:16:43.000000000 -0400
@@ -778,10 +778,12 @@
        if [ ! "$in_domU" ] && [ "$is_xen" ]; then
          # skip xen kernels
-          continue
+          # continue
+         :
         elif [ "$in_domU" ] && ! [ "$is_xen" ]; then
          # skip non-xen kernels
-         continue
+         # continue
+         :

Then, run /usr/bin/update-grub again.

Enable the Serial Console

ParaVMs currently don't have access to the VNC console; the VM has to be accessed through the SerialConsole. Configure it before rebooting, or it won't be possible to access the VM.

Note that the serial console for ParaVMs is /dev/xvc0, not /dev/ttyS0, so you may have to adjust your configuration files.

Change the Database Setting

Once you've completed all of these steps, you should be able to shutdown your VM, change the radio button on the VM's info page at, and then reboot the machine.