The upcoming 2.6.20 Linux kernel is bringing a virtualization framework for all virtualization fans out there. It’s called KVM, short for Kernel-based Virtual Machine. Not only is it user-friendly, but also of high performance and very stable, even though it’s not yet officialy released. This article tries to explain how it all works, in theory and practice, together with some simple benchmarks.
From the KVM FAQ: You will need an x86 machine running a recent Linux kernel on an Intel processor with VT (virtualization technology) extensions, or an AMD processor with SVM extensions (also called AMD-V).
KVM is hardware virtualization and relies on hardware to make it happen.
//KVM is hardware virtualization and relies on hardware to make it happen.//
Understood.
This fact then determines my choice for the next hardware I might buy.
It must be (1) an Intel processor with VT (virtualization technology) extensions, or an AMD processor with SVM extensions (also called AMD-V), and (2) not Vista-ready or MCE or ViiV or anything like that.
Give it a few months and non-Vista hardware that meets these descriptions will be a steal on ebay.
Edited 2006-12-28 08:01
This fact then determines my choice for the next hardware I might buy.
At which CPU generation of each brand are these features introduced? Core 2 Duo/Athlon64 X2?
I think the Core Duo’s also had it, plus the Core 2 Duo’s. On AMD’s side it was (rev. F?) of the X2’s – the one that changed from DDR memory to DDR2 memory.
Edited 2006-12-28 12:12
//At which CPU generation of each brand are these features introduced? Core 2 Duo/Athlon64 X2?//
At first for AMD I thought it was the “next generation” Opteron.
http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_88…
But then I found this info:
http://en.wikipedia.org/wiki/Virtualization_Technology#AMD_virtuali…
“AMD virtualization (AMD-V)
AMD’s virtualization extension to the 64-bit x86 architecture is named AMD Virtualization (also known by the abbreviation AMD-V), and is sometimes referred to by the code name “Pacifica”.
AMD processors using Socket AM2, Socket S1, and Socket F include AMD Virtualization support. In May 2006, AMD introduced such versions of the Athlon 64 and Turion 64 processors. AMD Virtualization is also supported by release two (x2xx series) of the Opteron processors.”
… and for Intel, the story is:
http://en.wikipedia.org/wiki/Virtualization_Technology#Intel_VT_.28…
“Intel VT (IVT)
Intel’s virtualization extension for 32-bit and 64-bit x86 architecture is named IVT (short for Intel Virtualization Technology), and is sometimes referred to by the development code name “Vanderpool”. The 32-bit or IA-32 IVT extensions are referred to as VT-x [1]. Intel has also published specifications for IVT for the IA-64 (Itanium) processors which are referred to as VT-i [1]; formerly the IA-64 virtualization was code-named “Silvervale”.
Intel VT was officially launched at the Intel Developer Forum Spring 2005. It is available on most Pentium 4 6×2, Pentium D 9×0, Xeon 3xxx/5xxx/7xxx, Core Duo and Core 2 Duo processors (excluding the T5500). On some implementations, IVT support may be switched off in the BIOS/EFI.”
Edited 2006-12-28 12:23
Just one thing to bear in mind, some BIOS’ disable it in a way that you can’t override, so it’s worth finding out about the specific mobo’ you’re planning to buy.
Athlon64 X2 has svm as my host shows:
grep “\(X2|svm\)” /proc/cpuinfo
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8_legacy
Sorry for my ignorance, but: what do MCE, ViiV mean? and why in general “Vista-ready” hw is unable to deal with KVM virtualization? It’s a matter of DRM?
Since KVM could become a must for me too, I’d like to know precisely what kind of hw is needed (unfortunately I’m quite ignorant about hw…)
//Sorry for my ignorance, but: what do MCE, ViiV mean? and why in general “Vista-ready” hw is unable to deal with KVM virtualization? It’s a matter of DRM? //
I don’t know if the ViiV (marketing term only, AFAIK) specifications and any MCE PCs (stands for Windows Media Centre Edition) are capable of KVM virtualization or not. I strongly suspect not.
The reason that I mentioned these terms is that these PCs have DRM support built into the hardware, so AFAIK any installation of Windows on such machines even under the KVM virtualization would still get itself restricted by the DRM policies.
I was talking about the next PC hardware I might buy. Whatever it is, I will be making sure there is no support in the hardware for any DRM, especially Vista-like DRM support which may actually manage to undermine functionality even on the Linux host OS.
ViiV is a marketing term only – it simply means the computer is a certain speed, has a tv tuner in it, etc. Like the Centrino platform on laptops. AFAIK, ViiV and MCE PC’s have no special DRM that other PC’s don’t have, so there is no reason not to get them except that they might be a little more expensive – especially if you don’t plan on using Windows MCE, for instance.
Ok, so how do I know if a motherboard has DRM inside or not?
It’s not one of the things that’s wildly advertised…
//Ok, so how do I know if a motherboard has DRM inside or not?
It’s not one of the things that’s wildly advertised…//
Personally, I’d avoid anything which claimed “made for Windows Vista” or “HDCP ready” or had “BluRay” or “HD DVD” stickers on it.
almost anything sold today with those specs would be vista ready, so why try to avoid that particular label? Just seems like shooting yourself in the foot for no good reason.
I’m reading this while putting the finishing touches on my OpenVZ CentOS setup…
*grumbles*
KVM is hardware-assisted full virtualization, whereas OpenVZ is OS-level virtualization. KVM will allow you to virtualize any OS for your native platform, including Windows. OpenVZ shares the host kernel amongst the guests, so you can only run Linux guests.
Both approaches have their own trade-offs of performance and flexibility. In fact, in the near future we might see enterprise computing environments that feature OS-level guests nested within fully virtualized guests. It is a basic extension of the principles of distribution, isolation, and modularization that pervade the design of computer systems.
However, it may be too quick to call hardware-assisted virtualization on x86 (VT and SVM) a silver bullet. As the bearded folk of the mainframe era will tell you, x86 has fundamental design flaws with regard to virtualization, and VT/SVM on x86 still pales in comparison to the virtualization capabilities and performance of dinosaurs like IBM System 370.
There is a paravirtualization driver in development for Linux called paravirt-ops. Unfortunately, Xen and VMware are both keen to ensure their interests are reflected in its design. Also, Windows will never be paravirtualized on Linux unless Microsoft either authorizes a binary patch to the Windows kernel or ships a pre-patched Windows client for paravirt-ops on Linux.
But the message to take away from this is that Linux is months away from having across the board virtualization support, including hardware-assisted full virtualization, paravirtualization, and OS-level virtualization. And they will reach the mainline in that order.
Cheers mate…
*phew*
Looks like I made the right choice for my hobbyist needs.
Somewhat misleading naming when I first saw the patches in GIT and mentions here on OSNews. I thought it was a virtualization of the Keyboard, Video, Mouse stack to make virtual consoles easier for other VMMs :-).
Yeah, I got caught by that one too… I think they ran our of acronyms a long time ago.
Short version: it’s a hardware-virtualization equivalent of KQEMU. That is, KVM presently uses QEMU for the device emulation backend and VT/SVM to run a virtual machine, in contrast to KQEMU which does binary translation. Nice trick (read the tech specs, and I’m a fan).
Hardware virtualization means that the nuts-and-bolts of virtualization are easier; the difference is in devices. QEMU isn’t near VMware or Xen for I/O performance (qemu goes for cross-arch portability, not performance), but this makes it downright easy to experiment with a VM. Would be nice if we get to see more experimentation with high-performance I/O, some good research is now possible!
XEN was already in production, is this new KVM superior in some way
They’re really different products that just tend to overlap in the middle – Xen is probably going to be faster, but KVM will do full virtualization if you need it.
KVM *only* does hardware-assisted full virtualisation. No paravirtualisation or emulation possible.
Xen does both paravirtualisation *and* hardware-assisted full virtualisation. (They were the first ones to run an unmodified Windows XP guest on a Linux host.)
XEN was already in production, is this new KVM superior in some way
Yes and no, as much as I’m fan of Xen, their pissing contests with VmWare just stall inclusion of Xen or any virtualization in kernel.
So far Xen is introduced as one large pack (and this means really large) of patches. Distributor has to incorporate them in distro if they want to ship Xen.
KVM on the other hand is small and in base kernel. Which means every distro will ship with KVM by default. But mind the hardware restrictions.
Well, Fedora Core 5 had Xen, and Fedora Core 6 has it with the latest version, and with easy tools (even gui ones, IIRC) to manage, install, clone and so on the host OSs.
As does Debian Etch, although there are currently no GUI management tools in Etch. The commandline xen-tools package makes working with Xen VMs very easy, especially when using LVM as the backing store. No filesystem-in-a-file-on-a-filesystem hacks and slowdowns.
In losethos I made file systems in a file and it’s absolutely the same speed. With a regular partition you have a starting block; with a file system in a file, you also have a starting block–same thing. This “hack” was because I was a good boy and didn’t violate Microsoft’s intellectual property like the Linux guys did. I have inter-operating-system accessibility without violating intellectual property. I hope Microsoft clobbers Linux.
XEN is *not* hw-dependent, isn’t it?
Having not to buy a new machine just to play with virtualization would be nice…
Yes and no.
If you only run Xen kernels (that is, any opensource OS) then Xen is hardware independent.
If you want to run any windows version then the requirements are pretty much the same of KVM: AMD Pacifica or Intel Virtualization Extensions.
Xen has been doing full virtualization with hardware support for some time, now. I think it’s a bit slower, though.
Does KVM support using LVM logical volumes for the backing store? Or are you forced to use filesystems-in-files?
I’ve used QEmu, VMWare, and Xen with image files. It’s a lot slower than using Xen with LVM logical volumes. It’s also a lot cleaner, as there are fewer abstraction layers to go through.
But, there’s nothing about this (or much of anything, really) on the KVM website.
You’d be wise not to spend your days messing with me. I can make life hell for y’all.
Higher than president–God. Though, I do write to the president.
…I think “KVM” was a poor/confusing choice of acronyms on the part of this project.
But virtualization can eliminate the need for KVM switches!
Xen is, and probably will always remain faster than KVM. As one person already said, the projects overlap in the middle but don’t have the same goals.
Xen does have several frontends and guis. Virt-manager from the Red Hat camp is coming along nicely. Enomalism is still in the works. Then you have toos like xen-tools and argo. Xensource also has a java based vmware-like tool for enterprise xen. You can download the new product XenExpress for free and test the full-blown Xen experience with some limitations…the only major limitation is that you can only run 4 concurrent machines per box, and the gui will only allow you to connect to one box at a time.
Xen can do hardware assisted and non-hardware assisted virtualization/paravirtualization. QEMU is a full virt tool. NON-hardware assisted Xen can only run linux/unix systems(primarily Linux,BSDs, and some Solaris) as it requires kernel modifications on the host and guests. Hardware-assisted Xen can run any OS.
KVM will make it much easier for people, who met the hardware reqs, to run virtual machines with very little setup, and pretty goo performance, I don;t think their goals is to become a enterprise datacenter tool like Xen. It will be the first full OSS tool to allow this type of setup on stock machines without doing alot of geek stuff. Kinda like Parallels built i think the first desktop product to utilize the hypervisor, this one tries to commoditize the new hardware extensions.
Edited 2006-12-28 18:15
Does KVM support using LVM logical volumes for the backing store?Or are you forced to use filesystems-in-files?
Block devices (including LVM ones) are files.
will kvm offer the same speed as xen
is kvm paravirtualisation like xen
Edited 2006-12-29 03:49
There seem to be quite of few knowledgeable ppl here so I will ask a virtualization question.
What virtualization solution is closest to getting direct hardware access happening? (e.g. Running a guest that can have direct access to the 3D accelerator etc.)
I have read some info about needing xen-aware drivers to be written for the hardware, but I also read that Parallels is working on full (read: near-native) 3D acceleration under their product.
Any info would be appreciated.