KCNA ยท Containers and images
Containers vs virtual machines
Isolation model, startup time, density, kernel sharing vs hypervisor; when each fits.
Key points
- A virtual machine runs a full guest operating system, with its own kernel, on virtual hardware provided by a hypervisor.
- A container is an isolated process (or group of processes) that shares the host's kernel and bundles only the app and its dependencies.
- That makes containers smaller, faster to start and denser per host, while VMs give stronger isolation and can run different operating systems.
Practice questions
What do all containers on a single Linux host share with each other?
- The host operating system kernel
- A dedicated guest kernel per container
- A hypervisor-emulated network card
- A private copy of the host filesystem
Show answer
Answer: A. The host operating system kernel
Containers are processes on the same host, so they use the host kernel. Each VM, by contrast, boots its own kernel; containers do not have separate init systems or virtual hardware.
Which statements about containers compared with VMs are true?
- They typically start faster because no guest OS has to boot
- They use the host kernel instead of a separate kernel each
- They need a hypervisor to run each container
- Each container ships its own full operating system kernel
- More of them usually fit on one host than VMs
Show answer
Answer: A. They typically start faster because no guest OS has to boot, B. They use the host kernel instead of a separate kernel each, E. More of them usually fit on one host than VMs
Containers skip booting a guest OS, so they start quickly and pack densely, and they share the host kernel. A container does not carry its own kernel, and a hypervisor is the VM mechanism, not a container requirement.
True or false: a container image includes the operating system kernel it runs on.
Show answer
Answer: False
False. An image holds the app, libraries and a root filesystem, but the running container uses the kernel of the host.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
