Bitzu

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

Single choice

What do all containers on a single Linux host share with each other?

  1. The host operating system kernel
  2. A dedicated guest kernel per container
  3. A hypervisor-emulated network card
  4. 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.

Select all that apply

Which statements about containers compared with VMs are true?

  1. They typically start faster because no guest OS has to boot
  2. They use the host kernel instead of a separate kernel each
  3. They need a hypervisor to run each container
  4. Each container ships its own full operating system kernel
  5. 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

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.

Download on the App StoreGet it on Google Play

More KCNA topics in this module