Rootless Podman runs containers as an unprivileged user, so a bind‑mount that works for root often fails with “Permission denied.” That error is usually a mismatch between the host directory’s ownership/permissions and the container’s user namespace. Below is a quick checklist that gets the mounts working again while keeping the isolation tight.
Common Causes
| Cause | Why it happens | Typical symptom |
|---|---|---|
| File ownership | The host directory is owned by root or another UID that the container’s user can’t read/write. | mount: permission denied or open /data/file: Permission denied inside the container. |
| SELinux/AppArmor context | The host directory’s security context blocks the container’s process. | Same “Permission denied” even when file permissions look right. |
| User‑namespace mapping | Podman maps container UID 0 to a non‑zero host UID. If the host directory is owned by root, the mapped UID has no rights. | Error appears only when --userns=keep-id is omitted. |
| Mount options | Using :Z/:z incorrectly or omitting them when SELinux is enabled. |
SELinux denies the mount, causing the error. |
Quick Fixes
-
Match ownership
[Read More]