Help With Errors Installing Wireguard

I am installing Wireguard VPN on my Pi-hole machine. This is a new Pi-hole installation, and my first attempt adding Wireguard.

I apologize if this is not the correct forum to be posting questions for Wireguard, but I could not find a better place. If there is a more appropriate location for posting, please let me know.

I am following this guide for installation:

Installing the WireGuard server
https://docs.pi-hole.net/guides/vpn/wireguard/server

While running the install command, I am seeing some unexpected errors. Here is the installation command, and below is the output showing errors (found near the end of the installation messages):

sudo apt-get install wireguard wireguard-tools wireguard-dkms

Command output:

Setting up dkms (2.6.1-4) …
Setting up raspberrypi-kernel-headers (1.20210303-1) ...
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.17+
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.17-v7+
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.17-v7l+
run-parts: executing /etc/kernel/header_postinst.d/dkms 5.10.17-v8+
Setting up wireguard-dkms (1.0.20210124-1~bpo10+1) ...
Loading new wireguard-1.0.20210124 DKMS files...
It is likely that 5.10.17-v7+ belongs to a chroot's host
Building for 5.10.17+, 5.10.17-v7+, 5.10.17-v7l+ and 5.10.17-v8+
Building initial module for 5.10.17+
Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch. This indicates that it should not be built.
Skipped.
Building initial module for 5.10.17-v7+
Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch. This indicates that it should not be built.
Skipped.
Building initial module for 5.10.17-v7l+
Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch. This indicates that it should not be built.
Skipped.
Module build for kernel 5.10.17-v8+ was skipped since the
kernel headers for this kernel does not seem to be installed.
Setting up wireguard-tools (1.0.20200827-1~bpo10+1) ...
wg-quick.target is a disabled or a static unit, not starting it.
Setting up wireguard (1.0.20200827-1~bpo10+1) ...
Processing triggers for man-db (2.8.5-2) ...
pi@pihole11:~ $

Are these benign errors which can be ignored or should I be concerned with them? If I should be concerned, what are my next steps to resolve?

You've used our guide and if there is an issue with it, we would like to find this out. I don't see anything wrong here.

We need some more details from you, like

  1. Which operating system is this?
  2. Which kernel are you using at the moment?
  3. Which kernels are installed on the system?
  4. Which kernel headers are installed on the system?

For question 1 run:

cat /etc/os-release

For question 2 run:

uname -a

For question 3 run:

dpkg --list | grep linux-image

For question 4 run:

dpkg --list | grep linux-headers

(note: the commands for 3 and 4 assume you are running on a Debian-based system which may be wrong)

I've seen the same error with the guide from the pi-hole team, so here my answers to your questions:

1:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

2:

Linux pihole 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l GNU/Linux

3:
This is blank, no entries

4:
Same as 3, no entries

@Frank_S This is still an issue with the operating system as failing to install a packet cannot really be a Pi-hole issue. If multiple users are affected, I guess they screwed something up. Wouldn't be the first time...

Question 1: Is your error also exactly this?

Question 2: Could you try

dpkg --list | grep raspberrypi-

?

Question 3: Does a reboot maybe resolve the issue (you should switch to the most recent kernel in this case)?

Had the same messages in two installations, in one case on a newly installed Raspberry Pi OS.
I just ignored them and so far didn't notice any obvious issue.

But I also have to say, I've installed WireGuard via the buster-backports.

Yes, I am getting exactly the same error:

It is likely that 5.10.17-v7+ belongs to a chroot's host
Building for 5.10.17+, 5.10.17-v7+, 5.10.17-v7l+ and 5.10.17-v8+
Building initial module for 5.10.17+
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Skipped.
Building initial module for 5.10.17-v7+
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Skipped.
Building initial module for 5.10.17-v7l+
Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch.  This indicates that it should not be built.
Skipped.
Module build for kernel 5.10.17-v8+ was skipped since the
kernel headers for this kernel does not seem to be installed.
Setting up wireguard-tools (1.0.20200827-1~bpo10+1) ...
wg-quick.target is a disabled or a static unit not running, not starting it.
Setting up wireguard (1.0.20200827-1~bpo10+1) ...
Processing triggers for man-db (2.8.5-2) ...

2:

dpkg --list | grep raspberrypi-
ii  libraspberrypi-bin             1.20210303-1                        armhf        Miscellaneous Raspberry Pi utilities
ii  libraspberrypi-dev             1.20210303-1                        armhf        EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV (headers)
ii  libraspberrypi-doc             1.20210303-1                        armhf        EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV (headers)
ii  raspberrypi-bootloader         1.20210303-1                        armhf        Raspberry Pi bootloader
ii  raspberrypi-kernel             1.20210303-1                        armhf        Raspberry Pi bootloader
ii  raspberrypi-kernel-headers     1.20210303-1                        armhf        Header files for the Raspberry Pi Linux kernel
ii  raspberrypi-net-mods           1.3.0                               all          Network configuration for the Raspberry Pi UI
ii  raspberrypi-sys-mods           20210310                            armhf        System tweaks for the Raspberry Pi

