2

There is lxd-3.0.3 unprivileged (containers with uid shift started by root) on Ubuntu-18.04 (amd64). In container there is Ubuntu-16.04.5 (amd64). How to configure pptpd on it? It seems that there is problem with ppp0 interface. It is not available.

Here if fragment of log:

Feb 13 19:21:22 blabla100 pppd[25943]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
Feb 13 19:21:22 blabla100 pppd[25943]: Couldn't open the /dev/ppp device: No such file or directory
Feb 13 19:21:22 blabla100 pptpd[25927]: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/
Feb 13 19:21:22 blabla100 pptpd[25927]: modprobe: FATAL: Module ppp_generic not found in directory /lib/modules
Feb 13 19:21:27 blabla100 pptpd[25927]: /usr/sbin/pppd: You need to create the /dev/ppp device node by
Feb 13 19:21:27 blabla100 pptpd[25927]: executing the following command as root:
Feb 13 19:21:27 blabla100 pptpd[25927]:         mknod /dev/ppp c 108 0
Feb 13 19:21:27 blabla100 pppd[25935]: You need to create the /dev/ppp device node by
                                    executing the following command as root:
                                            mknod /dev/ppp c 108 0

So I guess I must create /dev/ppp on host, but how to allow to access it only in this container, not other containers.

1 Answers1

2

The Unix character device /dev/ppp on the host is the way you can access the kernel module for ppp.ko. Therefore, you need to get LXD to link that character device into the LXD container. Here is how it's done:

$ lxc config device add mypptpcontainer mypppdevice unix-char source=/dev/ppp uid=0 gid=0 mode=0600

where:

  1. mypptpcontainer is the name of your LXD container.
  2. mypppdevice is just a name for this LXD device. Pick any name.
  3. the rest specify the characteristics of the unix character device.
Simos
  • 904