Product SiteDocumentation Site

17.2. Changing between the KVM and Xen hypervisors

This section covers changing between the KVM and Xen hypervisors.
Fedora only supports one active hypervisor at a time.

Migrating virtualized guests between hypervisors

Presently, there is no application for switching Xen-based guests to KVM or KVM-based guests to Xen. Guests can only be used on the hypervisor type that they were created on.

17.2.1. Xen to KVM

The following procedure covers changing from the Xen hypervisor to the KVM hypervisor. This procedure assumes the kernel-xen package is installed and enabled.
  1. Install the KVM package

    Install the kvm package if you have not already done so.
    # yum install kvm
    
  2. Verify which kernel is in use

    The kernel-xen package may be installed. Use the uname command to determine which kernel is running:
    $ uname -r
    2.6.23.14-107.fc8xen
    
    The "2.6.23.14-107.fc8xen" kernel is running on the system. If the default kernel, "2.6.23.14-107.fc8", is running you can skip the substep.
    1. Changing the Xen kernel to the default kernel

      The grub.conf file determines which kernel is booted. To change the default kernel edit the /boot/grub/grub.conf file as shown below.
      default=1
      timeout=5
      splashimage=(hd0,0)/grub/splash.xpm.gz
      hiddenmenu
      title Fedora (2.6.23.14-107.fc8)
              root (hd0,0)
              kernel /vmlinuz-2.6.23.14-107.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
              initrd /initrd-2.6.23.14-107.fc8.img
      title Fedora (2.6.23.14-107.fc8xen)
              root (hd0,0)
              kernel /xen.gz-2.6.23.14-107.fc8
              module /vmlinuz-2.6.23.14-107.fc8xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
              module /initrd-2.6.23.14-107.fc8xen.img
      
      Notice the default=1 parameter. This is instructing the GRUB boot loader to boot the second entry, the Xen kernel. Change the default to 0 (or the number for the default kernel):
      default=0
      timeout=5
      splashimage=(hd0,0)/grub/splash.xpm.gz
      hiddenmenu
      title Fedora (2.6.23.14-107.fc8)
              root (hd0,0)
              kernel /vmlinuz-2.6.23.14-107.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
              initrd /initrd-2.6.23.14-107.fc8.img
      title Fedora (2.6.23.14-107.fc8xen)
              root (hd0,0)
              kernel /xen.gz-2.6.23.14-107.fc8
              module /vmlinuz-2.6.23.14-107.fc8xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
              module /initrd-2.6.23.14-107.fc8xen.img
      
  3. Reboot to load the new kernel

    Reboot the system. The computer will restart with the default kernel. The KVM module should be automatically loaded with the kernel. Verify KVM is running:
    $ lsmod | grep kvm
    kvm_intel              85992  1 
    kvm                   222368  2 ksm,kvm_intel
    
    The kvm module and either the kvm_intel module or the kvm_amd module are present if everything worked.