Virtual Machine
A virtual machine is a computer that does not exist as a physical device, but runs as a program on a real computer. It behaves like a standalone machine with its own operating system, but shares the hardware with other virtual machines.
A normal computer consists of components: processor, memory, hard drive. A virtual machine mimics exactly these components in software. So it is a computer that does not exist as a physical device, but only as a program on a real machine. Inside this simulated machine runs a complete operating system, for example Windows or Linux — that is, the software that manages all other programs. To this operating system, everything looks real. It doesn’t notice that its processor is in truth only an allocated share of a real processor.
Why one machine is enough for many customers
Servers in data centers are expensive and usually poorly utilized. A single service rarely needs the full performance of a machine. In the past, a lot of hardware stood around idle ninety percent of the time. With virtual machines, a large server can be split into ten or fifty smaller ones. Each customer gets their own machine, even though they all use the same hardware.
This is exactly what the entire cloud business is based on. When you rent a server from Amazon, Microsoft, or Google, you don’t receive a physical device. You get a virtual machine that is started within seconds. After an hour you can delete it again and only pay for that hour. This flexibility would be impossible with real hardware.
Also important is isolation. Each virtual machine is separated from the others. If one crashes or gets hacked, its neighbors on the same server remain unaffected. This separation is the reason why unrelated companies can share a machine at all.
The hypervisor as property manager
The central software is called a hypervisor. It sits between the real hardware and the virtual machines. Its job is distribution: it assigns each virtual machine computing time, memory, and storage space. You can imagine it as the property manager of an apartment building. It allocates apartments, watches over the boundaries between them, and makes sure no one cuts off the neighbor’s power.
When a program inside the virtual machine wants something from the hardware, the hypervisor intercepts this request. It checks it and forwards it to the real hardware. Modern processors have built-in helper functions for this. That’s why virtualization today only costs a few percent of performance, whereas in the past the loss was significantly greater.
A related technology is containers. They share the host’s operating system and only bring along the programs themselves. As a result, containers start in milliseconds instead of seconds and require less memory. However, the isolation between them is weaker than with virtual machines. A common misconception is that containers are simply the better option. In reality, it’s a trade-off between speed and security.
From the cloud bill to the school laptop
Virtual machines are most visible in the quarterly figures of tech companies. When cloud revenue is mentioned there, it largely refers to rented virtual machines. AI training, too, mostly runs on such instances, just with graphics cards attached for the computational work. Reports of scarce computing capacity refer to exactly these machines.
On your own computer, you encounter them through programs like VirtualBox or VMware. With these, you can start Linux in a window under Windows without touching the hard drive. Security researchers deliberately open suspicious files inside a virtual machine. If malware causes damage there, you simply delete the machine and start a fresh copy.