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.

MechanismMain question
NamespaceWhat can this process see?
CgroupHow much resource may it use?
Capability/security policyWhich privileged operations are allowed?

VM versus container

PropertyVMContainer
KernelSeparate guest kernelShared host kernel
StartupBoots an OSStarts processes
OS choiceDifferent OS families possibleHost-kernel compatible userspace
IsolationStronger boundaryStrong, but kernel is shared
DensityLowerHigher

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.