Closed twisteroidambassador closed 4 years ago
On further research, it seems like the /dev
directory inside the container is created by lxc.autodev
. I have not found an explicit setting of this option in the container config file, but the man page implies that lxc.autodev = 1
is default.
The man page also suggests using lxc.hook.autodev
to help populate /dev
. On the other hand, the lxc bug ticket here suggests using lxc.mount.entry
to bind mount the host's /dev/ppp
into the container. Looks like these two methods are the "canonical" way to add /dev
nodes.
The "canonical" way to add a /dev node to lxd seems to be using lxc config device
. I haven't tried if pppoe works, but the following line at least creates the /dev/ppp.
lxc config device add <container> ppp-device unix-char path=/dev/ppp
I have built an OpenWRT 18.06.5 template from this repo, and successfully created a container in Proxmox 6.1. Out of the box, PPPoE does not work, giving an error of "NO_KERNEL_SUPPORT". To fix this, I loaded the
pppoe
kernel module on the host, added the corresponding cgroup entry in the config file, and ranmknod /dev/ppp c 108 0
inside the container. This allowed PPPoE to work correctly, but after rebooting, the device file is no longer there, and I have to rerun themknod
command by hand.What is the proper way to add this device file automatically on boot? I tried, but haven't found what is responsible for creating device nodes in the container.
I imagine I can simply create a script in
/etc/init.d
, but is there a more "official" way?