gdt: Kangaroo road sign (Default)
[personal profile] gdt

KVM is a nice virtualisation program. Unlike the basic Qemu it only works on CPUs with virtualisation instructions. Installation used to be a nightmare, but it's now not bad at all.

# yum install qemu-img kvm

Edit /etc/modprobe.conf, adding:

alias /dev/kvm kvm-intel

or kvm-amd, depeding on what is under the hood.

# depmod

Using a disk image we prepared earlier:

# qemu-kvm -hda disk.cow -m 512

Performance of Qemu for boot and shutdown of CentOS 5. Without KVM:

real	2m58.120s
user	2m31.290s
sys	0m4.094s

With KVM:

real     1m8.837s
user    0m27.603s
sys     0m18.641s

As well as the greater elapsed time, look at the proportion of user+sys to real. Qemu alone occupied a CPU for 87% of the time. Qemu with KVM occupied a CPU for 66% of the time. So KVM is about a third more efficient than Qemu alone when both are under high load. This can certainly be felt when using the machines for other tasks as well as running the virtual machine.

KVM is cheap and simple virtualisation, as basic as a Volkswagen Beetle. The sort of thing that's useful when you want to run up a machine to do a test (eg, does my program work on an as-shipped installation) or to build a package for a foreign distribution.

VMWare is better in many ways. Simpler to use, more efficient. But installing VMWare on something other than the supported distributions and versions is a ongoing nightmare of tracking what the kernel folk have changed this week. KVM is in the kernel.org kernel, so that sort of breakage isn't going to happen.

Profile

gdt: Kangaroo road sign (Default)
Glen Turner

September 2021

S M T W T F S
   1234
567891011
121314151617 18
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2026-01-24 09:19
Powered by Dreamwidth Studios