CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 1 of 7 · 1 min read

Why this page comes fourth

In this module you will

  • Define a namespace and say what it isolates and what it does not.
  • Name the eight kinds of namespace on Linux and what each one hides.
  • Create a PID, UTS and network namespace with unshare and with a short C program, and read the output.
  • Explain why the first process in a new PID namespace has number 1.
  • Explain how a user namespace gives root inside and nothing outside.

Pages 1 to 3 gave each guest its own kernel, which is strong and heavy. This page starts the other way to isolate programs: one kernel that tells different groups of processes different stories. It builds on the process tree of Level 1, the mount tree of Level 9 and the users and capabilities of Level 10. Page 5 adds limits on how much each group may use, and page 6 puts both together into a container.

About this example About this example

Real: The C program, the unshare commands, lsns and the /proc listings were run on the Linux test machine (kernel 6.18). The program was compiled with gcc -Wall -Wextra and run as root. The user-namespace test ran as the user nobody through setpriv.

Scripted: The host name box and the story of a service that wants its own network are made up to give the work a shape.

Not real: The test machine is itself a guest with a container layer, so the namespace numbers shown differ from any other machine. The test did not set up a bridge or a virtual network pair, so the new network namespace has only a loopback device.