operating-systems virtualisation
Definition
Namespace
A namespace is a Linux kernel abstraction that wraps a global system resource so that processes inside the namespace see an isolated instance of that resource.
Changes made to the resource are visible to other processes in the same namespace but are invisible to processes outside it.
Namespaces are the foundation of Linux OS-level virtualisation and were introduced in 2008.
Types
Namespace types
Type Isolated resource Example mntfile system mount points each container has its own /tmpor/varpidprocess IDs each container has its own init(PID 1) and/procnetnetwork interfaces, routing, firewall each container has its own loopback device ipcinter-process communication two containers can create shared memory with the same name utshostname and domain name each container has its own hostname cgroupcontrol group view processes in a container cannot see host cgroup directories useruser and group IDs, capabilities rootinside a container may be an unprivileged user outside
Creating namespaces
The
unsharecommand can create a new namespace and run a program inside it.