• Customers
  • Pricing
  • Docs
Sign Up

Compute Glossary

How computers for agents work, from the hardware to the sandbox.

  1. Compute Glossary
  2. /
  3. Kernel

Namespace

Also called Linux namespace

Shared kernelNamespaces ANamespaces BProcesses, from PID 1Own file treeOwn network interface

A namespace is a Linux kernel feature that wraps one kind of global resource, such as process IDs or the network stack, so processes inside get their own instance. Processes in a namespace see only what it contains and cannot tell that anything else exists. The global resource still exists, and the host can see every namespace from outside. Some kinds nest, so processes in a namespace can create further namespaces inside it.

Namespaces change what a process can see, not how much it can use or which system calls it can make. A user namespace also grants privileges, but they reach only resources owned by its namespaces. They are therefore combined with control groups and system call filters to build a container. A process in its own namespace can still use all the memory and every core on the host, unless something else stops it. Namespaces are cheap to create compared with booting a machine, which helps containers start quickly.

A container is mostly a set of namespaces around a group of processes, so that it has its own file system and process tree. To the programs inside, it looks like a separate machine. Nothing new is booted, because the processes run on the host kernel like any others. Tools on the host still see them as ordinary entries in its process table.

Kinds of namespace

Kinds of namespace are the types of namespace that Linux offers, each covering one resource, and there are eight of them. A process belongs to exactly one namespace of each kind at a time. A process that never asks for a new one stays in the namespaces of its parent. Most processes on a host therefore share the initial namespace of every kind.

Each kind can be used alone or with others. A runtime that builds a full container gives it a new namespace of most kinds, while a simpler tool may only give a program its own mount tree. Web browsers on Linux use namespaces this way to fence off the processes that render web pages. Build tools give a build a fresh network namespace so that it cannot reach the internet.

The kinds were added to Linux one at a time over nearly two decades, with the mount namespace first and the time namespace last. Older kernels therefore lack some kinds, and a runtime checks which ones exist before it uses them. The user namespace took longest to finish, because it touches permission checks across the whole kernel. Containers built before it existed ran their root user as real root on the host.

NamespaceDescription
MountA mount namespace isolates the tree of mounted file systems.
PIDA PID namespace isolates process IDs, so the first process inside sees itself as ID 1.
NetworkA network namespace isolates network interfaces, addresses, routing tables and firewall rules.
UserA user namespace isolates user and group IDs, so root inside can map to an unprivileged user outside.
UTSA UTS namespace isolates the hostname and domain name.
IPCAn IPC namespace isolates System V message queues, semaphores and shared memory.
CgroupA cgroup namespace isolates which part of the control group tree a process sees as its root.
TimeA time namespace isolates the offsets of the boot-time and monotonic clocks.

Namespace creation

Namespace creation is done through system calls, either when a process starts or later. The clone call starts a new process in fresh namespaces, and a running process can move itself into new ones with unshare. A new PID namespace is the exception: it applies only to the children the process creates afterwards, and the same holds when joining one with setns. Each call takes flags that name the kinds of namespace to create, so one call can set up several at once. Creating most kinds needs privileges, unless the same call also creates a user namespace.

A process can also join a namespace that already exists with setns. A namespace lives as long as some process is in it or something else holds a reference to it. Each namespace appears as a file in the proc file system, and holding that file open is enough to keep it alive. Tools such as nsenter open that file to run a command inside a container that is already running.

A new network namespace starts with nothing but a loopback interface. A runtime typically gives it a virtual network interface paired with one on the host, so that traffic can leave. Packets then pass through the routing and firewall rules of the host, often with address translation on the way out. Without that link, a program in the namespace can only talk to itself.

Isolation limits

Isolation limits are what namespaces cannot protect against, and they come from the single kernel that every namespace shares. A kernel bug reached from inside a namespace affects the whole host. Some kernel state is not namespaced at all, such as loaded kernel modules and the system clock. A process allowed to change such state changes it for everyone.

User namespaces sharpen this trade-off. They let unprivileged users create containers without root on the host, but they also give code inside root-like powers over kernel features it could not otherwise reach. Root inside a user namespace may, for example, mount file systems or configure network devices that belong to its namespaces. Each of those paths runs kernel code that was once reachable only by the real root.

Those powers are a frequent source of kernel exploits. Some distributions restrict unprivileged user namespaces for this reason, and hardened sandboxes add seccomp filters or a virtual machine around them. The restriction can be as blunt as a kernel setting that turns them off, or a security module that allows them only for chosen programs. Either way, programs that rely on them, such as some browsers and rootless container tools, may stop working.

Related terms

  • Process
  • Control group
  • Seccomp
  • Container
  • Virtual network interface
PreviousMemory pageNextControl group

On this page

Compute Glossary
  1. Foundations
    • Sandbox
    • Virtual machine
    • vCPU
    • Block storage
    • Virtual network interface
    • Kernel
    • Hardware virtualization
    • Hypervisor
    • GPU
    • CPU core
    • Memory
    • CPU
    • Local disk
    • Network interface card
    • Compute
    • Workload
    • Latency
  2. Sandboxes
    • Isolation
    • Lifecycle
    • Snapshot
    • Persistence
  3. Virtualization
    • KVM
    • MicroVM
    • Container
  4. Hardware
    • Server
    • CPU architecture
    • CPU type
    • GPU memory
    • GPU model
    • Mac model
  5. Kernel
    • System call
    • Process
    • Memory page
    • Namespace
    • Control group
    • Seccomp
  6. Storage
    • Object storage
    • File system
  7. Networking
    • Egress control
    • SSH
  8. Infrastructure
    • Control plane
    • Scheduler
    • Overcommit
    • Preemption
    • Region
    • Capacity
    • Scale
  9. Agents
    • AI agent
    • Tool call
    • Untrusted code
  10. Reinforcement learning
    • Reinforcement learning
    • Environment
    • Rollout
    • Verifier
    • Reward hacking
    • Actor–learner architecture

Computersfor Agents

Isolated sandboxes for agent code,
ready in under 100 ms.

Start for Free

Subscribe to DotFiles Insider, our monthly digest of AI infrastructure news, deep dives, and Daytona product releases.

Company

  • About
  • Careers
  • Brand
  • Partners
  • Startup Program
  • Research Grants
  • Events
  • Contact

Product

  • Pricing
  • Docs
  • Changelog

Resources

  • Guides
  • Blog

Legal

  • DPA
  • SLA
  • Terms of Service
  • Privacy Policy
Trust Center
All Systems Operational