How virtual machines work: Virtualization and hypervisors
Virtualization creates virtual versions (guests) of physical hardware (hosts) by letting multiple VMs share hardware resources. A virtual machine monitor (hypervisor) manages this process by coordinating CPU time, allocating physical resources like memory and storage, and translating requests into machine code that the physical hardware can execute.
Every request a VM makes—reading memory, writing to disk, or sending network traffic—passes through the hypervisor. This is how cloud platforms safely run thousands of workloads on shared physical hardware. Without this layer, virtualization—and much of modern cloud computing—would not be possible.
Two common virtualization stacks show how these layers relate on a physical machine:
- Physical hardware → Hypervisor → Virtual machine (guest OS)
- Physical hardware → Host OS → Hypervisor → Virtual machine (guest OS)
In some respects, system virtual machines extend the concept of virtual memory—which gives each process the illusion of its own dedicated memory space—to the entire machine, so each VM appears to have dedicated hardware resources.
This approach is foundational to cloud computing. It enables cloud providers to deliver infrastructure as a service (IaaS), offering virtualized servers, storage, and networking that scale on demand.
Core responsibilities of a hypervisor
- Scheduling access to CPU, memory, storage, and networking so multiple VMs can run efficiently on the same physical machine
- Enforcing resource limits and priorities so no VM consumes more than its allocated resources or affects the performance of others
- Providing hardware abstraction, which allows VMs to run different guest operating systems regardless of the host’s underlying hardware
- Maintaining isolation so that issues within one VM—such as crashes or unsafe files—do not impact other VMs or the host environment
Tech tip: what “isolation” really means
Isolation doesn’t just separate workloads—it protects them. If a test VM crashes, the host and other VMs continue running. This is one reason developers rely on VMs for safely testing changes.
Deep dive: Type 1 vs. Type 2 hypervisors
A hypervisor comes in two main forms, each suited for different environments and use cases.
Type 1: Bare-metal hypervisors
- Run directly on the physical machine's hardware (or convert the host kernel into a hypervisor, as KVM does)
- Provide strong performance and stability
- Have direct access to host hardware for better performance
- Common in data centers and cloud service providers
- Examples: VMware ESXi, Microsoft Hyper-V (Server), KVM
Type 2: Hosted hypervisors
- Run as applications on top of a host OS like Windows, macOS, or Linux
- Useful for trying out a new operating system without replacing your existing one
- Ideal for personal use, testing, and development
- Examples: VirtualBox, VMware Workstation, and Parallels Desktop
Tech tip: choosing the right type
- Use Type 1 for production workloads.
- Use Type 2 for a simple, local way to run another operating system
Deep dive: Types of virtual machines
Virtual machines come in two forms, but most real-world infrastructure relies on system virtual machines.
Process virtual machines
Process VMs—also called application virtual machines—provide a managed runtime environment for applications rather than virtualizing full operating systems. Examples include Java Virtual Machine (JVM) and .NET CLR.
System virtual machines
A system VM behaves like a complete computer—it runs its own OS, applications, and virtual hardware. It is created from a guest OS image that defines the operating system and base configuration for the VM. These are the VMs used in cloud computing data centers, such as AWS EC2, Azure Virtual Machines, and Google Compute Engine.
System VMs rely on hypervisors like VMware ESXi, Hyper-V, and KVM to run multiple isolated environments on shared physical host machines.
Common examples include:
- A Linux VM running a web server.
- Windows virtual machines powering internal business apps.
- A temporary VM for testing updates or patches.
- A legacy operating system preserved for compatibility.
System VMs are the “virtual computers” this guide focuses on.