
Hardware: actual CPU, memory, disk, network.
Hypervisor: carves hardware into isolated VMs. (creates/manages VMs)
VM: runs a full OS on virtual hardware (that hypervisor manages).
Guest OS: the OS inside a VM. (each one has its own kernel)
Host OS: your Macβs OS
Container: isolated process using the host/VM kernel running on daemon.
2 types of hypervisors
- type 1 baremetal - installed directly on physical hardware
- type 2 hosted - installed on host OS

2 types of VMs
- Process VM
- ex: JVM, cpython
- virtualizes runtime, not hardware
- userspace
- Hypervisor VM
- ex: baremetal VM or hosted VM
- virtualizes hardware
- kernel
Kernel
- core component of OS
- manages hardware
- used by hosted VM hypervisor

Hypervisor details
Type 1 β Bare Metal (e.g., VMware ESXi) Hypervisor runs directly on hardware, without a general-purpose host OS underneath it.
- Hypervisor boots directly on physical hardware.
- Hypervisor creates a VM and allocates physical RAM/CPU resources.
- (shared steps)
Type 2 β Hosted (e.g., VirtualBox, VMware Workstation) Hypervisor runs on top of a regular host OS.
- Host OS boots and manages physical hardware.
- Hypervisor software runs using host OS services.
- Hypervisor creates a VM; host OS helps allocate memory and manage device I/O.
- (shared steps)
shared steps
- Guest OS boots inside the VM.
- Guest OS maintains page tables: Guest Virtual β Guest Physical.
- Hypervisor configures second-stage page tables: Guest Physical β Machine Physical.
- stores in memory, gives register to CPU so CPU can enforce
- CPU uses both mappings to access physical memory, enforcing isolation in hardware.
- Guest OS processes have their own virtual address space
- Guest OS page tables map guest virtual β guest physical
- Guest OS maintains a page table
- Guest OS maps process virtual address address to Guest physical address (still virtual but emulates RAM)
- Hypervisor will map guest physical -> machine physical
- maps the VM guest OS physical address -> machine physical address space
- stores that configuration in memory
- gives a special CPU register pointer to that memory
- when CPU runs instruction from a VM process, it walks through that special register and VM to address space memory -> enforces at the hardware level that VM can only access it's own memory space and not any others