When run I get the following error in docker compose logs wireguard:
wireguard | [migrations] started
wireguard | [migrations] no migrations found
wireguard | ───────────────────────────────────────
wireguard |
wireguard | ██╗ ███████╗██╗ ██████╗
wireguard | ██║ ██╔════╝██║██╔═══██╗
wireguard | ██║ ███████╗██║██║ ██║
wireguard | ██║ ╚════██║██║██║ ██║
wireguard | ███████╗███████║██║╚██████╔╝
wireguard | ╚══════╝╚══════╝╚═╝ ╚═════╝
wireguard |
wireguard | Brought to you by linuxserver.io
wireguard | ───────────────────────────────────────
wireguard |
wireguard | To support the app dev(s) visit:
wireguard | WireGuard: https://www.wireguard.com/donations/
wireguard |
wireguard | To support LSIO projects visit:
wireguard | https://www.linuxserver.io/donate/
wireguard |
wireguard | ───────────────────────────────────────
wireguard | GID/UID
wireguard | ───────────────────────────────────────
wireguard |
wireguard | User UID: 1000
wireguard | User GID: 1000
wireguard | ───────────────────────────────────────
wireguard |
wireguard | Uname info: Linux 955d60f0ddc4 5.15.102-1-pve #1 SMP PVE 5.15.102-1 (2023-03-14T13:48Z) x86_64 x86_64 x86_64 GNU/Linux
wireguard | **** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****
wireguard | **** As the wireguard module is already active you can remove the SYS_MODULE capability from your container run/compose. ****
wireguard | mkdir: cannot create directory ‘/etc/wireguard’: Invalid argument
wireguard | ln: failed to create symbolic link '/etc/wireguard/wg0.conf': No such file or directory
wireguard | **** Server mode is selected ****
wireguard | **** External server address is set to example.com ****
wireguard | **** External server port is set to 51820. Make sure that port is properly forwarded to port 51820 inside this container ****
wireguard | **** Internal subnet is set to 10.13.13.0 ****
wireguard | **** AllowedIPs for peers 0.0.0.0/0 ****
wireguard | **** PEERDNS var is either not set or is set to "auto", setting peer DNS to 10.13.13.1 to use wireguard docker host's DNS. ****
wireguard | **** Server mode is selected ****
wireguard | **** No changes to parameters. Existing configs are used. ****
wireguard | [custom-init] No custom files found, skipping...
wireguard | .:53
wireguard | CoreDNS-1.10.1
wireguard | linux/amd64, go1.20, 055b2c3
wireguard | wg-quick: `/etc/wireguard/wg0.conf' does not exist
wireguard | s6-rc: warning: unable to start service svc-wireguard: command exited 1
Why is it trying to create /etc/wireguard/wg0.conf when it successfully creates /home/paul/appdata/wireguard/wg0.conf?
I have tried the same config on an a laptop running ubuntu 22.04 and I don’t get this error.
We do not test or support proxmox, but something related to it is preventing folder creation which causes the failure. You could start by verifying ls -asnl /home/paul/appdata/wireguard is owned by 1000:1000 . Beyond that, I’ve never touched proxmox and can’t venture a guess.
The issue is your container cannot create a folder inside of the container, as root (and thus can’t create a symlink in that folder). Which suggests your docker install has unexpected limitations. Maybe lxc issues if you’re using that?
I’m not too familiar with proxmox, but I’m pretty sure they recommend installing docker in a VM (other option is in LXC, but they recommend against it).
I am having the same problem, but as people have mentioned earlier, i think it is because i use lxc containers instead of virtual machine. I will be trying to do it on a virtual machine and hopefully it will work
I confirmed that the docker process is running as root with sudo ps aux | grep docker on the host machine (the LXC container in this case)
I then cloned the github docker-wireguard repo to build the image manually. Edited the ... /init-wireguard-confs/run file to add whoami right before the above commands. Resulting log:
Uname info: Linux f2c80a274cff 6.2.16-4-pve #1 SMP PREEMPT_DYNAMIC PVE 6.2.16-4 (2023-07-07T04:22Z) x86_64 GNU/Linux
**** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****
root
mkdir: cannot create directory ‘/etc/wireguard’: Invalid argument
ln: failed to create symbolic link '/etc/wireguard/wg0.conf': No such file or directory
**** Client mode selected. ****
So, it is definitely root. I opened a shell into the running container at that point to try and manually mkdir inside /etc/.
This works just fine:
mkdir -p /etc/any-random-name
When I try to create a directory named wireguard specifically, it gives the invalid argument error:
Unfortunately, as the devs of proxmox do not recommend running docker in an lxc container (they recommend docker in a vm) and we do not test lxc at all, this isn’t something we’re going to spend time on unless it can be reproduced by pure docker in a vm or on bare metal.
Note, whether we want to help or not, none of us use proxmox or lxc.
I understand. However the OP wasn’t running it inside LXC containers anyway, from what I understood they were running docker directly on the proxmox host machine.
Also same issue here, no proxmox involved:
github /linuxserver/docker-wireguard/issues/282
I will try it on a VM regardless, but that’s not solving this peculiar problem, even if it works on a VM. Where would one look to try and figure out a solution or a workaround?
to be perfectly honest, I’m not sure. We’ve never been able to reproduce the issue internally which makes it quite challenging to tshoot. It could be related to the storage driver being used… I don’t recall what that looks like in terms of errors/logs.
Thanks for the response. It sounds like it’s way more involved to dig into than I initially thought. For now I am using the workaround that itsnotv posted above:
(Can’t post a link to github anymore I guess, my previous posts were flagged/hidden too. For posterity, just go to post 11 above and apply the changes in the commit before manually building the docker image.)
I hope the workaround will still be implemented. I also still have the issue.
As a workaround I first start normally. It crashes. Then I add this line in the volumes:
$VOLDIR/wg/config/wg0.conf:/etc/wireguard/wg0.conf
And I restart.