33.2. Changing between the KVM and Xen hypervisors
Important
Warning
33.2.1. Xen to KVM
Install the KVM package
Install the kvm package if you have not already done so.# yum install kvm
Verify which kernel is in use
The kernel-xen package may be installed. Use theunamecommand to determine which kernel is running:$ uname -r 2.6.18-159.el5xen
The present kernel, "2.6.18-159.el5xen", is running on the system. If the default kernel, "2.6.18-159.el5", is running you can skip the substep.Changing the Xen kernel to the default kernel
Thegrub.conffile determines which kernel is booted. To change the default kernel edit the/boot/grub/grub.conffile as shown below.default=1 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-159.el5) root (hd0,0) kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.18-159.el5.img title Red Hat Enterprise Linux Server (2.6.18-159.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-159.el5 module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.18-159.el5xen.imgNotice the default=1 parameter. This is instructing the GRUB boot loader to boot the second entry, the Xen kernel. Change the default to0(or the number for the default kernel):default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-159.el5) root (hd0,0) kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.18-159.el5.img title Red Hat Enterprise Linux Server (2.6.18-159.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-159.el5 module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.18-159.el5xen.img
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
Thekvmmodule and either thekvm_intelmodule or thekvm_amdmodule are present if everything worked.
33.2.2. KVM to Xen
Install the Xen packages
Install the kernel-xen and xen package if you have not already done so.# yum install kernel-xen xen
The kernel-xen package may be installed but disabled.Verify which kernel is in use
Use theunamecommand to determine which kernel is running.$ uname -r 2.6.18-159.el5
The present kernel, "2.6.18-159.el5", is running on the system. This is the default kernel. If the kernel hasxenon the end (for example,2.6.18-159.el5xen) then the Xen kernel is running and you can skip the substep.Changing the default kernel to the Xen kernel
Thegrub.conffile determines which kernel is booted. To change the default kernel edit the/boot/grub/grub.conffile as shown below.default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-159.el5) root (hd0,0) kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.18-159.el5.img title Red Hat Enterprise Linux Server (2.6.18-159.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-159.el5 module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.18-159.el5xen.imgNotice the default=0 parameter. This is instructing the GRUB boot loader to boot the first entry, the default kernel. Change the default to1(or the number for the Xen kernel):default=1 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-159.el5) root (hd0,0) kernel /vmlinuz-2.6.18-159.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.18-159.el5.img title Red Hat Enterprise Linux Server (2.6.18-159.el5xen) root (hd0,0) kernel /xen.gz-2.6.18-159.el5 module /vmlinuz-2.6.18-159.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet module /initrd-2.6.18-159.el5xen.img
Reboot to load the new kernel
Reboot the system. The computer will restart with the Xen kernel. Verify with theunamecommand:$ uname -r 2.6.18-159.el5xen
If the output hasxenon the end the Xen kernel is running.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.