Menu

Post image 1
Post image 2
1 / 2
0

Unprivileged LXC + Docker: The runc Sysctl Permission Trap

DEV Community·Guatu·28 days ago
#aJCvxvaC
#proxmox#lxc#docker#sysctl#container#host
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. When you run an unprivileged LXC, the root user inside the container is actually a non-privileged user on the Proxmox host (usually UID 100000).…

Continue reading — create a free account

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

Read More