What’s QEMU

Chamath Denuwana
3 min readOct 23, 2023

--

If you’re a technology enthusiast, you’re probably familiar with the concept of virtualization and the various tools available for it. Among these tools, QEMU stands out as a versatile and powerful open-source emulator. In this article, we will explore what QEMU is, how it compares to VirtualBox, its advantages and disadvantages, and its relationship with KVM. We will also provide a step-by-step guide for installing QEMU on a Debian-based Linux system.

QEMU (Quick Emulator) is a free and open-source machine emulator and virtualizer that can run various guest operating systems and architectures on a single host system. Unlike traditional virtualization solutions, QEMU is not just a hypervisor; it’s an emulator that can run guest operating systems on a wide range of host platforms. It is a powerful tool for software development, testing, and deployment.

VirtualBox vs. QEMU

VirtualBox offers a user-friendly GUI and is suitable for users who want a simple way to run virtual machines on their desktop. In contrast, QEMU provides more control and flexibility but often requires command-line interaction. The choice between the two depends on your specific use case and preferences.

There are some key differences between the two.

  • Emulation: QEMU can emulate a wide range of hardware, including CPUs, memory controllers, and devices. VirtualBox, on the other hand, is primarily designed to virtualize x86 and AMD64 systems.
  • Performance: QEMU is generally faster than VirtualBox, especially when running emulated systems.
  • Compatibility: QEMU is more compatible with a wider range of guest operating systems than VirtualBox.

Advantages of QEMU

  • Versatility: QEMU can emulate a wide range of hardware and run a variety of guest operating systems.
  • Performance: QEMU is generally faster than other virtualization software, especially when running emulated systems.
  • Compatibility: QEMU is compatible with a wider range of guest operating systems than other virtualization software.
  • Open source: QEMU is free and open-source software, which means that it is constantly being improved and updated.

Disadvantages of QEMU

  1. Complex Configuration: QEMU’s command-line interface and configuration files can be daunting for beginners.
  2. Performance Overhead: Emulation tends to have more performance overhead compared to virtualization solutions like KVM.
  3. Limited GUI: QEMU’s default interface is command-line-based, which may not be as user-friendly as VirtualBox’s GUI.

QEMU vs. KVM

KVM (Kernel-based Virtual Machine) is a virtualization technology that is built into the Linux kernel. It uses hardware virtualization features to run multiple virtual machines on a single host system.

QEMU and KVM can be used together to provide a more efficient and powerful virtualization solution. QEMU can be used to emulate hardware that is not supported by KVM, and KVM can be used to provide better performance for virtual machines.

Installing QEMU on Debian

  1. Update the system:
sudo apt update && sudo apt upgrade -y 

2. Check whether CPU virtualization is enabled:

egrep -c '(vmx|svm)' /proc/cpuinfo

If the output is greater than 0, then CPU virtualization is enabled. Otherwise, you need to enable it in your system BIOS.

3. Install QEMU:

sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virtinst libvirt-daemon

4. Enable and start the libvirtd service:

sudo systemctl enable --now libvirtd

5. Install Virt-Manager :

sudo apt install virt-manager -y

Virt-Manager is a GUI tool for managing virtual machines.

Using QEMU

Once you have installed QEMU, you can start using it to create and run virtual machines.

To create a new virtual machine, you can use the following command:

qemu-kvm -name <vm_name> -m <memory_size> -cdrom <iso_file>

This will create a new virtual machine with the specified name, memory size, and ISO file.

To start the virtual machine, you can use the following command:

qm launch <vm_name>

To stop the virtual machine, you can use the following command:

qm stop <vm_name>

Conclusion :

QEMU is a powerful virtualization and emulation tool with its own set of advantages and disadvantages. Understanding its capabilities and how it compares to other virtualization solutions like VirtualBox and KVM can help you make an informed choice for your virtualization needs. With the step-by-step installation guide provided, you can get started with QEMU on your Debian-based Linux system and explore its capabilities further.

--

--