Skip to content

Podman rootless mode — what actually happens under the hood

A deep dive into Podman rootless: user namespaces, subuid/subgid arithmetic, slirp4netns vs pasta, fuse-overlayfs storage, and the systemd-user services that keep it alive.

The marketing pitch for rootless Podman is “containers without root”. The operational reality is a stack of user namespaces, FUSE-mounted overlays, user-space network stacks, and systemd-user services that you need to understand to debug a production incident at 3 a.m. This article walks the layers from the inside out.

How to verify

A rootless Podman host that is configured correctly will answer these probes consistently:

podman info --format '{{.Host.IDMappings.UIDMap}}'
cat /proc/$(pgrep -f "podman.*pause" | head -1)/status | grep -E "Uid|Gid"
sysctl kernel.unprivileged_userns_clone
loginctl show-user $USER | grep Linger
ss -tlnp 2>/dev/null | grep slirp4netns
cat /etc/subuid | awk -F: -v u=$USER '$1==u {print $2, $3}'

kernel.unprivileged_userns_clone=1 is the kernel switch that allows the rootless flow at all. If it’s 0 (Debian historically defaulted that way) nothing rootless works. Linger=yes keeps the user’s systemd instance alive after logout, which keeps long-running containers up.

What’s happening

When a non-root user runs podman run, the binary first calls clone(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWPID | ...). The new user namespace is set up with a UID map: in the simplest case 0 → 100000, 1 → 100001, … up to 65535 → 165535. From inside the container, processes running as UID 0 are root; from the host, they are actually running as UID 100000. Files created inside the container with UID 1000 are stored on the host as UID 101000.

The 65 536 range comes from /etc/subuid and /etc/subgid. These ranges are allocated when a user is created (useradd writes them) and are immutable for the user’s containers. If two users share an overlapping subuid range, they can read each other’s container files — which is why production fleets reserve disjoint, non-overlapping ranges per host user.

Networking is the next layer. The container starts in a fresh network namespace with no host bridge access. Rootless cannot create a veth pair on the host because that needs CAP_NET_ADMIN. Two user-space approaches solve this: slirp4netns runs a TCP/IP stack inside a process that has one end as a tap device in the container and the other as plain UDP on the host. pasta (the newer option, default on Fedora 38+ and Podman 4.4+) does the same job with much higher throughput and proper IPv6 by default.

Storage is the third layer. Overlay mounts in the kernel require root, so rootless Podman uses fuse-overlayfs — a FUSE filesystem that emulates the overlay semantics in user space. Slower than kernel overlay but works without privileges. On kernels 5.11+ a true rootless overlay exists (overlay driver with mount_program unset) and is faster; Podman uses it automatically when available.

The mental model

Picture each rootless container as a process tree owned by your shell:

your shell (UID 1000)
└── podman run
    └── conmon (UID 1000)
        └── crun → setns into namespaces
            └── nginx (UID 0 in container, UID 100000 on host)
                └── worker (UID 33 in container, UID 100033 on host)

Now picture the namespaces stacked beside it:

  • User namespace: maps 0..65535 (container) to 100000..165535 (host).
  • Mount namespace: mounts the FUSE-overlay rootfs at the container’s /.
  • Network namespace: has only lo and a tap0 from slirp4netns/pasta.
  • PID namespace: container’s PID 1 is conmon-spawned, host sees it as some PID 80000-ish.

When this fails, it’s usually one of: subuid range too small (containers need more than 65 535 UIDs for some images), XDG_RUNTIME_DIR gone after logout, or a kernel without user_namespaces compiled in (rare on modern Ubuntu, common on stripped-down VPS kernels).

Operational notes

  • Lingering matters. Without loginctl enable-linger, the user’s systemd instance is torn down on the last SSH session close. Every container dies. Always enable lingering on service-account hosts.
  • Quadlets over --restart=always. Generate systemd-user units with podman generate systemd (legacy) or write Quadlet .container files in ~/.config/containers/systemd/. The latter is the modern path.
  • Network performance. slirp4netns tops out around 2-3 Gbps single-stream; pasta reaches near line-rate. If you see slow ingress, check which one is active with podman info | grep -i network.
  • Subuid exhaustion. An image with useradd 200000 will fail to extract because the GID is outside the user’s subgid range. Allocate at least 65 536, prefer 524 288 on hosts that host multiple workloads.
  • Storage growth. ~/.local/share/containers/storage grows with every image pull. Run podman system prune -a periodically; rootless cannot use the cron-style cleanup that root daemons get.
  • Audit trail. Every container action is logged in the user’s journal (journalctl --user), not the system journal. Shippers like journald configured for root will miss it — see Loki promtail for the per-user pattern.

Common pitfalls

  • Assuming --privileged works rootless — it cannot, because the privileges you can grant are bounded by what the host user has.
  • Trying to bind-mount a host path you do not own. The container will see the file but writes will fail with EPERM because the namespace ID-shifts the owner.
  • Forgetting that rootless containers cannot use the host network namespace meaningfully — --net=host gives you the user’s network namespace, not the actual host bridge.
  • Running podman as root once “to debug” and then back as a user — the two storage trees are completely separate and confusion follows.
  • Building images with RUN apt-get install and a USER 1000 directive whose UID is outside the subuid range. The build silently corrupts the resulting layer.

Stack Harbor runs rootless Podman for clients who need container isolation without trusting the daemon-equivalent root privilege Docker requires — see clustered environments for how we standardise the subuid maps, the Quadlet units, and the FUSE-overlay storage on fleets of hosts.