QEMU 2.0.0 Released
article.gmane.org
article.gmane.org
1. My understanding is that the primary use case of QEMU is for server virtualization on Linux hosts leveraging KVM. Is there a use-case for QEMU on non-Linux hosts?
2. I have read that QEMU excels in server virtualization but lags behind VirtualBox in desktop virtualization. Is this still the case? [1]
3. Is it considered "slow" for cross-architecture virtualization? [1]
[1] http://superuser.com/questions/447293/does-qemus-performance...
What I had read as implied in the SO answer I linked to was that there was some other means of implementing cross-architecture emulation that was faster than QEMU.
In other words, there's a difference between being "slow" in absolute terms vs. being "slow" relative to other virtualization solutions.
From your answer, I gather that QEMU isn't under-performant relative to other emulation options.
Still, kudos to the developers for making some things better (TCG actually does seem noticeably faster in 2.0.0) and congratulations on the 2.0.0 release!
My take on the KVM vs TCG split is simply that in the end open source projects are driven by the people who put in the work, and inevitably if there's a set of people whose day job is to work on the project then it's going to tend to improve in the areas those people and companies need. And in general the people working on the emulation side of things seem to be happy enough with the performance levels we currently have: I see plenty of patches to add new ARM boards or fix issues with devices, or to fix bugs in the linux-user emulation code. In comparison, there doesn't really seem to be much interest in TCG performance (and serious improvements in performance, though possible, would be a six month or longer project to achieve).
The particular bugs you note are even further out in the cold since x86 guest TCG in particular is pretty much orphaned and MIPS is not a great deal better (though I have been heartened to see recent contributions from Imagination).
Running two x86 hardware-assisted hypervisors at once is madness. However, running one inside another is possible.
Thanks. That's an important distinction I had gotten wrong.
The QEMU wikipedia page describes it as "a free and open-source hosted hypervisor that performs hardware virtualization." [1]. In the context of the entire article, that description is slightly misleading.
You are overstating the difference between 'virtualization' and 'emulation.' There really isn't one. What used to be called 'emulation' is nowadays called 'full-virtualization' as opposed to 'paravirtualization.' QEMU, KVM, and XenKVM are full-virt, while traditional Xen is paravirt.
KVM is not a hypervisor; libvirt is. Xen blurs the line between virtualization platform and hypervisor because both pieces ship within the same project. Either libvirt or Xen can act as hypervisor for QEMU or KVM.
QEMU's lack of hard-dependency on a specific gui is in fact its strength, not its weakness. This makes it much easier to modularize and deploy at scale, which is what OpenStack does, for instance. Every QEMU VM is capable of listening on a given port for VNC connections, which means you don't even particularly need a GUI for basic use. More featureful guis can be found in the libvirt project (e.g. virt-manager).
QEMU is not particularly fast at cross-architecture stuff because that was not its original focus. However, it was one of the first packages available for linux that even made that possible at all, which is why it is still known for this functionality.
* QEMU calls itself an emulator because emulation was its original intent; that it was possible to relatively easily modify it to use hardware virtualization rather than emulating the CPU was a happy accident some time later
* for the CPU the "virtualization"/"emulation" distinction is huge -- if you can use the CPU's hardware assist to directly run guest code things will be fast; if you're emulating the guest CPU things will be very much slower
* the process being run isn't "kvm-qemu" unless your distro is providing back-compatibility wrappers (which in turn are only there because the changes to QEMU to make it work with KVM were for some years maintained out of tree)
* KVM is absolutely a hypervisor; libvirt is not, it is a management layer that can configure and control a hypervisor
* you can't use Xen with KVM, because they're both hypervisors
Xen paravirt has always run inside VMs, even before nesting support. I used to run it in VMware all the time for development purposes.
QEMU is an emulator, it isn't by itself capable of doing virtualization. It can allow a hypervisor to do CPU (and some I/O) virtualization in lieu of QEMU doing binary translation/emulation. In that case QEMUs purpose is mainly I/O emulation. 'Virtualization' as a name and concept predates QEMU by several decades.
> KVM is merely the kernel infrastructure that enables ring-0 access for faster hardware access. For many years it was called qemu-kmod; to this day the actual process that you run is called 'kvm-qemu.'
kqemu and KVM are technologically unrelated.
> You are overstating the difference between 'virtualization' and 'emulation.' There really isn't one. What used to be called 'emulation' is nowadays called 'full-virtualization' as opposed to 'paravirtualization.' QEMU, KVM, and XenKVM are full-virt, while traditional Xen is paravirt.
Para-Virtualization is the concept where the guest OS is aware that it is being run on a hypervisor. For example using hypervisor hypercalls to create new address spaces rather than setting up hardware page tables. "Full" or hardware level virtualization happens when the guest OS does not need to be aware of this fact. Neither is related to emulation.
> KVM is not a hypervisor;
It is.
> libvirt is.
This one isn't.
> Xen blurs the line between virtualization platform and hypervisor because both pieces ship within the same project. Either libvirt or Xen can act as hypervisor for QEMU or KVM.
"hypervisor":"virtualization platform" ~ "kernel":"operating system". KVM and Xen can act as hypervisor for Qemu managed by libvirt.
I am not an expert in this area, but I find it to be the case for me. Running a desktop guest under kvm is a pain - I'm about to move to a new workstation and am considering moving to virtualbox. My desktop guest under kvm doesn't accept the mouse scroll wheel, doesn't support clipboard copying, doesn't support dynamic desktop resizing, and virtualbox does. These things are theoretically fixable with kvm, but there's no clear and easy path to fix them (or wasn't, last I checked. I tried a few things and failed). Virtualbox just has 'install guest additions' and you're done.
I've not tried virtualbox for servers - the perception I had was that the management tools were really focused around desktops.
This alleviates some of the problems you are referring to.
I mostly use Qemu for cross-architecture emulation, where the convenience to simulate certain embedded architectures and devices makes it very interesting to use. The integrated GDB server is also very neat, especially for kernel debugging.
Flashing and testing embedded devices is cumbersome, so using an emulator is preferable to speed up the code-build-test-debug loop. Runtime speed is not always that important.
http://docs.openstack.org/image-guide/content/ch_converting....
I documented my transition in some of the sections on this page: https://justdavis.com/karl/it/davis/servers/eddings/vms.html
1) Followed rwmj's guide to setting up a br0 device for libvirt in Fedora.
2) Deleted all vmware snapshots. sync. sync.
3) Grabbed vmware2libvirt from Ubuntu (it's just a standalone python script) and
used it with --bridge br0 -f foo.vmx > foo.xml.
4) Converted my vmdk to raw with qemu-img, moved it to /var/lib/libvirtd per your
instructions
5) Edited my xml to point to the right disk, use the qemu/raw driver, use the right
path for kvm (/urs/bin/qemu-kvm on Fedora).
6) Import into libvirt with virsh define foo.xml
7) virsh start foo
It just works! Great. And virt-viewer over qemu+ssh is great; I run this VM on a headless box on the LAN from my desktop.Sure, for a desktop system it might make sense, but headless systems might be better served with QEMU-KVM.
I've played with a Raspbian image running on QEMU hosted on Windows 7 a few months ago.
[1]: http://wiki.qemu.org/download/qemu-doc.html#Introduction
I've crashed so hard using virtualbox that I didn't even get a kernel panic, just a box that wouldn't even respond to alt+sysrq.
On top of this, I personally prefer QEMU because it doesn't come with a clunky GUI.
In my case (MacBook Air 2013 with 8GB of RAM I run Ubuntu 12.04.4 without a problem).
As originally mentioned, the VBox kernel modules are of poor quality. You may or may not trigger an edge case in your daily use, with or without a desktop environment.
Your kernel is tainted whenever you insert non-GPL-compatible modules, it has nothing to do with the quality of the software.
VirtualBox is perfectly usable without the GUI.
- Proprietary software (non-gpl-compatible, as you say. ex: vmware)
- Crap (drivers/staging)
- Out-of-tree modules (virtualbox)
- whether the kernel has hit a BUG already
- ...
- lots of stuff
VirtualBox taints the kernel because it is out-of-tree, not because it is GPL-incompatible. Why is a GPL compatible kernel module(s) not merged yet?Because the code quality is crap.
https://lkml.org/lkml/2011/10/6/317
The number of bug reports we get from people with virtualbox loaded are
truly astonishing. It's GPL, but sadly that doesn't mean it's good.
Nearly all of these bugs look like random corruption. (corrupt linked lists,
corrupt page tables, and just plain 'weird' crashes).
And the no-GUI, geared-towards-commandline, doesn't-have-directories-with-spaces type stuff is just my personal preference, as I've already said.In short, QEMU with KVM is way faster, for servers, non-gui interactions.
1. Qemu supports more architectures, such as running ARM or MIPS code on x86 hardware.
2. Server use. It works with KVM, Xen, Virt-manager, etc; it plays nice with the ecosystem on GNU/Linux. I know my VPS is using Qemu as part of their stack.
3. That last point also means that improvements to KVM and whatnot also improve Qemu.
4. If you are a "freetard", these days VirtualBox uses non-free code in the BIOS. Qemu can be used totally free.
5. As petty as it sounds: It was around first, and people stick with what they know (this is the principle reason I use Qemu).
That is also the compiler required for FreeDOS; an effort towards creating a free replacement would be helping multiple projects.
It's an emulator for a wide variety of hardware platforms. You'd care if you wanted an emulator for a platform it supported.
1. If it's on the front page of HN then a lot of other folks around here probably know what it is already.
2. If it got voted up fairly quickly, it's probably also a big or important technology that I should familiarize myself with, at least superficially.
But this is an old, well-known project. If you put "QEMU" into Google, literally every single hit in the first page of results is about it.