1

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 ...
nirolo
  • 21
  • 7
  • Did you rebuild the driver once you'd installed the headers? If so, look carefully through the build output for the error. With a successful install, the module will appear under that directory. – Stephen Boston Jan 10 '21 at 09:59
  • I'm not sure, what you mean by "rebuild the driver". I've removed and reinstalled wireguard throught apt-get - without any change. Did you mean that? If not, which driver do you refer to? I'll amend the question with the output of that procedure. – nirolo Jan 10 '21 at 13:14
  • The wireguard installer tries to build its module but does not have headers for 4.15.0. You are installing for your current kernel but not for 4.15.10 which it looks like wireguard wants. What happens if you install those headers `apt install linux-headers-4.15.0` and then re-install wireguard. – Stephen Boston Jan 10 '21 at 15:40
  • 1
    @StephenBoston `sudo apt-get install linux-headers-$(uname -r)` resolves to `sudo apt-get install linux-headers-4.15.0`. This is where my problem starts, it wants to install all headers matching that regular expression, which would mean 30 GB of headers... For the sake of completeness: `apt install linux-headers-4.15.0` yields the same. Quick edit: You are writing "4.15.10" once, is that a typo or did I miss a place where wireguard wants 4.15.10 and not 4.15.0? – nirolo Jan 12 '21 at 19:28
  • Is this by chance a STRATO server? Sitting in front of the same problem and are greeted with 40 gigs of headers ... I was able to extract some kernel version that matches one of the linux headers from the dkms build log: ```Loading new wireguard-1.0.20201112 DKMS files... It is likely that 4.15.0 belongs to a chroot's host Building for 4.15.0 and 4.15.0-166-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-166-generic Done ``` So I installed `4.15.0-166-generic`,but modprobe fails – hgross Jan 17 '22 at 20:38
  • 1
    Hi @hgross , yes it is a STRATO server. I have to admit, that I completely stopped bothering after some point. I did not manage to get it running. – nirolo Jan 22 '22 at 09:34
  • Same for me. I hit some barriers building wg for the actually booted kernel and then I asked the support. They told me that on Strato VPS servers it is not possible to install new kernel modules and therefore installing wireguard is not possible at all. They recommended OpenVPN ... Moved over to Oracle Cloud's free tier. Got everything up and running in 30 minutes over there. Later I found out that I could have just rtfm to avoid the pain :-) https://www.strato.de/faq/server/kernel-module-bei-unseren-linux-servern/ – hgross Jan 23 '22 at 01:14

2 Answers2

1

I just learned, based on @hgross comment above, that is impossible on my setting. He correctly identified that we both tried to run it on a STRATO hosted virtual server and after having a look into the manual he posted the link to https://www.strato.de/faq/server/kernel-module-bei-unseren-linux-servern/ I'm sure that it is impossible to get wireguard running on the server I have.

nirolo
  • 21
  • 7
1

To build upon the existing answer (and for no rep gain thanks to community wiki-ing this), the English translation of the STRATO documentation page for the kernel access on machines says the following:

With our dedicated Linux servers, it depends on the hardware and the distribution which kernel modules you find.

You can of course set up your own kernel modules on dedicated servers.

With virtual Linux servers, access to the kernel and thus the use of own kernel modules is not possible.

Unless you are paying STRATO for dedicated servers, you are getting vServers or Virtual Servers which are likely being run inside 'container' like space, where the kernels are exposed from the host and NOT able to be altered inside the running machines.

Wireguard does not have any non-kernel-module solution as it does not have a fully non-Kernel-dependent stack to work. Unfortunately, as a result, **you cannot install Wireguard on these virtual servers because they are not fully managed and rely on the host OS, which you cannot modify. This is, unfortunately, quite common for VPS providers who do not do full virtualization (via KVM or similar).

Thomas Ward
  • 72,494
  • 30
  • 173
  • 237