1

I have a docker container that I'm trying to run pppd inside of. The host kernel has CONFIG_PPP=y. I'm setting up the ppp device like this:

mkdir /run/container/dev
mknod /run/container/dev c 108 0
... add some more devices here ...

Then I'm starting the container with a volume mount of /run/container/dev:/dev. The container is run with --privileged and processes inside the container run as root.

When I try to run pppd inside the container it fails:

/ # pppd
Couldn't open the /dev/ppp device: Operation not permitted
pppd: Sorry - this system lacks PPP kernel support

strace suggests that the problem is EPERM when trying to open /dev/ppp:

openat(AT_FDCWD, "/dev/ppp", O_RDWR|O_LARGEFILE) = -1 EPERM (Operation not permitted)
getpid()                                = 76
sendto(3, "<27>Jul 14 09:55:08 pppd[76]: Co"..., 89, 0, NULL, 0) = -1 ENOTCONN (Socket not connected)
connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 12) = -1 EPROTOTYPE (Protocol wrong type for socket)
write(1, "Couldn't open the /dev/ppp devic"..., 58Couldn't open the /dev/ppp device: Operation not permitted) = 58
write(1, "\n", 1
)                       = 1
writev(2, [{iov_base="pppd: Sorry - this system lacks "..., iov_len=52}, {iov_base=NULL, iov_len=0}], 2pppd: Sorry - this system lacks PPP kernel support

) = 52 getpid() = 76 sendto(3, "<27>Jul 14 09:55:08 pppd[76]: So"..., 75, 0, NULL, 0) = -1 ENOTCONN (Socket not connected) connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 12) = -1 EPROTOTYPE (Protocol wrong type for socket) exit_group(4) = ?

What am I missing here?

Tom
  • 604

1 Answers1

0

Eventually tracked this down to needing --device-cgroup-rule="c 108:0 rwm" on the docker command-line.

Tom
  • 604