Preferences

Why would you use QEMU over virtualbox? (Serious question)

The VirtualBox virtualization drivers have serious issues. They're written so poorly that they're notorious for causing kernel panics on linux. The kernel devs consider your kernel tainted if you load the virtualbox modules.

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.

colechristensen
There's a lot of bad information here.

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.

Incorrect. The kernel devs specifically cited the quality of the drivers when adding it to the taint list. Check the mailing list if you don't believe me.

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.
This is also bad information. Kernel taint is a bitmap that represents a number of things:

  - 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.

Karunamon
VBox was explicitly marked as tainted due to issues it caused, not some licensing philosophy.

https://lkml.org/lkml/2011/10/6/317

octopus
To be fair, VirtualBox runs flawlessly on OSX and Windows. I've also used VirtualBox without problems on Ubuntu. What Linux distribution you use ?
gtaylor
I've had Ubuntu 12.04 guests crash hard (like the commenter mentioned) on OSX and Linux hosts with VirtualBox.
octopus
Probably has something to do with the 3D acceleration Unity needs.

In my case (MacBook Air 2013 with 8GB of RAM I run Ubuntu 12.04.4 without a problem).

gtaylor
My installs are headless, no 3D accel or Unity needed.

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.

raverbashing
This also may happen if you have another virtualization driver installed (even kvm)
Arch. But I've also had virtualbox crash on Debian testing. It's a mess.
heywire
I personally had a terrible time using VirtualBox on a Lenovo T420 running Windows 7 x64 about 2 years ago. I was having frequent blue screens, so Lenovo sent out a tech to swap the motherboard. The issue persisted, and after some time, I noticed that it seemed to always occur when I had multiple VMs running. The problem went away when I migrated to VMware Workstation.
mbreese
Anecdotally, I've had issues on OSX with VirtualBox, so much so that I switched to VMWare Fusion on Mac hosts...
neckro23
VirtualBox is the only app I've ever seen kernel-panic OSX. Twice.
LukeShu
There are several reasons I can think of:

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).

thristian
Actually, VirtualBox's BIOS code is 100% freely redistributable and modifiable. Unfortunately, the only compiler capable of building it is non-Free (OpenWatcom). It turns out there's not a whole lot of interest in writing compilers targeting 8086 real mode these days. :(
LukeShu
Oops, you are correct. Good catch!

That is also the compiler required for FreeDOS; an effort towards creating a free replacement would be helping multiple projects.

octopus
QEMU lets you emulate ARM architecture on x86 for example, which is not possible with VirtualBox.

I've played with a Raspbian image running on QEMU hosted on Windows 7 a few months ago.

uulbiy
I think this is closest to the correct answer, so I will try to expand on it. Qemu, is a processor emulator[1] and can emulate processors like x86, x86_64, ppc, mips, arm etc. Qemu is usually run with kvm[2].

[1]: http://wiki.qemu.org/download/qemu-doc.html#Introduction

[2]: http://www.linux-kvm.org/page/Main_Page

alok-g
How fast does it run as compared to on Raspberry Pi itself?
CSDude
Virt-manager uses QEMU and I think it is pretty good, and much faster than Virtualbox. If you wish to use a desktop though, you should configure the video card of VM manually, its performance is not that good, but if you really want to use desktop VM, I suggest VMWare, I found the interaction much faster, but Virtualbox is pretty good to.

In short, QEMU with KVM is way faster, for servers, non-gui interactions.

couradical
Running headless virtualization on a server with KVM?

Sure, for a desktop system it might make sense, but headless systems might be better served with QEMU-KVM.

uulbiy
Actually you can run virtualbox in a headless server using the VBoxManage and VBoxHeadless[1]. I have been using that for years.

[1]: http://www.virtualbox.org/manual/ch07.html

kbenson
My understanding is that portions of QEMU are used in KVM and Xen, so advancements here enhance those projects as well.
evol262
This is the correct answer. qemu --accelerator=kvm is the principal way KVM is used.
rainforest
In addition to KVM use couradical points out, it's also used in the Bitblaze BAP tool's TEMU component[1], which does dynamic analysis (including taint tracking) over x86 programs and kernels.

[1] http://bitblaze.cs.berkeley.edu/temu.html

QEMU/KVM are the default virtualization used in OpenStack [1], for one. I also use it on my laptop to host guests because of how much Virtual Box sucks under Linux [2], as others have mentioned.

[1] https://www.openstack.org/

[2] https://lkml.org/lkml/2011/10/6/317

jsight
The best reason, IMO, is that the tools around KVM (using QEMU) and virt-manager are becoming much more pleasant to use than their VirtualBox counterparts. The GUI could still use some cleaning up, IMO, but overall I have found the experience much more pleasant in recent virt-manager releases than the VirtualBox way of doing things.
duaneb
It runs non-x86 binaries.
venomsnake
VGA Passtrough

This item has no comments currently.