Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Virtualization & Hypervisors
OS

Virtualization & Hypervisors

How one physical server runs multiple OSes: Explore the architecture of Type 1 and Type 2 hypervisors.

Virtualization lets a single physical machine run multiple operating systems simultaneously. Each guest OS (the “VM”) thinks it has its own CPU, memory, disk, and network — but the hypervisor is multiplexing real hardware.

The Hypervisor (VMM)

The hypervisor (or Virtual Machine Monitor) is the software layer that creates and manages VMs.

TypeArchitecturePerformanceUse case
Type 1 (Bare-metal)Runs directly on hardwareNear-nativeData centers, cloud (AWS, Azure)
Type 2 (Hosted)Runs as an application on a host OSLower (host OS overhead)Development, testing, personal use

Type 1 Hypervisors

Examples: VMware ESXi, Microsoft Hyper-V, Xen, KVM (Linux).

The hypervisor IS the operating system. It handles CPU scheduling, memory allocation, and I/O for all guest VMs. No general-purpose OS layer beneath it.

Type 2 Hypervisors

Examples: Oracle VirtualBox, VMware Workstation, Parallels.

The hypervisor runs as a process on top of Windows/Linux/macOS. The host OS manages the real hardware; the hypervisor just asks the host OS for resources.

CPU Virtualization

The challenge: guest OS expects to execute privileged instructions (which require ring 0). The hypervisor must trap these and emulate them safely.

Hardware-assisted virtualization (Intel VT-x, AMD-V) adds a new CPU mode (root/non-root) — guest code runs directly on the CPU, with sensitive instructions automatically trapping to the hypervisor. This is why modern virtualization is fast.

Paravirtualization

The guest OS is modified to be “virtualization-aware” — it makes hypercalls directly to the hypervisor instead of trying privileged instructions. This eliminates the trap-and-emulate overhead.

Containers vs VMs

Virtual MachineContainer
Abstraction levelHardwareOS kernel
GuestFull OSUser-space processes
SizeGBsMBs
Boot timeMinutesSeconds
IsolationStrong (separate kernel)Moderate (shared kernel)
ExampleVMware, KVMDocker, containerd

Q: In simple terms, what is virtualization?

A: It lets you run multiple independent operating systems on a single physical machine. Each VM thinks it has its own hardware — but the hypervisor is sharing the real hardware among all VMs.

Q: What’s the difference between Type 1 and Type 2 hypervisors?

A: Type 1 runs directly on hardware (like an OS) — used in data centers for performance. Type 2 runs as an application on top of an existing OS — used for development and testing.

Q: How is a container different from a VM?

A: A VM virtualizes the hardware — each guest includes a full OS with its own kernel. A container virtualizes the OS — all containers share the host kernel. Containers are smaller (MB vs GB) and start faster (seconds vs minutes) but have weaker isolation.

Q: How does hardware-assisted virtualization work?

A: Intel VT-x adds a new “guest” mode. The guest OS code runs directly on the CPU at near-native speed. When the guest executes a privileged instruction (like page table switch), the CPU automatically traps to the hypervisor without requiring binary translation or paravirtualization.

My Private Notes

Notes are auto-saved locally to this device.