What’s the difference between an emulator and a virtual machine?

259 views

What’s the difference between an emulator and a virtual machine?

In: Technology

Emulators are made to emulate the environment for specific applications and uses (game console hardware for example).

VMs emulate whole operating systems with a maximum of program compatibility and feature completeness.

A virtual machine uses the host machine’s own CPU to run. They are two machines sharing the same processor, the host (physical) machine and the virtual one. This means that the virtual machine can only run an OS that supports the CPU of the host machine.

An emulator is a program that implements a CPU in software. So you have a program that pretends to be, say, an Intel CPU, but this program itself runs on something different, like, say, an Apple M1.

To keep it fairly simple ( to try at least ) :

A virtual machine will virtualize the host hardware to run the software part. Meaning that a VM is just an interface between your real hardware and the virtualised one, which will be used for software.

Meanwhile, an emulator will also emulate the hardware part and therefore won’t rely on the host one.

This difference allow emulators to use a PC to emulate a device with a totally different architecture ( consoles for exemple ), while a VM won’t be able to

(There’s a large overlap between the two: e.g., QEMU can be seen as emulator for running virtual machines. But to put accent on differences:)

Emulator makes computer pretend to be completely different hardware, e.g. a PC may pretend to be a Super Nintendo.

Virtualization divides the existing hardware into smaller, independent but similar hardware. The resulting hardware can bes used for running different software. E. g., using VirtualBox, you can divide your Intel x86-based system into 2 smaller x86-based systems, and run Linux on one and Windows on another independently – they can not even “feel” each other.