We now have all the mechanisms —
A Type-1 or bare-metal hypervisor runs directly on the hardware, with no host OS beneath it; the VMs run on top. It owns the machine, so it is lean, fast, and has a small trusted computing base — the choice for servers and the cloud (VMware ESXi, Xen, Microsoft Hyper-V).
A Type-2 or hosted hypervisor runs as an ordinary application on top of a normal operating system (VirtualBox, VMware Workstation, Parallels). It is wonderfully convenient — you install it like any program on your laptop and keep using your desktop — but it goes through the host OS for scheduling and I/O, adding a layer of overhead. It is the choice for developers and desktops.
Then Linux blurred the line. KVM (Kernel-based Virtual Machine) is not a separate
hypervisor program at all — it is a kernel module that lets the Linux kernel use the hardware
One of virtualization's most magical tricks is live migration: moving a running VM from one physical host to another with barely a hiccup — used constantly in the cloud to drain a host for maintenance or rebalance load. The dominant technique is pre-copy:
It converges only if the VM dirties memory slower than the network can copy it; a write-heavy VM can thrash the pre-copy loop, which is why there is also post-copy (start on the destination immediately, fault missing pages across). Watch pre-copy shrink the dirty set round by round.
Yes — it is called nested virtualization, and it is more than a party trick. It is how
you run a Windows/WSL2 VM inside a cloud VM, how CI systems test hypervisors, and how confidential-computing
VMs layer. The hard part is that only the bottom hypervisor really has the hardware VT-x mode; the nested
(L1) hypervisor thinks it does, so the L0 hypervisor has to emulate the virtualization hardware
for it — shadowing the guest's VMCS structures and multiplexing the single real hardware mode. It works,
with a performance tax that grows with each level. That the abstraction composes at all — a VM believing
it is bare metal all the way down — is a small marvel of the
The textbook ranking — bare-metal beats hosted — is a fine rule of thumb, but KVM breaks the neat picture. KVM is hosted inside a full Linux kernel, which by the old taxonomy sounds like Type-2, yet it runs guests through the hardware virtualization modes directly and delivers essentially bare-metal performance — so it is usually classified Type-1. The lesson: the "Type-1 vs Type-2" box matters less than where the guest's instructions and I/O actually execute. If the fast path goes straight through hardware modes and virtio/passthrough, the label on the box barely matters; if it detours through an emulator or a host-OS syscall on every operation, it will crawl regardless of its "type."