NOTE

Linux Namespace

1. History of Linux Namespace Linux kernel version 2.4 supported mount namespace. Linux kernel version 2.6 supported most namespaces, such as IPC, Network, PID, and UTS. Linux kernel version 3.8 supported User namespace. 2. What Is Linux Namespace? l

Operating Systems / LinuxCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. History of Linux Namespace

  • Linux kernel version 2.4 supported mount namespace.
  • Linux kernel version 2.6 supported most namespaces, such as IPC, Network, PID, and UTS.
  • Linux kernel version 3.8 supported User namespace.

2. What Is Linux Namespace?

limits what you can see A Linux kernel feature that isolates the resources a process can see. These resources include process IDs, hostnames, user IDs, file names, network access, IPC, etc.

3. Linux Namespace Categories

3.1. Mount (mnt)

Filesystem mount points.

3.2. Process ID (pid)

Process IDs.

3.3. Network (net)

Network devices, protocol stacks, ports, etc.

3.4. Interprocess Communication (ipc)

System V IPC, POSIX message queues, etc.

3.5. UTS

Hostname and NIS domain name.

3.6. User ID (user)

User IDs and group IDs.

4. Why Linux Namespace Is Needed

Support virtualization through resource isolation, such as container technology.

5. How to Use Linux Namespace

5.1. View the namespace a process belongs to

/proc/[pid]/ns

5.2. clone()

Create a new process.

5.3. setns()

Allow a specified process to join a specific namespace.

5.4. unshare()

Disassociate the calling process from its current shared execution context, such as namespaces, and create new context according to the specified flags.

7. Linux Namespace Principle

8. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub