Kernel Header fehlen

Vengance

Renowned Member
May 21, 2016
271
12
83
34
Hi,

Für einen Wireguard VPN Server habe ich mir die nötigen PVE Kernel Header über folgenden Befehl installiert:
Code:
apt install pve-headers-4.15.18-2-pve

Das hat soweit auch funktioniert und Wireguard lief ohne Probleme. Nun habe ich vorhin ein Kernel Upgrade auf Version 4.15.18-3-pve gemacht und anschließend wieder die Header mittels
Code:
apt install pve-headers-4.15.18-3-pve
apt install pve-headers

installiert. Doch leider fehlen Wireguard scheinbar immernoch Kernel Module, siehe folgende Ausgabe

Code:
# lsmod | grep wireguard
# 
# modprobe wireguard
# modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.15.18-3-pve


Code:
ls -l /usr/src/linux-headers-$(uname -r)
total 1688
drwxr-xr-x  33 root root    4096 Aug 29 20:48 arch
drwxr-xr-x   3 root root    4096 Aug 29 20:48 block
drwxr-xr-x   2 root root    4096 Aug 29 20:48 certs
drwxr-xr-x   4 root root    4096 Aug 29 20:48 crypto
drwxr-xr-x 131 root root    4096 Aug 29 20:48 drivers
drwxr-xr-x   2 root root    4096 Aug 29 20:48 firmware
drwxr-xr-x  75 root root    4096 Aug 29 20:48 fs
drwxr-xr-x  29 root root    4096 Aug 29 20:48 include
drwxr-xr-x   2 root root    4096 Aug 29 20:48 init
drwxr-xr-x   2 root root    4096 Aug 29 20:48 ipc
-rw-r--r--   1 root root    2245 May  4 07:52 Kbuild
-rw-r--r--   1 root root     287 May  4 07:52 Kconfig
drwxr-xr-x  16 root root    4096 Aug 29 20:48 kernel
drwxr-xr-x  13 root root    4096 Aug 29 20:48 lib
-rw-r--r--   1 root root   61472 Aug 24 11:12 Makefile
drwxr-xr-x   3 root root    4096 Aug 29 20:48 mm
-rw-r--r--   1 root root 1536578 Aug 24 11:12 Module.symvers
drwxr-xr-x  69 root root    4096 Aug 29 20:48 net
drwxr-xr-x  28 root root    4096 Aug 29 20:48 samples
drwxr-xr-x  14 root root   12288 Aug 29 20:48 scripts
drwxr-xr-x  10 root root    4096 Aug 29 20:48 security
drwxr-xr-x  25 root root    4096 Aug 29 20:48 sound
drwxr-xr-x  10 root root    4096 Aug 29 20:48 spl
drwxr-xr-x  29 root root    4096 Aug 29 20:48 tools
drwxr-xr-x   6 root root    4096 Aug 29 20:48 ubuntu
drwxr-xr-x   2 root root    4096 Aug 29 20:48 usr
drwxr-xr-x   4 root root    4096 Aug 29 20:48 virt
drwxr-xr-x   5 root root    4096 Aug 29 20:48 zfs
 
Hi,

here it works without problems to install wireguard on pve kernel 4.15.18-3
 
On the previous kernel it also worked without a problem, only since the kernel upgrade it doesn't work anymore.
 
On the previous kernel it also worked without a problem, only since the kernel upgrade it doesn't work anymore.

your error message indicates that you aren't missing the headers - you haven't compiled the module for the new kernel ABI (yet). if you are using DKMS, you need to trigger a build with the 'dkms' command line tool (this should happen automatically on kernel updates if you have "pve-headers" installed, if it doesn't, please post the upgrade output). if you build the module manually, you need to do a new (manual) build on every kernel API change.
 
I have successfully run Wireguard in a CentOS 7 Container, running on Proxmox 5.2-1. Wireguard operates as a module at the kernel level, so you need to install it on the Proxmox host. In order to install it on the host, the kernel headers for the kernel version you are running need be installed. This will allow DKMS to build the module when you run apt install Wireguard. The best way I found to do this is to upgrade your kernel by installing the kernel headers of your target kernel, and then upgrading the kernel.

To install the kernel headers for your version of the Proxmox kernel, you need to add No-Subscription Repository

Code:
echo "deb http://download.proxmox.com/debian/pve stretch pve-no-subscription" >> /etc/apt/sources.list

Then install kernel header of the kernel you will update to:
Code:
apt list | grep pve-headers
apt install -y pve-headers-4.15.18-3-pve

Next update your kernel to the above version:
Code:
apt install -y pve-kernel-4.15.18-3-pve

To use the new kernel, you will need to reboot sudo shutdown -r now

After rebooting, install Wireguard using directions on there website:

This may require a reboot as well, but It did not for me. You can verify the installation was successful by running modprobe wireguard. If there were no errors, you can test by adding a Wireguard interface: ip link add dev wg0 type wireguard. If you get no errors, you can start using Wireguard.

I would note that even though containers use the same kernel as the host they are running on, you still need to install the tools on the container OS of your choosing. In my test, I used CentOS7 and it worked perfectly.

I hope this helps
 
as mentioned in the very same thread you replied to - there is a 'pve-headers' meta package that pulls in the appropriate kernel header package (currently the latest 'pve-headers-4.15.XX-Y-pve' via the 'pve-headers-4.15' meta package). both meta packages are available in pvetest, pve-no-subscription and pve-enterprise, like all our packages.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!