
Emulation vs Virtualization vs Containers Explained
Emulation translates a foreign CPU, virtualization runs guest code natively under a hypervisor, and containers share the host kernel. Here is how they differ.
Tag
6 posts

Emulation translates a foreign CPU, virtualization runs guest code natively under a hypervisor, and containers share the host kernel. Here is how they differ.

chroot only changes how a process resolves paths, while pivot_root swaps the mount namespace's root and lets you unmount the old one. Why containers need that.

Use unshare and nsenter from a shell to create and join Linux namespaces, and watch hostnames, process lists and mounts change inside a new one.

Linux has eight namespace types: mount, PID, network, IPC, UTS, user, cgroup and time. Each one gives a process its own view of one kind of kernel resource.

Build a working Linux container runtime in C: namespaces, a pivot_root rootfs, cgroup v2 limits, veth networking, seccomp, and what runc adds on top.

Build a Linux process sandbox layer by layer: drop root and capabilities, add namespaces, seccomp, Landlock, cgroups and systemd limits, then test what escapes.