so RedHat developed the virsh manager, but not qemu itself.

https://stackoverflow.com/questions/43704856/what-are-the-differences-between-qemu-and-virtualbox

QEMU is a generic and open source machine emulator and virtualizer.

When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC).

By using dynamic translation, it achieves very good performance.

When used as a virtualizer, QEMU achieves near native performance by executing the guest code directly on the host CPU.

QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux.

When using KVM, QEMU can virtualize x86, server and embedded PowerPC, 64-bit POWER, S390, 32-bit and 64-bit ARM, and MIPS guests.

KVM (Kernel Virtual Machine) is a Linux kernel module that allows a user space program to utilize the hardware virtualization features of various processors. Today, it supports recent Intel and AMD processors (x86 and x86_64), PPC 440, PPC 970, S/390, ARM (Cortex A15, AArch64), and MIPS32 processors

Android Studio use kvm qemu to start their Android dev emulators.

XEN uses QEMU: “Xen HVM has device emulation based on the QEMU project to provide I/O virtualization to the virtual machines.” (src: Wiki)

virtual harddisks

a vm’s virtual harddisks is usually just “a file” on the host

the speed

this is a basic sequential write and read test script (bench_harddisk.sh)

the host has a Samsung SSD 860 EVO 500GB (before harddisk space consolidation):

so as can be seen

  • the guest vm almost get’s the same (91%) harddisk write speed as the host (100%)
  • the guest vm almost get’s (thanks to RAM caching) (+597%) harddisk read speed as the host (100%)

the size

during setup (kvm and virtualbox) the user-admin can specify how much harddisk space shall be given to that vm (at most)

virtualbox then starts with a small harddisk file that grows when the vm is creating more files (needing the storage)

kvm per default goes with fixed harddisk size (better harddisk speeds) while this can be easily consolidated like this:

# rename the original qemu harddisk file
mv -v disk.qcow2 disk.qcow2.orig
# consolidate harddisk space (shrink to actually used harddisk space)
qemu-img convert -O qcow2 disk.qcow2.orig disk.qcow2

so the speeds after qemu harddisk space consolidation are also pretty okay:

  • the guest vm almost get’s the same (75%) harddisk write speed as the host (100%)
  • the guest vm almost get’s (thanks to RAM caching) (+309%) harddisk read speed as the host (100%)

“show me the source”:

https://git.qemu.org/git/qemu.git/

Links:

https://www.qemu.org/

QEMU is a member of Software Freedom Conservancy.

QEMU releases can be downloaded here: https://www.qemu.org/download/

more on the the cow2 harddisk file format & caching: https://gitlab.com/qemu-project/qemu/-/blob/master/docs/qcow2-cache.txt

creditz & kudos:

https://bytesandbones.wordpress.com/2019/11/06/kvm-qemu-qcow2-sparse-disk-allocation-problem-shrink-sparse-qcow2-disks-howto/

 

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin