Menu

1 / 2

Unprivileged LXC + Docker: The runc Sysctl Permission Trap

DEV Community·Guatu·7 months ago
#aJCvxvaC
#proxmox#lxc#docker#sysctl#container
Reading 0:00
15s threshold

sysctl: setting key "net.ipv4.ip_local_port_range": Permission denied

I saw this error while trying to tune the network stack for a high-concurrency service running in Docker, which itself was hosted inside an unprivileged LXC container on Proxmox. The weird part? I was root inside the container.

I expected that since I had already enabled nesting=1 and keyctl=1 in the LXC configuration, Docker would have the necessary permissions to modify kernel parameters via runc . In a standard VM, this is trivial. In a privileged container, it just works. But in an unprivileged container, the user namespace mapping creates a wall that runc cannot climb.

What actually happened is a collision between systemd (v243+), runc , and the Linux kernel's security model for unprivileged user namespaces.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.