There are some terminologies that you must familiarize yourself with. Here are the most important ones. Do note that these definitions are not 100% formal and only gives an abstract view.
Host: The OS/machine running the emulation/virtualization.
Guest: The virtualized/emulated machine that runs on the host operating system.
The terms 'operating system' and 'machine' are sometimes used interchangeably. (e.g. 'Windows machine' == 'Windows The Operating System') This is done intentionally to simplify the phrases used in this pseudo-wiki.
Quick EMUlator (QEMU) is a generic Free and Open-Source machine emulator and virtualizer1. It was first developed by the genius Fabrice Bellard
and is now maintained by the contributors all over the world. 2
QEMU can fully emulate CPUs, Instruction Sets, I/O Devices and other common hardware devices. It supports virtualization with near-native performance using accelerators such as Linux's KVM
, Apple's Hypervisor.Framework
and Microsoft's Hyper-V
. 3
With those features QEMU can be used for:
- Software Dev.: Run and test your software on different OSes and platforms.
- OS & Driver Dev.: Develop operating systems and/or drivers without the actual hardware. (x86_64, ARM64, PowerPC)
- Virtual Machines: Run multiple OSes with near-native performance.
- Embedded Systems: Emulate the target hardware and test your software without using the real hardware.
- Legacy Softwares: Run legacy or unsupported application. (Classic Macintosh, Windows 95)
- Security Research: Fiddle with malwares and explore vulnerabilities in an isolated environment.
Basically: it Depends™. QEMU is an extremely versatile tool. It has a very steep learning curve. If you have the time, dedication and are looking for an emulator or a virtualizer then QEMU is exactly for you!
Anyone who is looking for an adventure and want to learn more about software & hardware is welcome! QEMU is rather hard at first but in the end it will all be worth it and it will teach you a lot <3
Anyone who is looking for a Quick™ and headache-free experience to create Virtual Machines and/or Emulated Systems.
If you are looking for an easy-to-use virtual machine QEMU is not the place. There are other great tools out there in the wild (ex. VirtualBox4, VMWare5, Parallels6, UTM7).
Emulation [in computers] is the method of imitating a software, hardware or a system (CPU, I/O, Network, ARM64, PlayStation etc.) An emulator, on the other hand, is the tool that handles the emulation (Ex. QEMU).
With QEMU we can achieve different kinds of emulations: 8
- Architecture/CPU Emulation: It can emulate different CPU architectures on different machines using
Tiny Code Generator (TCG)
. (Ex. ARM64 on x86_64) 9 - User-Mode Emulation: Allows running binaries compiled for different CPU architectures. (Ex. ELF-AARCH64 on GNU/Linux x86_64) 10 [Further_Explanation_Needed]
- Device Emulation: Many of the popular real-world and virtual devices be emulated by QEMU. (Ex. USB, Network Cards, NVMe etc.) 11
- Full-System Emulation: The full emulation of a system including CPU, Memory, I/O and etc. (Ex. GNU/Linux, MS-DOS, PowerPC, Raspberry Pi) 12
Virtualization [in computers] is the method of creating isolated versions of a software or a system (e.g. GNU/Linux, Windows) by virtualizing the host's hardware.
This is different than emulation, because the software/system run directly on the host CPU rather than going thru a translation (e.g.
TCG
). Thus, less overhead and more performance.
We can't directly compare emulation and virtualization, because they are two different methods for different purposes. For simplicity's sake you can think of
virtualization
as software/system centric andemulation
as more machine/hardware centric.
There are two kinds of virtualizations:13 14
- Full Virtualization: The software/system is fully isolated and virtualized (OS/Kernel, hardware and etc.). (Guest doesn't know it is being virtualized) 15
- Paravirtualization: The software/system is partially isolated (Only the applications are). (Guest does know that it is being virtualized) 16
You can think of
Full Virtualization
as running Ubuntu like in a normal computer andParavirtualization
as running Docker containers.
The virtualization happens using the help of Hypervisors
. Since the software/system is isolated it requires a layer to interact with the real hardware. This layer is provided by the Hypervisors
. They provide the guest a virtualized hardware platform to run on. 17
Virtualization wouldn't be possible without an
Hypervisor
. 18
Each host OS provides their own Hypervisor
layers:
- KVM: Provided by the GNU/Linux as a kernel module. 19
- Hypervisor.Framework: Provided by Apple for the macOS. 20
- Hyper-V: Provided by Microsoft for Windows systems. 21
QEMU supports Full Virtualization
on almost every platform via the Hypervisors
specified above. This allows it to be used as a virtual machine.
Shameless Plug: Additional [ELI5] Info on Emulation/Virtualization
Next Part 1. Hardware Acceleration, Requirements & Installation