WireGuard server in Docker container impossible?

  • I have just tried 3 different images, but was unable to get WireGuard server working in LibreElec v12 @ RPi4. To be clear: I want to connect from outside (say phone as a client) to my network using Wiregard server running in the Docker container. I need that for a network where the router does not support WireGuard. It is an extreme situation where the link is often just 5 mbps so I hope WireGuard may work better than OpenVPN.

    AI concluded at the end it is impossible and that the ConMan is not allowing this. I have created multiple containers and they all work. I use downloaded containers, too.

    Is there a way to make WireGuard server running in container in LE12?

  • WireGuard is WireGuard and all ConnMan does is start the daemon with the config that you create. Nodes can be both client and server and since WireGuard is part of the kernel you don’t have to use ConnMan and can just script things as you need; and you can disable the ConnMan VPN service if that gets in the way. Adding containers to run binaries that already exist in the host OS is just adding overhead and complication to the process. Stop using dumb AI tools and learn how WireGuard works; it will save you time in the end.

  • Thanks, that is the answer I needed. I am a programmer and it is clear that AI does not and can never have a bit of intelligence. But it is a great search engine, finally. I was hoping there is no need for intelligence to install Wireguard, so AI can find it! Just follow some recipe and that is something AI does well, as I can fix problems along the way when actual intelligence is needed. That failed.

    I was hoping to avoid learning Wireguard since I just wanted to try if Wireguard would help in this single particular situation.

    So, Wireguard can be set as a server in LibreElec and I do not need containers? Or I script in a container? Any pointers to reading material or how to start?

  • So, Wireguard can be set as a server in LibreElec and I do not need containers? Or I script in a container? Any pointers to reading material or how to start?

    As WireGuard operates at Layer2 and Layer3, there is no higher (Layer) server component/application involved. It is nothing more than a network interface configured from userspace using the wg binary and a config file. The config file contains the public/private keys for communications and configured knowledge of other peer nodes in the mesh network. Once the WireGuard interface is up you can route traffic to/from the interface using normal ip commands. The config file may also have other information used by the wg-quick script (referenced in most HOWTO guides) to create the interface and set routing. LE does not bundle wg-quick as it does not work; it assumes a standard Linux desktop and fails with our read-only OS packaging. However, all wg-quick does is dump some files in /etc/wireguard then run wg and ip commands. If want to know more about it, find a copy on the internet.

    In all seriousness, I would start here: https://lmgtfy.com/?q=how+does+wireguard+work%3F - because WireGuard is more like IPSeC than OpenVPN and if you do not understand how it works you will flail around looking for an 'easy' button that doesn't exist (as it is not required). Everything needed is embedded in the OS and /storage is your persistent writeable $home folder, and you can use all the standard Linux tools like systemd services to start things on boot. You can also install containers; but that only adds overhead and the abstraction of containers (most users don't understand those either).