Why this exists
A VM gives each application a complete guest operating system. That supports different kernels and strong isolation, but duplicates OS memory, disk and maintenance. Lightweight virtualization keeps the useful isolation while sharing the host kernel.
What is shared and what is separated
Containers share the host Linux kernel. Namespaces give processes separate views of process IDs, networks, mounts, hostnames and selected identities. Cgroups limit resource consumption. A container therefore feels like a small machine to the application, while the host still sees ordinary processes.
| Mechanism | Main question |
|---|---|
| Namespace | What can this process see? |
| Cgroup | How much resource may it use? |
| Capability/security policy | Which privileged operations are allowed? |
VM versus container
| Property | VM | Container |
|---|---|---|
| Kernel | Separate guest kernel | Shared host kernel |
| Startup | Boots an OS | Starts processes |
| OS choice | Different OS families possible | Host-kernel compatible userspace |
| Isolation | Stronger boundary | Strong, but kernel is shared |
| Density | Lower | Higher |
The source’s claim that containers run “anywhere” should be read as deployment portability within compatible host and CPU-kernel conditions, not independence from the host kernel.
Common confusion
“Separate filesystem view” does not necessarily mean separate storage. A bind mount can expose the same underlying files through a different path. Likewise, a private network namespace does not impose a memory limit; a cgroup must do that.
Retrieval
Why does a container usually start faster than a VM? It does not boot a guest kernel and operating system; it starts an isolated process environment using the host kernel.
Can a container run a different kernel from the host? No. It can contain a different userspace, but its system calls are handled by the host kernel.
Source: Lecture 07 - Lightweight Virtualization - LXC and Docker, PDF pages 4-17. See also Linux Process Isolation and Container Assembly.