4

Installed wireguard in Xubuntu (Ubuntu 18.04.4 LTS) via PPA. The kernel module failed.

# modprobe wireguard
modprobe: FATAL: Module wireguard not found in directory /lib/modules/5.3.0-51-generic

I've searched a lot about this issue, but mostly found the poster either did not have kernel headers or they were mismatched. I checked and those on my system were fine.

When I checked

# dkms status 
wireguard, 1.0.20200506: added

Trying dkms build wireguard/1.0.20200506 Produced an error reported in the following log:

> DKMS make.log for wireguard-1.0.20200506 for kernel 5.3.0-51-generic (x86_64)
Tue May 26 19:11:14 PDT 2020
make: Entering directory '/usr/src/linux-headers-5.3.0-51-generic'
  CC [M]  /var/lib/dkms/wireguard/1.0.20200506/build/main.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20200506/build/noise.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20200506/build/device.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20200506/build/peer.o
In file included from /var/lib/dkms/wireguard/1.0.20200506/build/main.c:9:0:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h: In function ‘wg_reset_packet’:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h:107:2: error: implicit declaration of function ‘skb_reset_redirect’; did you mean ‘skb_do_redirect’? [-Werror=implicit-function-declaration]
  skb_reset_redirect(skb);
  ^~~~~~~~~~~~~~~~~~
  skb_do_redirect
In file included from /var/lib/dkms/wireguard/1.0.20200506/build/noise.c:10:0:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h: In function ‘wg_reset_packet’:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h:107:2: error: implicit declaration of function ‘skb_reset_redirect’; did you mean ‘skb_do_redirect’? [-Werror=implicit-function-declaration]
  skb_reset_redirect(skb);
  ^~~~~~~~~~~~~~~~~~
  skb_do_redirect
In file included from /var/lib/dkms/wireguard/1.0.20200506/build/device.c:6:0:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h: In function ‘wg_reset_packet’:
In file included from /var/lib/dkms/wireguard/1.0.20200506/build/peer.c:8:0:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h: In function ‘wg_reset_packet’:
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h:107:2: error: implicit declaration of function ‘skb_reset_redirect’; did you mean ‘skb_do_redirect’? [-Werror=implicit-function-declaration]
  skb_reset_redirect(skb);
  ^~~~~~~~~~~~~~~~~~
  skb_do_redirect
/var/lib/dkms/wireguard/1.0.20200506/build/queueing.h:107:2: error: implicit declaration of function ‘skb_reset_redirect’; did you mean ‘skb_do_redirect’? [-Werror=implicit-function-declaration]
  skb_reset_redirect(skb);
  ^~~~~~~~~~~~~~~~~~
  skb_do_redirect
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/var/lib/dkms/wireguard/1.0.20200506/build/main.o' failed
make[1]: *** [/var/lib/dkms/wireguard/1.0.20200506/build/main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/var/lib/dkms/wireguard/1.0.20200506/build/peer.o' failed
make[1]: *** [/var/lib/dkms/wireguard/1.0.20200506/build/peer.o] Error 1
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/var/lib/dkms/wireguard/1.0.20200506/build/device.o' failed
make[1]: *** [/var/lib/dkms/wireguard/1.0.20200506/build/device.o] Error 1
cc1: some warnings being treated as errors
scripts/Makefile.build:288: recipe for target '/var/lib/dkms/wireguard/1.0.20200506/build/noise.o' failed
make[1]: *** [/var/lib/dkms/wireguard/1.0.20200506/build/noise.o] Error 1
Makefile:1656: recipe for target '_module_/var/lib/dkms/wireguard/1.0.20200506/build' failed
make: *** [_module_/var/lib/dkms/wireguard/1.0.20200506/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.3.0-51-generic'

I don't know how to read this log or get further. Wireguard is installed on my router and our iPhones and works correctly there. But I need it on my laptop with Xubuntu-- any help greatly appreciated!

FedKad
  • 13,420
feffer
  • 41

2 Answers2

0

I had this precise problem yesterday on an AWS instance running Ubuntu Eoan. I believe the problem was that the system was still running an old kernel (5.3.0-1016-aws), which didn't have matching headers. After I rebooted, the system was running the 5.3.0-1019-aws kernel and was able to build the Wireguard module.

For diagnostic purposes, I ran apt list --installed | grep linux to see what kernel packages were installed, which is when I realized I was not running the kernel from the most recent package. (Run uname -a to see what kernel you are currently running.)

For what it's worth, this system is one of a pair, which is very convenient for experiments like this; obviously that doesn't help when you're dealing with your laptop -- and I am also having this problem on my laptop! I'll check the kernels on that machine and report back here... and this was not the solution for my laptop, running bionic aka Ubuntu 18.04. It is running the latest installed kernel, 5.3.0-7648-generic, and I'm still seeing the error /var/lib/dkms/wireguard/1.0.20200520/build/queueing.h:115:2: error: implicit declaration of function ‘skb_reset_redirect’; did you mean ‘skb_do_redirect’? [-Werror=implicit-function-declaration] in /var/lib/dkms/wireguard/1.0.20200520/build/make.log. I'll keep digging.

In response to the comment by ubfan1 about not using the PPA, I believe it is still necessary for Ubuntu ≤ 19.04 -- see https://www.wireguard.com/install/

Finally (?), I solved the problem on my laptop by running sudo do-release-upgrade -d and upgrading to Focal aka Ubuntu 20.04. This installed the 5.4.0-7629-generic kernel and now Wireguard is working again. This solution takes a little time and may be too disruptive for you, but seems fine.

bens
  • 1
0

The issue has "solved itself" -- the newest kernels in Xubuntu (Ubuntu 18.04.4 LTS), 5.3.0-59-generic seem to have WG support built in. Purging and re-installing WG (still from the PPA) now works. No kernel module is built, so the kernel support must be "built-in." Probably the WG devs did this. In any case, WG is now functional on this distro as well as Peppermint_10 which had a similar problem.

There is one remaining glitch. When the new kernel was brought in through the normal apt update process, it also installed another kernel, "5.3xxxxx-gke." This kernel became the GRUB default kernel. However, booting it, broke keyboard support in the login screen and beyond (at least on my MacBook converted to linux). A work-around: in the GRUB menu, choose Advanced and then select the 5.3.0-59-generic kernel. It will boot normally, have normal keyboard support and WG works fine.

feffer
  • 41