Does QEMU's performance (still) lag VirtualBox's and is there a way to improve it without the hardware support+kvm kernel module?

I've noticed several articles that have claimed that QEMU is slower than VirtualBox (without hardware assistance) but several are years old, and the newest seemed to be from last year.

  • Is it true that QEMU is slower than VirtualBox?
  • If so why?
  • Are there any tricks to close the performance gap?

Some of my host systems do not have hardware virtualization support so I'm especially interested in performance tips that work without the kernel module.

2 Answers

If you're talking about x86 virtualization on an x86 host, be advised that kqemu (the old acceleration kernel module for qemu) is deprecated. Kernel Virtual Machine (KVM) is "the way forward" but it only works on Linux hosts. The guest can be whatever OS you want as long as it's x86 architecture.

Cross-architecture, qemu is still really slow; just today I was trying latest qemu with Debian MIPS64 in the guest.... it was usable from a terminal but horribly slow in Xorg. to the best of my knowledge, you can't use processor acceleration instructions like extended page tables or VT-x when you're going cross-architecture. It's all emulated in software.

So for x86 to x86 virtualization, "raw" qemu is slow, but KVM (which uses qemu) is fast. Quite fast. So fast that it's Red Hat's recommended virtualization solution for RHEL.

VirtualBox still blows away anything qemu/kvm can offer in terms of hardware-accelerated 2d/3d graphics performance, because kvm focuses on server virtualization and virtualbox focuses on desktop virtualization. But I'd definitely recommend that you check out kvm if you dealing with a server.

Edit: For your hosts that don't have any hardware acceleration, you're going to suffer from a pretty large overhead regardless of which virt solution you use. Emulating hardware things in software is hard, and expensive.

7

Assuming a host with a virtualization-capable CPU (Intel VT-x, AMD SVM), running Qemu on a kernel (Linux with KVM), it is reasonably fast.

The technical reasons for Qemu being slow with 2D (youtube, spreadsheet, games) and 3D emulation are obscure to me. However, I can make a guess that the "video drivers" simply aren't good enough - the graphics hardware in the hardware is not used in an optimal way.

On the bright side, a recent development introduced the SPICE framework to qemu. Actually it is a few years old and seems reasonably mature. The video-performance benefits of running with the QXL video driver are huge in my experience (2D web-development). I don't know how well it compares to Virtualbox, but it's definitely an improvement. I think SPICE is a must have for anyone running Windows in Qemu.

This is solely my opinion and It should be noted that I have never even tried to run any 3D or video playback in the guest.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like