A topic in the Open Knowledge Graph — a free, open map of 15,495 topics and the order to learn them in.

Virtual Machines and Hypervisors

College Depth 107 in the knowledge graph ☐ I know this ☆ Set as goal
386prerequisites beneath it
See this on the map →
Processes and the Process Control BlockSystem Calls and User/Kernel Mode+2 more→
virtualization virtual-machines hypervisor VMM trap-and-emulate containers cloud

Core Idea

A virtual machine (VM) is a software-created computer that runs a complete guest operating system as if it had real hardware to itself. A hypervisor, also called a virtual machine monitor (VMM), creates the VMs, divides the real CPU, memory and devices among them, and keeps them isolated from one another. Type 1 hypervisors run directly on the hardware, while Type 2 hypervisors run as applications on a host operating system. Virtualization is how cloud providers run many customers' systems safely on shared servers.

How It's Best Learned

Install a Type 2 hypervisor and boot a second operating system in a window, then look at the host's process list to see the whole VM appear as ordinary processes. Connect the mechanism to what students know about user mode, kernel mode and traps: walk through what happens when the guest kernel executes a privileged instruction. Finish by contrasting a VM with a container on the same machine, focusing on which kernel each one uses.

Common Misconceptions

Explainer

You know that an operating system runs user programs in a restricted CPU mode and keeps kernel mode for itself. When a program needs something privileged, it makes a system call or causes a trap, and the kernel takes over. Virtualization applies the same trick one level lower. The hypervisor takes the most privileged position on the machine, and whole operating systems run beneath it as guests.

Each virtual machine sees a virtual CPU, virtual memory and virtual devices such as a disk and a network card. The guest OS boots, schedules processes and manages memory as usual. Most of its instructions, such as additions, loads and branches, run directly on the real CPU at full speed. The hypervisor steps in only when the guest tries something that would affect the real machine, such as changing page tables, disabling interrupts or talking to hardware.

The classic mechanism is trap-and-emulate. The guest kernel runs without full privilege, so a privileged instruction traps to the hypervisor. The hypervisor then performs the equivalent action on that VM's virtual state and resumes the guest. In 1974 Gerald Popek and Robert Goldberg showed this works when every sensitive instruction is also privileged, so that it always traps. The original 32-bit x86 broke this rule: some sensitive instructions ran in user mode without trapping. Engineers worked around it with binary translation, which rewrites those instructions on the fly, and paravirtualization, which modifies the guest to call the hypervisor directly. In the mid-2000s Intel VT-x and AMD-V added hardware support, and later extensions such as Intel's Extended Page Tables let the hardware translate guest memory addresses efficiently.

Hypervisors come in two broad types. A Type 1 or bare-metal hypervisor, such as VMware ESXi, Microsoft Hyper-V or Xen, runs directly on the hardware and is common in data centers. A Type 2 or hosted hypervisor, such as VirtualBox or VMware Workstation, runs as an application on an ordinary OS and is common on desktops.

Virtualization brings strong isolation, since a crash or attack inside one VM stays inside it. It allows consolidation, many lightly used servers sharing one physical machine. It also allows snapshots and live migration, moving a running VM to another host. Containers offer a lighter alternative: they share the host kernel and isolate only processes, files and network views, which makes them faster to start but less isolated than full VMs.

Practice Questions 4 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Overflow and Underflow Detection → Binary Adders: Half-Adders and Full-Adders → Full Adder and Carry Propagation → Carry Lookahead Adder Design → Half Adder Circuit Design → Multiplication Circuit Design → Sequential Circuit Design → Registers and Register Files → Instruction Set Architecture (ISA) → Assembly Language Basics → Memory Organization and Addressing → Memory Address Decoding → Memory Bus Architecture and Interconnect → I/O Systems and Buses → Interrupts and Direct Memory Access (DMA) → Exception and Interrupt Handling Architecture → Virtual Machines and Hypervisors

Longest path: 108 steps · 386 total prerequisite topics

Prerequisites (4)

Leads To (0)

No topics depend on this one yet.