Virtualisation and Containers
The comparison that gets tested is what a container shares with the host and what a virtual machine does not. Everything else follows from that one difference.
Virtualisation and Containers · firsttry.app/cheatsheets/virtualization-and-containers · original reference written from published exam objectives. Not affiliated with any certification body.
Virtual machines against containers
| Property | Virtual machine | Container |
|---|---|---|
| Includes | A full guest operating system | Application and its dependencies only |
| Kernel | Its own | Shares the host kernel |
| Size | Gigabytes | Megabytes |
| Start time | Tens of seconds to minutes | Under a second |
| Isolation | Strong. Hardware-level boundary | Weaker. Process-level boundary |
| Density per host | Tens | Hundreds |
| Runs a different OS | Yes | No. Linux containers need a Linux kernel |
| Best for | Legacy applications, strong isolation, mixed operating systems | Microservices, CI, horizontal scaling |
Hypervisor types
| Type | Runs on | Examples |
|---|---|---|
| Type 1 (bare metal) | Directly on the hardware | ESXi, Hyper-V (role), Proxmox, KVM |
| Type 2 (hosted) | On top of an operating system | VirtualBox, VMware Workstation, Parallels |
| Performance | Type 1 is faster, no host OS in the path | |
| Use | Type 1 for servers, Type 2 for desktops and labs |
Docker commands
| Command | What it does |
|---|---|
| docker ps -a | All containers, including stopped ones |
| docker images | Local images |
| docker run -d -p 8080:80 nginx | Run detached, publish host 8080 to container 80 |
| docker exec -it NAME sh | Shell inside a running container |
| docker logs -f NAME | Follow a container's logs |
| docker build -t name:tag . | Build an image from a Dockerfile |
| docker rm / docker rmi | Remove a container, remove an image |
| docker volume ls | List volumes. Where persistent data lives |
| docker system prune | Reclaim space from unused objects |
Virtualisation terms
| Term | Meaning |
|---|---|
| Snapshot | Point-in-time state. Not a backup |
| Template / golden image | A base to clone new machines from |
| Thin provisioning | Allocates storage as it is used |
| Overcommit | Assigning more virtual resource than physically exists |
| VM sprawl | Machines created and never decommissioned |
| VM escape | Breaking out of a guest into the hypervisor |
| Live migration | Moving a running machine between hosts |
| Resource pool | Shared CPU and memory allocated to a group |
Exams covered
Now test yourself
Memorizing a table is a start. Practice questions are what make it stick, and every answer carries the full explanation.