From the Canyon Edge -- :-Dustin

Wednesday, April 7, 2010

kqemu and Ubuntu

Several people have asked over the last few months about kqemu in Ubuntu. Here's a concise set of FAQs on the topic.

What is kqemu?

kqemu is a kernel module that "accelerates" QEMU virtualization by allowing guests to run some operations directly on the host's CPU. In this respect, it's similar to kvm.

Beyond the kernel module, kqemu requires support from the QEMU userspace emulator to take advantage of the kqemu kernel hooks.

How is it different from kvm?

Unlike kvm, kqemu has never been accepted in the upstream Linux kernel.

Also different from kvm is the fact that kqemu works on hardware that does not support CPU Virtualization Technology (VT extensions), see Intel VT and AMD-V.

When would I want to use kqemu?

If your CPU supports VT or you have access to hardware that supports VT, you have no need for kqemu, as kvm is a far more complete, better performing, fully supported, and more modern alternative. Otherwise, kqemu arguably may be useful on some legacy hardware without VT.

How do I know if my hardware supports VT?

Just run kvm-ok from a command line and it should tell you.

Why was support for kqemu dropped from Ubuntu?

Quite simply, the upstream QEMU community deprecated kqemu in favor of kvm.

The upstream qemu-0.11 release series (which was in Ubuntu 9.10) disabled kqemu in the build. And the upstream qemu-0.12 release series (which is in Ubuntu 10.04 LTS) actually removed all remnants of the kqemu hooks from the source.

Why did upstream QEMU drop support for kqemu?

This was thoroughly discussed on the upstream qemu-devel mailing list by the developers of QEMU, as well as many users. An open poll was conducted by QEMU upstream to gauge the usefulness of kqemu. (The Ubuntu Server Team also conducted a poll and held a discussion on the topic at UDS-Lucid in Dallas, Texas in November 2009.)

You can read the hundreds of messages, as well as the handful of bug reports, if you like, but there are two primary reasons:
  1. kqemu has no active maintainer. Upstream is open to reconsidering kqemu support, if an active maintainer steps up, fixes the open issues, and commits to providing ongoing support.
  2. kqemu code within QEMU actually conflicts or breaks KVM code paths (specifically some required for 64-bit KVM support).
What are my alternatives to kqemu in Ubuntu 9.10, Ubuntu 10.04 LTS, and beyond?

Ideally, you would have access to VT-capable hardware, and use qemu-kvm, leveraging its outstanding performance, security model, and support from the various communities responsible for delivering it to you in Ubuntu (including the upstream Linux kernel, QEMU development team, Ubuntu Server Community, and the Canonical Server Team).

We cannot stress this enough:
  • KVM is absolutely your best option for enterprise-ready, production-critical, supported deployments of Virtualization stacks built upon Ubuntu Servers.
If, instead, you're looking for occasionally running non-critical virtual machines on your Ubuntu desktop, I would recommend VirtualBox (see the virtualbox-ose package in Ubuntu). VirtualBox provides decent performance on systems without VT, as well as a rather user-friendly interface. VirtualBox is currently in Ubuntu Universe, so it is supported on a best-effort basis by the Ubuntu Community and Canonical.



  1. It would be nice if Canonical could sponsor someone to fix this situation upstream. Hardware without virt bits will exist for a long time into the future, especially with netbooks and so on.

  2. It would be nice if Canonical could sponsor someone to fix this situation upstream. Hardware without virt bits will exist for a long time into the future, especially with netbooks and so on.

  3. Hi, thanks for interesting article (funnily enough I'd just read most of it on the Ubuntu Wiki!). However I'm inclined to agree with Anonymous: (Intel) hardware that doesn't support VT is still incredibly common. I bought a brand new Intel Core2Quad chip (Q8200) not that long ago and was horrified when I set it all up and I realised that it did not have VT capability! I just assumed that all Intel chips supported it since Core2Duo (as AMD do from socket AM2). After a bit more research I discovered that many of the Core2Duo range don't support it and most of the Atom chips don't either. That'll teach me to not do my homework properly. :(

  4. Any tips on how to make Ubuntu Enterprise Cloud use kqemu or qemu instead of KVM?


Please do not use blog comments for support requests! Blog comments do not scale well to this effect.

Instead, please use Launchpad for Bugs and StackExchange for Questions.