Articles

Type 1 and type 2 hypervisors: the classification and its limits

Where the VMM sits, what virtualizable means, and why the two-type label is a coarse one.

Reading: 5 minServer & Virtualization

Article cover: Type 1 and type 2 hypervisors: the classification and its limits

A type 1 and a type 2 hypervisor are told apart by where the virtual machine monitor sits: on the hardware, or on an operating system. The label is a first approximation, and a coarse one. What makes a piece of software a virtual machine monitor is older, stricter, and not about placement: Popek and Goldberg set out three properties in 1974, and what makes a machine virtualizable is a condition on its instructions.

What makes a piece of software a VMM

Hypervisor and the older virtual machine monitor (VMM) name the same layer. In Popek and Goldberg’s words a VMM has “three essential characteristics”: it gives each program an environment essentially identical to the real machine; programs run in it with at worst minor loss of speed; and the VMM is “in complete control of” system resources.

The second property separates a monitor from an interpreter: a statistically dominant subset of guest instructions must “be executed directly by the real processor”. “The efficiency property. All innocuous instructions” run on the hardware itself, so most of the guest’s work is the hardware’s and only the operations that could let the guest escape reach the monitor.

What “virtualizable” means: the sensitive-instruction condition

The paper sorts instructions by what they do to the machine’s state. An instruction is privileged when it traps in user mode but not in supervisor mode: “Instruction i is privileged if and only if for any pair” of states differing only in mode, the user-mode execution traps and the supervisor-mode one does not.

An instruction is control sensitive if running it can change a program’s memory or the processor mode without a trap: “An instruction i is control sensitive if there exists a” state in which it does. It is behavior sensitive if its effect depends on where it sits in real memory. An instruction that is either is sensitive; one that is neither is innocuous — “If i is not sensitive, then it is innocuous” — and innocuous instructions may run directly.

The condition follows: a monitor can be built when the sensitive instructions are a “subset of the set of privileged instructions”, so every instruction able to touch the machine’s resources traps in user mode. The monitor gains control exactly when it must; a sensitive instruction that is not privileged runs untrapped and reaches the real machine. “Virtualizable” is a statement about an instruction set, not about where a layer sits.

When the trap does not exist

A trap is useful only if something answers it. The control program keeps a routine for each privileged instruction, and its work is to “simulate the effect of the instruction which trapped” in the environment the guest believes it has — what a modern reader calls trap-and-emulate. Its cost is the efficiency property: the more work is simulated, the further the monitor is from running the guest on hardware.

When the subset condition fails, the definition is relaxed, not abandoned. A hybrid monitor interprets instructions a plain monitor would leave “being directly executed” by the hardware; it is less efficient, but more architectures qualify. The PDP-10 is the paper’s example: a return-to-user instruction is sensitive without being privileged, so “PDP-10 cannot host a VMM”, yet the machine can host a hybrid monitor that interprets it.

On a current x86 server the processor provides the trap. QEMU, the emulator Proxmox VE uses, runs guests “with the support of the virtualization processor extensions, via the Linux KVM module”; the requirement is “an Intel VT or AMD-V capable CPU”. Without them the platform falls back to emulation and pays the efficiency cost the definition warns about.

The cases the label does not classify

Three products show where the placement label stops describing the machine.

type 1 — bare metal            type 2 — hosted              KVM — in the kernel
─────────────────────          ───────────────              ────────────────────
guest   guest                  guest   guest                guest   guest
  ↑       ↑                      ↑       ↑                    ↑       ↑
virtual hardware               virtual hardware             virtual hardware
  ↑                              ↑                            ↑
VMM                            VMM (= an application)       QEMU (= a user program)
  ↑                              ↑                            ↑
hardware                       host operating system        Linux kernel + KVM module
                                 ↑                            ↑
                               hardware                     hardware

VirtualBox is the clean type 2. Its manual calls it a “hosted hypervisor, sometimes referred to as a type 2 hypervisor”, and gives the consequence: VirtualBox “requires an existing OS to be installed” and can “run alongside existing applications on that host”.

KVM fits neither side. The virtualization engine is a module of the Linux kernel, while what builds and runs a guest is a userspace program: Proxmox VE boots a “Proxmox VE Linux kernel with KVM and LXC support”, QEMU is “a user program”, and the KVM module lets it use the processor extensions. Calling this type 2 would put the monitor on top of an operating system it is part of; calling it type 1 would ignore that the operating system boots first.

Hyper-V shows a different gap. Microsoft calls it a type-1 hypervisor — “As a type-1 hypervisor, Hyper-V runs directly on computing hardware” — and the same documentation presents it as “included with Windows Server and Windows”, so an administrator meets a type 1 hypervisor as a role of an operating system. The label states how the product is designed to sit, not what to expect on the machine.

Why the label is useful, and where it stops

The label earns its place as a first approximation: it predicts what an administrator finds. A type 1 hypervisor owns the machine and is administered as a platform; a type 2 hypervisor is an application on a machine that already runs an OS.

It stops explaining once placement and mechanism come apart, as in current products they do both ways. A monitor may live inside an operating system’s kernel, as KVM does, so the machine has a host operating system and still no application-level monitor; a type 1 vendor may ship its product as an operating-system role, as Hyper-V is, so the label names a design decision rather than a visible layer. The label is also silent about what the definition cares about: whether the guest’s sensitive instructions all trap. Two products on the same side of the label can differ in exactly that, and it decides whether a guest escapes its machine.

Level and prerequisites

L3 — classification, its formal basis and limits: the reader must be able to say what makes software a VMM, what “virtualizable” tests, and why the two-type label answers neither. No hypervisor is deployed. Prerequisites: the layer vocabulary of Bare metal, operating system, hypervisor and workload: which layer does what (L1, same category) and the hardware virtualization feature named there.

Where to go next

  • Server & Virtualization — the area this sheet belongs to.
  • Hosts, VMs, vCPU, vRAM and virtual devices (L3) — what the monitor exposes to a guest.
  • vNIC, bridge and vSwitch: virtual networks on a host (L3) — how guest interfaces reach a network.
  • Later material: nested virtualization, PCIe/GPU passthrough, live migration, oversubscription (L4 and Projects).

References

Nodrius Field Kit — cover

Get the Nodrius Field Kit

Enter your email and we'll send you the complete Field Kit: eight technical resources in one download.

Your email address is sent to Nodrius and used to deliver the Field Kit to you by email. Marketing messages are separate and optional: the checkbox does not affect your download, and you are only added to our updates list if you tick it. Privacy Policy.

Privacy & cookies

This site does not use cookies, analytics or tracking, and it does not profile you. There is nothing technical to switch off, so Accept and Reject change nothing about how the site works: either choice lets you browse everything normally.

The only difference is what your browser remembers: two entries in local storage — your choice here, so this notice is not shown again, and a marker that the Field Kit offer has already been made — so the offer is presented once and not on every page. They contain no identifier, they are not shared with anyone, and the site sets no cookie for either.

What we do with your data
How your email address is used when you ask for a Resource, how long it is kept and which rights you have — in the Privacy Policy.
What the site stores in your browser
Two entries in local storage — your choice on this notice and whether the Field Kit offer has been shown — and no cookies, no session storage, no third-party content: in the Cookie Policy.