vpncloud icon indicating copy to clipboard operation
vpncloud copied to clipboard

Documentation for LXC containers post-install or post-configuration about additional requirements? (Proxmox Example)

Open Lyamc opened this issue 3 years ago • 0 comments

When setting up within a LXC container, such as with proxmox, the service will fail to start due to missing the tun interface,

I propose that after install, or after configuration, either add a general note to the user, or, use systemd-detect-virt to check if the user is within a container environment and then provide the appropriate instructions.

For example, I use proxmox, and the LXC container information is stored as such: /etc/pve/lxc/.conf After install, I was unable to start the service:

ERROR - Failed to open virtual tap interface vpncloud%d: No such device (os error 19)

This can be solved by appending the following lines to the LXC container's configuration

lxc.mount.entry: /dev/net dev/net none bind,create=dir
lxc.cgroup2.devices.allow: c 10:200 rwm

Here's a single command to paste in the proxmox host:

id=123
tee -a "/etc/pve/lxc/$id.conf" << EOF
lxc.mount.entry: /dev/net dev/net none bind,create=dir
lxc.cgroup2.devices.allow: c 10:200 rwm
EOF

pct reboot "$id"
pct enter "$id"

Lyamc avatar Jun 11 '22 01:06 Lyamc