Operating Systems Level 14
PART 4 • SYSTEMS & CAREER

Isolate Workloads without Wasting the Machine

Understand how hypervisors virtualize hardware and how containers isolate processes while sharing one kernel. Compare performance, compatibility, density and security boundaries instead of treating either model as universally better.

Level 14 of 15 Advanced 120–150 minutes Architecture decision lab
BY THE END, YOU CAN

Defend an isolation choice

  • Explain Type 1 and Type 2 hypervisors.
  • Trace privileged guest operations.
  • Connect namespaces and cgroups to containers.
  • Interpret images and writable layers.
  • Choose a suitable boundary for a workload.
01 • HARDWARE VIRTUALIZATION

A Virtual Machine Receives a Hardware-Like Interface

TYPE 1

Bare-metal hypervisor

Runs directly on hardware and manages guest VMs. Data centres favour this design for control, predictable overhead and strong operational tooling.

TYPE 2

Hosted hypervisor

Runs above a host OS. It is convenient for desktop labs, but guest I/O passes through additional host layers.

GUEST

Complete operating system

Each VM owns a guest kernel, virtual CPUs, virtual memory and virtual devices. Different OS families can share one physical server.

Mechanism What is virtualized? Key OS idea Main cost
Trap and emulate Privileged operations Hypervisor handles sensitive instruction Transitions
Hardware assist CPU execution modes Guest runs directly until a controlled exit VM exits
Nested paging Guest physical memory Guest mapping plus host mapping reaches RAM Translation/TLB pressure
Virtual device Disk/network interface Emulation or paravirtual driver performs I/O Copying and exits
02 • OS-LEVEL VIRTUALIZATION

A Container Is an Isolated Process Group, Not a Tiny VM

NAMESPACES

Control what processes see

PID, mount, network, IPC, UTS, user and cgroup namespaces create separate views of global kernel resources.

CGROUPS

Control what processes consume

Account for and limit CPU, memory, I/O and process counts. A namespace changes visibility; a cgroup changes resource policy.

FILESYSTEM

Images plus writable layer

Read-only image layers are shared. Copy-on-write gives each running container a private writable layer; persistent data belongs in volumes.

container = processes + namespaces + cgroups + filesystem view image ≠ running container shared kernel ≠ no isolation
1

Build an immutable image

Pin dependencies, use a minimal trusted base and avoid embedding secrets.

2

Create isolated process state

The runtime prepares namespaces, cgroups, mounts, capabilities and security policy.

3

Start the declared process

The application becomes the container's PID 1 and must handle signals and child reaping correctly.

4

Observe and replace

Logs, metrics and health checks reveal state; deployments replace failed or outdated instances.

03 • ARCHITECTURE DECISION LAB

Choose the Boundary from Workload Requirements

READY

Select a workload

The recommendation will balance boundary strength, compatibility, startup time and density.

04 • SECURITY & OPERATIONS

Isolation Is a Layered Claim, Not a Checkbox

REDUCE PRIVILEGE

Drop root and capabilities

Run with the smallest identity and capability set, make filesystems read-only where practical and block privilege escalation.

REDUCE REACH

Segment networks and secrets

Default-deny traffic, mount only necessary data and inject short-lived secrets rather than baking credentials into images.

REDUCE EXPOSURE

Patch every layer

Scan dependencies and images, update host kernels/runtimes and verify image origin. A stale base layer remains vulnerable.

Dimension Virtual machine Container
Kernel Separate guest kernel Shares host kernel
Startup Usually seconds or longer Usually faster
Density Lower due to guest OS overhead Higher for similar services
OS compatibility Can run a different guest OS Must use compatible host kernel
Security boundary Typically stronger kernel separation Requires careful kernel/runtime hardening
05 • LIFECYCLE TRACE

Trace a Container from Image to Stopped Process

CONTAINER ·

06 • CHECK & PREPARE

Ten Virtualization Questions

Answered correctly: 0 of 10
UNIVERSITY
  1. Compare hypervisor types.
  2. Explain trap and emulate.
  3. Describe nested paging.
  4. Explain namespaces.
  5. Explain cgroups.
INTERVIEW
  1. Container versus VM?
  2. Why is PID 1 special?
  3. Why are volumes needed?
  4. Can a container run any OS?
  5. How do you isolate untrusted code?
PRACTICE
  1. Inspect namespaces.
  2. Set a memory limit.
  3. Build a minimal image.
  4. Handle termination signals.
  5. Document a threat model.
LEVEL 14 SUMMARY

You Can Compare Isolation Architectures

  • Hypervisors multiplex hardware among complete guest operating systems.
  • Containers isolate process groups while sharing the host kernel.
  • Namespaces control views; cgroups account and limit consumption.
  • Images are immutable templates; containers add runtime state.
  • Real security combines boundaries, least privilege, patching and monitoring.
COURSE CHECKPOINT

Mark complete after defending a VM/container choice from explicit requirements.

Saved in this browser.