When you run a virtual machine, you deploy a complete guest operating system.

Figure 1 – A VM carries its own guest OS
With a container, you package only your application and its dependencies.
It runs on a container engine directly on the host OS.
Figure 2 – A container carries only the application and its libraries
Both isolate applications, but containers eliminate the guest operating system entirely.
Answer the question below
What does a VM include that a container does not?
Answer the question below
A server runs 10 VMs. How many guest operating systems does it run?
The kernel manages your server hardware: CPU, RAM, and storage disks.
Every container you deploy shares the single kernel of your host OS.
Figure 3 – Every container shares the host OS kernel
The container engine starts, stops, and isolates your containers.
When your application requests hardware resources, the host kernel executes the operation.Answer the question below
Three containers run on the same host. How many kernels do they use?
Answer the question below
A container writes a file to the disk. Whose kernel does the work: the container's or the host's?
With no guest OS to boot, your container starts in seconds.
It uses significantly less disk space and memory on your host than a VM.However, sharing a kernel reduces isolation between workloads.
If the host kernel crashes, every container you run stops immediately.
Figure 4 – If the host kernel fails, every container stops
Answer the question below
The host kernel crashes. How many of its containers keep running?
Answer the question below
Each workload needs its own kernel. VM or container?
You run a container from an image.
An image is a static template holding your application code and libraries.You store the image once, and every container you launch from it is an identical copy.

Figure 5 – One image, three identical containers
To run three web servers, you start three containers from that single image.
Answer the question below
What do you start a container from?
Answer the question below
You need five identical web servers. How many images do you store?
Feature
Virtual Machine
Container
What you package
Application, libraries, and guest OS
Application and libraries only
Storage footprint
Gigabytes
Megabytes
Startup time
Minutes
Seconds
Kernel model
Dedicated kernel per VM
Shared host kernel
Execution layer
Hypervisor (ESXi, KVM)
Container engine (Docker, containerd)
Table 1 – Virtual machines vs containers
In production, you often run containers inside VMs to combine fast deployment with strong hardware isolation.
Answer the question below
Which one starts faster: a VM or a container?
Answer the question below
Docker is an example of which component?