Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireguard not starting because of wrong kernel-headers? #11

Closed
garret opened this issue Jan 5, 2019 · 12 comments
Closed

Wireguard not starting because of wrong kernel-headers? #11

garret opened this issue Jan 5, 2019 · 12 comments

Comments

@garret
Copy link

garret commented Jan 5, 2019

I was very happy to found out about your script on DrZZZ stream though I cannot get it working on my raspberry pi 3 B+. I am using dietpi as distribution. That is updated to the latest version.

I followed the initial part (before choosing for manual or semiautomatic script) and everything seems fine (I get the blue messages you show). I then went for the semiautomatic script but I get this error:

root@livingroom:~/wg_config# sudo wg-quick up wg0
[#] ip link add wg0 type wireguard
RTNETLINK answers: Operation not supported
Unable to access interface: Protocol not supported
[#] ip link delete dev wg0
Cannot find device "wg0"
root@livingroom:~/wg_config#

I found out that the wireguard module is not loaded:

root@livingroom:~# sudo modprobe wireguard && lsmod | grep wireguard
modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.14.90-v7+

This is probably due to the kernel-headers installed do not correspond to the kernel I am using probably?

root@livingroom:~# sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.14.90-v7
E: Couldn't find any package by glob 'linux-headers-4.14.90-v7'
E: Couldn't find any package by regex 'linux-headers-4.14.90-v7'
root@livingroom:~#

Do you know how I could fix this issue? Thank you very much in advance!

@adrianmihalko
Copy link
Owner

Hi enzo,

"kernel-headers installed do not correspond to the kernel". Yes, this is the problem. For whatever reason your distributions ships different kernel headers than the current one.

I think your best option is:

1, install kernel source with rpi-source:

https://github.com/notro/rpi-source

2, use raspbian

Hope it helps.

@adrianmihalko
Copy link
Owner

0,
You wrote linux-headers-$(uname -r), but on raspbian it is actually: raspberrypi-kernel-headers - but maybe you are right and your distro is using the classic linux-headers-* package.

@garret
Copy link
Author

garret commented Jan 5, 2019

I can see that I have also installed the package raspberrypi-kernel-headers

root@livingroom:~# sudo apt-get install raspberrypi-kernel-headers
Reading package lists... Done
Building dependency tree
Reading state information... Done
raspberrypi-kernel-headers is already the newest version (1.20181112-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@livingroom:~#

I guess I have to change distro... Thank you very much for your fast support!! 👍

@adrianmihalko
Copy link
Owner

adrianmihalko commented Jan 5, 2019

We can try to debug this, but I think the result will be the same raspberrypi-kernel-headers is different version than the actual kernel. If you want to debug this, you can find me on Discord. Or you can always try to install sources with rpi-source, I used this some months ago.

@garret
Copy link
Author

garret commented Jan 6, 2019

I am seeing that it should be possible to install wireguard on dietpi. I will try to ask support there since it deals with their distro.

https://github.com/Fourdee/DietPi/issues/2052

@adrianmihalko
Copy link
Owner

adrianmihalko commented Jan 6, 2019

Cool, I hope you find a solution. If not, you can always contact me. I am closing this issue for now. :)

@joevo2
Copy link

joevo2 commented May 25, 2020

Have the same issue :( on RPI 3 as well

@Rohlik
Copy link

Rohlik commented May 28, 2020

Also having this problem on RPi3+:

#apt-get install  "linux-headers-$(uname -r)"
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.19.114-v7
E: Couldn't find any package by glob 'linux-headers-4.19.114-v7'
E: Couldn't find any package by regex 'linux-headers-4.19.114-v7'
#uname -r
4.19.97-v7+

@ukaeufe
Copy link

ukaeufe commented Jun 1, 2020

I updated raspbian and reinstalled wireguard and wireguard-dkms and it worked again after a reboot:
sudo -i
apt-get upgrade
apt-get update
apt install --reinstall wireguard
apt install --reinstall wireguard-dkms
reboot

sudo wg show wg0

works again

@joevo2
Copy link

joevo2 commented Jun 2, 2020

I updated raspbian and reinstalled wireguard and wireguard-dkms and it worked again after a reboot:
sudo -i
apt-get upgrade
apt-get update
apt install --reinstall wireguard
apt install --reinstall wireguard-dkms
reboot

sudo wg show wg0

works again

Thanks! somehow it worked!

@Msprg
Copy link

Msprg commented Sep 13, 2020

For anyone struggling still with this issue, try:

sudo -s
apt update
apt install git bc bison flex libssl-dev -y
#This one will take a loong time
wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update
rpi-source
apt remove wireguard wireguard-dkms wireguard-tools -y
reboot

lastly, after reboot:

#This might take just forever also...
sudo apt install wireguard -y

I was running those on RPi0w. Yeah, big mistake, took like an hour to be done... But it works!

@foxpup
Copy link

foxpup commented Nov 20, 2020

For anyone struggling still with this issue, try:

sudo -s
apt update
apt install git bc bison flex libssl-dev -y
#This one will take a loong time
wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update
rpi-source
apt remove wireguard wireguard-dkms wireguard-tools -y
reboot

lastly, after reboot:

#This might take just forever also...
sudo apt install wireguard -y

I was running those on RPi0w. Yeah, big mistake, took like an hour to be done... But it works!

Thanx. That really helped me out. LLAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants