The news of KVM’s inclusion in the Linux kernel has me looking at KVM.
How the virtualization layer is implemented has important ramifications, and KVM is much different from Xen.
Xen itself sits directly on the hardware and treats even your old OS as a guest VM — for Xen, the Linux patches are necessary to make Linux a guest VM on the hypervisor. It implements a model known as paravirtualization that provides a lot of performance improvements over other recent x86 virtualization techniques such as VMware’s. This model includes a service VM that does privileged I/O work on behalf of the guests. (In a following entry I discuss some performance and efficiency issues, the larger story is not so simple as “paravirtualization makes everything very fast”)
Xen can also support unmodified guest VMs if you are using either a VT capable Intel processor or an SVM capable AMD processor.
KVM is a patch to the Linux kernel that is more like VServer, Solaris containers, or microkernels [see footnote], where the OS still sits directly on the hardware. Some aspects of the current KVM release (mostly pulled from their FAQ):
- KVM guest OSs appear as a process and can be managed with top, kill, etc.
- KVM requires either a VT capable Intel processor or an SVM capable AMD processor (which is a currently a big limitation for grid providers but this will become less and less of an issue as older clusters are phased out).
- Uses QEMU for guest instantiation, but is not an emulator itself
- Runs Windows 32bit already (with no apci)
- I have yet to figure out if it relies on these kernel enhancements for OS level virtualization
- The current implementation should probably be seen as a preview, Fraser Campbell reports that it was “decidedly slow” when he tried it.
[footnote]: Some argue that microkernels and Xen have a lot in common.
[UPDATE: This article on some KVM details was posted. Its comments also have a lot of information.]

8 Responses to “Xen vs. KVM”
October 21st, 2007 at 12:47 pm
And we are forgetting something major here !
Xen is based on the bare metal and has
no processor “emulation capabilities” whereas
in a single processor machine, qemu can
emulate a machine with say 4 processors !
October 21st, 2007 at 5:19 pm
that’s why it will never wor. Joey Hadassah.
October 31st, 2007 at 8:22 pm
You can configure a xen virtual machine to have as many processors as you like… at least within reasonable limits. It can be more or less than the number of physical cores.
October 31st, 2007 at 8:47 pm
The xen guest sees vcpus, these are scheduled individually onto the physical CPUs. If you have 10 times more vcpus than real ones you are going to see a lot of inefficiency but you can do it like tom b syays. You could do pathlogical tests on your concurrent code (in userspace or kernel space) — or maybe you only have a uniprocessor box and want to put concurrent code through some paces (though race conditions will not be so easily discovered because ultimately you’re still only running on a sequential uniprocessor).
That seems to me to be the only reason to emulate more processors. Bhasker C V, I don’t know why this is “something major”?
February 21st, 2008 at 9:19 pm
Working around a slow Windows virtual machine due to ACPI
Did you try this?
http://kvm.qumranet.com/kvmwiki/Windows_ACPI_Workaround
If your Windows installation is set to use ACPI (this is the default), kvm can be quite slow or not work at all. This is due to Windows heavily using a register that has a very large virtualization penalty.
Fortunately, there is a simple workaround available: disable ACPI support in Windows. The procedure for doing this is:
Select “My Computer” with the right mouse button.
Select “Properties”.
Choose the “Hardware” tab.
Click the “Device Manager” button.
Select the entry under “Computer” with the right mouse button. If it says “Standard PC”, then there’s no need to do anything.
Select “Properties”
Click the “Update Driver” button.
Choose “No, not this time” and click “Next”.
Choose “Install from a list” and click “Next”.
Choose “Don’t search” and click “Next”.
Click “Next”.
Choose “Standard PC” and click “Next”.
Continue clicking “Next” and reboot the virtual machine.
If you’re installing Windows XP/2000, you can get it to use the Standard PC HAL by pressing F7 when it asks for drivers (”Press F6 for…”), there is no visual indication. If you would rather select the right HAL from a list visually then press F5 instead.
March 28th, 2008 at 7:30 am
my head reels. cant quite figure out which virtualization path to take for my little home office.
I am doing no business now a days other than figuring out virtualization and suffering the effects. :)
March 29th, 2008 at 6:28 pm
VMware player/server is a convenient way to go for home setups, IMO. Differences in performance/features is not really applicable there, may as well go with something easy to use and that has a lot of pre-made VMs, templates, etc.
April 29th, 2008 at 11:12 am
I tried KVM under Ubuntu Hardy and ran into a number of problems with the graphical interface to configure the machine, lacking many command line options, most notably the one to disable acpi.
Once I configured the machine via command line on a VT enabled AMD with one processor, Windows definitely performed very well, notably better than Virtualbox. Since I only defined one VCPU it was certainly much, much slower than then native machine. When I installed with 2 VCPUs the machine crawled, similar to an initial acpi installation I had done which took somewhere in the neighborhood of 12 hours.
I used an sdl display configuration which performed reasonably well, obviously lacked 3d support of any kind (the OpenGL support floating around is more or less of a ummh, joke, considering it does not support shaders) and maxed out at 1280×1024 at 16 bit. Virtualbox will pretty much do whatever you ask it to.
Thus, once again, I went native Windows for my heavily multithreaded Adobe A/V applications, with no Linux equivalent.
I fail to see any truly feasible Desktop virtualization solution at this point. As for server virtualization, I would consider KVM ready for prime time if you don’t need multiprocessors per machine.