TransWikia.com

PiVPN (WireGuard) not working after updating to Buster

Raspberry Pi Asked by olhptr on December 22, 2021

A few days ago, I have updated my Raspberry PI 3 model B device from Stretch to Buster.
Previously I installed and configured successfully PiVPN with WireGuard, so it has been working before the update.
So I started to debug what happened.


pivpn -d said:

::::        Self check       ::::
:: [OK] IP forwarding is enabled
:: [OK] Iptables MASQUERADE rule set
:: [ERR] WireGuard is not running, try to start now? [Y/n] y
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
Done
:: [OK] WireGuard is enabled (it will automatically start on reboot)
:: [ERR] WireGuard is not listening, try to restart now? [Y/n] y
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
Done

So, I tried to restart WireGuard, but nothing happened…


systemctl status [email protected] said:

[email protected] - WireGuard via wg-quick(8) for wg0
   Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-04-21 23:15:42 CEST; 4min 28s ago
     Docs: man:wg-quick(8)
           man:wg(8)
           https://www.wireguard.com/
           https://www.wireguard.com/quickstart/
           https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
           https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
  Process: 3881 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=1/FAILURE)
 Main PID: 3881 (code=exited, status=1/FAILURE)

ápr 21 23:15:41 raspberrypi systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
ápr 21 23:15:41 raspberrypi wg-quick[3881]: [#] ip link add wg0 type wireguard
ápr 21 23:15:42 raspberrypi wg-quick[3881]: RTNETLINK answers: Operation not supported
ápr 21 23:15:42 raspberrypi wg-quick[3881]: Unable to access interface: Protocol not supported
ápr 21 23:15:42 raspberrypi wg-quick[3881]: [#] ip link delete dev wg0
ápr 21 23:15:42 raspberrypi wg-quick[3881]: Cannot find device "wg0"
ápr 21 23:15:42 raspberrypi systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
ápr 21 23:15:42 raspberrypi systemd[1]: [email protected]: Failed with result 'exit-code'.
ápr 21 23:15:42 raspberrypi systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

Maybe something happened during loading WireGuard kernel files, so I tried this sudo modprobe wireguard command and I got this:

modprobe: ERROR: could not insert 'wireguard': Unknown symbol in module, or unknown parameter (see dmesg)

What should I do?

Where can I start the investigating?

Thank you for your reply in advance.

2 Answers

I got this same error message after running rpi-update instead of managing the kernel updates with apt. rpi-update offers a newer kernel than what apt can offer headers for, so you wind up with kernel headers that don't match your kernel version... and don't have the Wireguard interface type available. This is probably the same conflict you got when you did the upgrade.

Recently (apparently), the foundation has started providing headers for their advanced kernel. According to the online documentation:

If you are compiling a kernel module or similar, you will need the Linux Kernel headers. These provide the various function and structure definitions required when compiling code that interfaces with the kernel.

sudo apt install raspberrypi-kernel-headers

Note that it can take quite a while for this command to complete, as it installs a lot of small files. There is no progress indicator.

Installing that and rebooting helped me when I had the same error message, and it might work in OP's case too.

Answered by Keith on December 22, 2021

As official noted by the Raspberry Pi Foundation at Updating and upgrading Raspbian there is no support given for an upgrade from Jessie to Stretch. This should also be true for an upgrade from Stretch to Buster:

Upgrading an existing Jessie image is possible, but is not guaranteed to work in every circumstance. If you wish to try upgrading a Jessie image to Stretch, we strongly recommend making a backup first — we can accept no responsibility for loss of data from a failed update.

The safest way to solve your problem is to start over again with a fresh flashed Raspbian Buster image. As @JaromandaX commented you can also try to deinstall PiVPN (and wireguard?) and install it again in the hope it will find the new Buster environment and fit better to it.

Answered by Ingo on December 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP