I'm facing the same problem as described in Can't load wireguard module, i.e.:
sudo modprobe wireguard
modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.15.0
Probably, installing all missing kernel headers would also solve the problem. However, invoking sudo apt-get install linux-headers-$(uname -r) (I've found several other sides recommending this as well) results in
[...]
0 aktualisiert, 729 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 4.117 MB von 4.129 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 30,8 GB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] n
I'm too lazy to translate, but the main issue here is 30,8 GB. That's a bit heavy prerequisite for a lightweight VPN service...
Generic headers are installed(sudo apt-get install linux-headers-generic), but did not resolve the problem.
I'm running on a pretty fresh (less than 4 weeks old) Unbuntu 18.04 LTS. uname -a gives (the relevant part):
4.15.0 #1 SMP Tue Jun 9 12:58:54 MSK 2020 x86_64 x86_64 x86_64 GNU/Linux
I'm pretty sure that there is a way to determine which of the hundreds of headers is required, but I fail to identify it.
Edit:
Here's the last part of the install log through apt-get:
It is likely that 4.15.0 belongs to a chroot's host
Building for 4.15.0 and 4.15.0-130-generic
Module build for kernel 4.15.0 was skipped since the
kernel headers for this kernel does not seem to be installed.
Building initial module for 4.15.0-130-generic
Done.
wireguard:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.15.0-130-generic/updates/dkms/
depmod...
DKMS: install completed.
wireguard (1.0.20200513-1~18.04.2) wird eingerichtet ...
Trigger für man-db (2.8.3-2ubuntu0.1) werden verarbeitet ...