Part 2 of 6 · 2 min read
Virtual machines
Think of a large house split into flats. Each tenant has a front door, a kitchen and a bathroom, and believes the flat is the whole house. The landlord owns the real building, the pipes and the wiring, and decides who gets how much. The analogy stops in one place: a landlord can walk into any flat, and a hypervisor also sees all the memory of its guests, so a guest must trust it.
In plain words: A virtual machine (VM) is a software copy of a complete computer: processors, memory, disks and devices. A guest operating system installs on it and runs as if on real hardware. The program that creates and runs virtual machines is the hypervisor (or virtual machine monitor). A type 1 hypervisor runs directly on the hardware and is the only thing there besides its guests (Xen, VMware ESXi, and KVM, which turns the Linux kernel into one). A type 2 hypervisor runs as an ordinary program on a host operating system (VirtualBox, VMware Workstation, QEMU without KVM). The machine that does the hosting is the host, and the system inside the VM is the guest.
A worked example. A server with 64 GiB of memory and 16 cores runs 8 guests. Each guest gets 2 virtual processors, 8 GiB and a virtual disk, so the guests together are promised 8 x 8 = 64 GiB and 16 virtual processors. Each guest boots its own kernel, with its own processes and file systems (Levels 1 to 9). A crash or an attacker in one guest does not touch the others, because the hypervisor keeps their memory apart.
The key lines. The hypervisor is the new most-privileged program. Everything it protects, it protects with the same ideas as an ordinary kernel does: separate address spaces, privilege levels and a small trusted part.
Hypervisor
A hypervisor (virtual machine monitor) is a program that creates virtual machines and shares the real processors, memory and devices among them, while keeping each guest apart from the others and from the host.
Example: KVM, with the QEMU program, runs each guest as one Linux process.
Check yourself: 1. What is the difference between a host and a guest? 2. Give one type 1 and one type 2 hypervisor. 3. Why must a guest trust the hypervisor?