What are the differences between Virtualisation and Emulation?

Virtualization

Virtualization technology enables guest operating systems and software to run on host hardware in isolation from each other. All virtual machines are ideally unaware they are sharing the hardware, and the virtualiser (often a hypervisor) is responsible for intercepting actions from the guest software to maintain this illusion for the guest. Actions which require special treatment from the virtualiser are rare and so most operations are performed directly on the real hardware.

Virtualization therefore is efficient, typically 85-95% native/unvirtualised speed, but also as a consequence:

  • The real hardware has to have an architecture identical to the guest system. For example, VMWare, Xen or HyperV can create mulitple virtual PCs for running WindowsXP "inside" a real x86 PC. However they cannot do this on any other type of hardware, e.g. cell processors.
  • It is vulnerable to security flaws as execution actually happens on the real physical cpu. Malicious guest software can exploit this to take control of the entire real/physical machine, for example the Blue Pill or the SMM (System Management Mode) attacks.

Emulation

Emulators simulate the computer hardware in software. Thus there is no inherent connection to the underlying hardware - as long as the emulator runs it will make the guest think its running on an x86 PC. Emulators can also avoid low level security flaws, as they are detached from the underlying hardware - a malicious guest can just corrupt itself.

This diagram illustrates how JPC makes it possible to layer a guest OS inside a host. The real operating system is installed on the real hardware, and the JVM is installed on top of the real operating system. JPC emulates a layer of virtual hardware onto which another operating system and associated software can be installed.