One or more virtual "guest" machines run on a physical "host" machine. Each virtual machine runs its own operating system and functions separately from the other VMs, even when they are all running on the same host. This means that, for example, a virtual MacOS virtual machine can run on a physical PC.
VMs create isolated environments on a host system through a hypervisor layer (Illustration by John Aplessed)
A Virtual Machine (VM) is like a computer inside your computer. Imagine you're a developer who needs to test software on Windows, but you're running macOS — or you want to run an isolated Linux server without touching your host system. A VM lets you spin up a full operating system (OS) in a sandboxed environment, without needing new hardware.
Think of it as a box-within-a-box: it acts like a real machine, but it's just software.
A virtual machine is a software emulation of a physical computer. It runs an operating system and applications just like a physical machine does. The virtualization layer — called a hypervisor — allocates slices of your system's actual hardware (CPU, memory, disk) to these virtual environments.
There are two types of hypervisors:
VMs emulate entire operating systems. Containers (e.g., Docker) share the host OS kernel but isolate applications. VMs are more isolated and secure, while containers are faster and more lightweight. You often choose one over the other based on the trust boundary and performance requirements.
VMs helped define cloud computing. AWS EC2, for example, was built entirely on virtual machines for years — allowing thousands of users to share physical servers safely and predictably.