VMs vs Containers
What's inside?
Your mission
Build the same app twice: once in virtual machines, once in containers. Put every layer in place yourself, then switch on X-ray vision to see how many operating systems each one carries. Launch more copies, compare how much of the server they use, and choose the right tool for each job.
Explore
Build both stacks from the bottom up: pick a part from the tray, then tap the stack it belongs to.
Virtual machines and containers both run applications in isolated environments, but they are built differently. Build both on the same kind of server, layer by layer, and find out what is really inside.
0 of 6 discoveries made
Experiment
Look inside with X-ray vision, launch more copies, and give both stacks some tricky jobs.
Side-by-side experiments
Try each one. They tick themselves off.
0 of 5 experiments done
Challenge
Six rounds: assemble both architectures, and choose the right tool for each job.
Packing notes
- VM: hardware → hypervisor → guest OS + app
- Container: hardware → host OS → container runtime → app + dependencies
- Each VM runs a complete guest OS
- Containers typically share the host OS kernel
- VMs: more overhead · containers: lighter weight
Finish all 6 rounds to finish this stage.
Understand
Here is what the two stacks were showing you, in the words you need for the exam.
Same goal, different build
Virtual machines and containers both help run applications in isolated environments, but they work differently. Each virtual machine runs a complete guest operating system on top of a hypervisor. Containers package an application and its dependencies, and typically share the host OS kernel through a container runtime.
The comparison
| Virtual machines | Containers | |
|---|---|---|
| Operating system | Each runs a complete guest OS | Typically share the host OS kernel |
| Overhead | More operating-system overhead | Generally lighter weight |
| Use case | Separate, independent computing environments | Packaging and running applications |
Key takeaway: VMs provide separate operating-system environments, while containers package applications and their dependencies for efficient deployment.
Why containers are lighter
With X-ray on, three VMs carried three operating systems, but three containers shared one. Every extra VM brings another complete OS that needs memory and storage; an extra container only brings the app and what it needs to run. (The memory numbers in the game were illustrative.)
When a VM is the right choice
When you need an independent computing environment with its own operating system, for example Windows and Linux side by side on one server. Containers on this server all shared its Linux kernel, so they couldn't each bring a different operating system.
Words to know
- Virtual machine (VM)
- A virtual computer with its own complete guest OS, created by a hypervisor.
- Guest OS
- The operating system inside a VM.
- Container
- A package of an application and its dependencies that shares the host OS kernel.
- Host OS kernel
- The core of the server's own operating system, shared by its containers.
- Container runtime
- The software that runs containers on the host OS.
- Dependencies
- The libraries and other software an application needs to run.
- Overhead
- The extra resources used just to run the environment, not the app itself.
Exam tip
For "VM or container?" questions, look for the clue in the requirement. A complete, independent guest operating system (or different operating systems side by side) means a virtual machine. A lightweight package of an app and its dependencies, or many copies of an app, means a container, because containers typically share the host OS kernel and are generally lighter. Name the difference in operating systems in your answer.