QEMU vs VirtualBox -- which is faster?
I'm running Kubuntu 26.04 inside QEMU and VirtualBox. Now, QEMU (with KVM enabled, --enable-kvm) is supposedly be faster, but strangely it seems slower to me. I am compiling kernel now, but that takes 2 hours on 2 cpu, which mean I have to wait 4 hours to find out. Is there a quick way to test cpu/ram/disk, by "quick", I mean 5min max?
On Mon, May 25, 2026 at 12:53:10PM -0400, William Park via Talk wrote:
I'm running Kubuntu 26.04 inside QEMU and VirtualBox. Now, QEMU (with KVM enabled, --enable-kvm) is supposedly be faster, but strangely it seems slower to me. I am compiling kernel now, but that takes 2 hours on 2 cpu, which mean I have to wait 4 hours to find out.
Is there a quick way to test cpu/ram/disk, by "quick", I mean 5min max?
Well I know I gave up on virtualbox because the network interface corrupts random packets once in a while. Often enough that I would have rpm downloads in an image build fail multiple times a day (Using vagrant to do automatic image builds). Never had that problem with qemu, it just works. Doesn't hurt that the license on qemu is much better too, and the interface much more flexible. The corrupt packets has been reported many times for years and it appears they have either never tried to fix it, or they just can't figure it out. It is quite infrequent and would definitely be hard to track down. -- Len Sorensen
How is KVM set? - You using virtio drivers? - You passing through the CPU or emulating it? - Does your virtual machine topology match that of the actual CPU? - If you just using 2 virtual CPU, just pin it to one physical CPU. If now, and your CPU is NUMA aware, the Linux scheduler will bouch it around the two CPU and your cache help will be muted. Regards, William On Mon, 25 May 2026 at 12:53, William Park via Talk <talk@lists.gtalug.org> wrote:
I'm running Kubuntu 26.04 inside QEMU and VirtualBox. Now, QEMU (with KVM enabled, --enable-kvm) is supposedly be faster, but strangely it seems slower to me. I am compiling kernel now, but that takes 2 hours on 2 cpu, which mean I have to wait 4 hours to find out.
Is there a quick way to test cpu/ram/disk, by "quick", I mean 5min max?
------------------------------------ Description: GTALUG Talk Unsubscribe via Talk-unsubscribe@lists.gtalug.org Start a new thread: talk@lists.gtalug.org This message archived at https://lists.gtalug.org/archives/list/talk@lists.gtalug.org/message/GOYK333...
Your questions are over my head. I can't give meaningful answers. :-) QEMU was started with *qemu-system-x86_64* -m 4096 -smp 2 *-cpu host -enable-kvm* \ -usb -usbdevice tablet \ -net user -net nic \ -hda kubuntu2604.qcow2 where I'm assuming, "-cpu host" means QEMU figures it out (Haswell, i3-4170). On 2026-05-25 14:26, William Muriithi wrote:
How is KVM set?
- You using virtio drivers? - You passing through the CPU or emulating it? - Does your virtual machine topology match that of the actual CPU? - If you just using 2 virtual CPU, just pin it to one physical CPU. If now, and your CPU is NUMA aware, the Linux scheduler will bouch it around the two CPU and your cache help will be muted.
Regards, William
On Mon, 25 May 2026 at 12:53, William Park via Talk <talk@lists.gtalug.org> wrote:
I'm running Kubuntu 26.04 inside QEMU and VirtualBox. Now, QEMU (with KVM enabled, --enable-kvm) is supposedly be faster, but strangely it seems slower to me. I am compiling kernel now, but that takes 2 hours on 2 cpu, which mean I have to wait 4 hours to find out.
Is there a quick way to test cpu/ram/disk, by "quick", I mean 5min max?
------------------------------------ Description: GTALUG Talk Unsubscribe via Talk-unsubscribe@lists.gtalug.org Start a new thread: talk@lists.gtalug.org This message archived at https://lists.gtalug.org/archives/list/talk@lists.gtalug.org/message/GOYK333...
On Mon, May 25, 2026 at 02:52:03PM -0400, William Park via Talk wrote:
Your questions are over my head. I can't give meaningful answers. :-)
QEMU was started with
*qemu-system-x86_64* -m 4096 -smp 2 *-cpu host -enable-kvm* \ -usb -usbdevice tablet \ -net user -net nic \ -hda kubuntu2604.qcow2
where I'm assuming, "-cpu host" means QEMU figures it out (Haswell, i3-4170).
I believe the obsolete -hda emulates an old IDE controller. Better to use the modern syntax: -device virtio-scsi-pci,id=scsi0 -drive file=kubuntu2604.qcow2,if=none,id=hd0,format=qcow2 -device scsi-hd,drive=hd0,bus=scsi0.0 instead of -hda ... That will emulate a virtio scsi controller which is way more efficient than the ide interface. Using a raw disk would be slightly faster than qcow2, but also take more space, usually. Only really a problem for VMs that write a lot. Not sure how well 4G ram does for running a GUI. Sounds potentially painful. -- Len Sorensen
On Mon, May 25, 2026 at 12:53:10PM -0400, William Park via Talk wrote:
I'm running Kubuntu 26.04 inside QEMU and VirtualBox. Now, QEMU (with KVM enabled, --enable-kvm) is supposedly be faster, but strangely it seems slower to me. I am compiling kernel now, but that takes 2 hours on 2 cpu, which mean I have to wait 4 hours to find out.
Is there a quick way to test cpu/ram/disk, by "quick", I mean 5min max?
As for performance, it also depends how much ram you gave the VM, the disk interface type, the backing store used for the disk, how many cpu cores, etc. Certainly I have seen many places claim qemu tends to win by 15 to 30% over virtualbox. https://www.youtube.com/watch?v=k0uaszySbfc for example -- Len Sorensen
I asked Google AI, and it gave me the following answers: time echo "scale=7000; 4*a(1)" | bc -l time dd if=/dev/zero bs=1M count=4096 2>/dev/null | sha256sum Both gave almost identical results for both QEMU and VirtualBox. Granted that they are pure "cpu", but I just want to compare. Man, AI is good! Kernel compile is more comprehensive (cpu, ram, disk), but it takes too long, and lot of things will skew the result. On 2026-05-25 14:30, Lennart Sorensen wrote:
On Mon, May 25, 2026 at 12:53:10PM -0400, William Park via Talk wrote:
I'm running Kubuntu 26.04 inside QEMU and VirtualBox. Now, QEMU (with KVM enabled, --enable-kvm) is supposedly be faster, but strangely it seems slower to me. I am compiling kernel now, but that takes 2 hours on 2 cpu, which mean I have to wait 4 hours to find out.
Is there a quick way to test cpu/ram/disk, by "quick", I mean 5min max? As for performance, it also depends how much ram you gave the VM, the disk interface type, the backing store used for the disk, how many cpu cores, etc.
Certainly I have seen many places claim qemu tends to win by 15 to 30% over virtualbox.
https://www.youtube.com/watch?v=k0uaszySbfc for example
participants (3)
-
Lennart Sorensen -
William Muriithi -
William Park