3:
reboot doesn't resolve the error

And im with you, this is not an issue from pi-hole. I don't like the raspian OS but it works here with pi-hole quite a time very well. I've ordered a second raspberry pi and if I get the time I will switch to an other distribution. But maybe the above information help to solve this. Thanks for your time.

Unfortunately, it doesn't seem we can do much.

is the kernel you are running, yet this kernel build is skipped

This may actually be right. Wireguard has to be compiled as external module for kernels that don't include it. Given the Raspberry Pi OS (ex Raspbian) kernel is already 5.10 and my memory seems to say Wireguard entered the kernel natively on 5.6 and beyond.


TL;DR: Looking at this, it seems everything is already fine and you can just omit installing the wireguard-dkms module these days. Please report back if everything else works as expected as I can adjust the guide to mention that wireguard-dkms is only needed for older systems.

2 Likes

Ok, thanks for your help, it seems to work nevertheless as mentioned from mibere:

sudo wg
interface: wg0
  public key: 1234XXX...
  private key: (hidden)
  listening port: 47111

I've followed the complete guide now and there where no other error messages, the server starts without any problems.

Edit:
I've added a client now and it works as expected. Maybe a short commend about the (well written) guide:
In the section "Create client configuration" the adding of text to the config file is done with the echo command, the step "Next, add your server as peer for this client:" is without the echo command and I've add this via sudo nano configfile.conf. For me as a beginner it was a little bit irritating. Maybe you can do some explanation/change here as well.

Yes. If I understand corresponding web pages correctly, users with kernel 5.6 or higher do not need to install wireguard-dkms.

Thanks for your reports, I'll make sure to update the guide soon(ish).

Thanks for taking a look. I see a number of comments. I added a few comments here at the beginning, and provided details to the questions answered below.

Additional notes.

  • This is a Raspberry Pi 3B+.
  • I have rebooted Pi-hole, but did not try the Wireguard install again after reboot, nor did I try to continue.
  • I built the Pi-hole in the last couple of weeks (downloaded image 3/21/2021 with kernel 5.4). I downloaded image from the Raspberry Pi downloads page (https://www.raspberrypi.org/software/operating-systems). At that time, it listed the download kernel as 5.4, but today I see kernel 5.10 available.

Answers to questions asked:

1) Which operating system is this?

cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

2) Which kernel are you using at the moment?

uname -a
Linux pihole11 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l GNU/Linux

3) Which kernels are installed on the system?

dpkg --list | grep linux-image

4) Which kernel headers are installed on the system?

dpkg --list | grep linux-headers

5) Output of this command: dpkg --list | grep raspberrypi-

dpkg --list | grep raspberrypi-
ii libraspberrypi-bin 1.20210303-1 armhf Miscellaneous Raspberry Pi utilities
ii libraspberrypi-dev 1.20210303-1 armhf EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV (headers)
ii libraspberrypi-doc 1.20210303-1 armhf EGL/GLES/OpenVG/etc. libraries for the Raspberry Pi's VideoCore IV (headers)
ii raspberrypi-bootloader 1.20210303-1 armhf Raspberry Pi bootloader
ii raspberrypi-kernel 1.20210303-1 armhf Raspberry Pi bootloader
ii raspberrypi-kernel-headers 1.20210303-1 armhf Header files for the Raspberry Pi Linux kernel
ii raspberrypi-net-mods 1.3.0 all Network configuration for the Raspberry Pi UI
ii raspberrypi-sys-mods 20210310 armhf System tweaks for the Raspberry Pi

Final thoughts

  • I downloaded the latest Raspberry Pi OS image which indicates it's kernel 5.10. Would it be better to re-image SD card with kernel 5.10 and start over?

I think it is not necessary to re-image the SD-Card or reinstall any other parts. Try to follow the rest of the tutorial, it works without any problems for me.
The conclusion from DL6ER and mibere seems to be correct, the kernel 5.10 has WireGuard already included and so it is not necessary to build the dkms module.

Thanks @Frank_S -- my SD card was build with kernel 5.4, so I am not sure if it includes Wireguard in this kernel.

Maybe I am misunderstanding?

Your kernel version is 5.10.17, that's the output of the uname command. So it is the same kernel version that I have. I think you may have updated the kernel to the latest version with "apt full-upgrade"? So as written, follow the guide and ignore the error messages. it will work fine.

Oh cool, thank you for pointing that out! Looks like I did the "apt full-upgrade" on a couple of my Pi devices, and it turns out I did on this one as well (confirmed in history). I will go ahead and continue through the remaining instructions and give it a try.

Thank you everyone!

1 Like
2 Likes

The change has been merged.