The DKMS command will output " Your kernel headers for kernel 5.4.78-2-pve cannot be found".

KuriKuchi

Member
Jan 22, 2021
8
1
8
23
I am writing this using a translating machine.
The DKMS command will output " Your kernel headers for kernel 5.4.78-2-pve cannot be found".

Host OS
  • CPU(s):8 x Intel(R) Xeon(R) CPU E3-1275 v3 @ 3.50GHz (1 Socket)
  • Kernel Version:Linux 5.4.78-2-pve #1 SMP PVE 5.4.78-2 (Thu, 03 Dec 2020 14:26:17 +0100)
  • PVE Manager Version:pve-manager/6.3-3/eee5f901
Guest OS
  • CT Template:debian-10-turnkey-core_16.0-1_amd64.tar.gz


The following commands were executed on the Guest OS.
Code:
root@Docker ~/px4_drv# bash dkms.install
Error! DKMS tree already contains: px4_drv-0.2.1
You cannot add the same module/version combo more than once.
Error! Your kernel headers for kernel 5.4.78-2-pve cannot be found.
Please install the linux-headers-5.4.78-2-pve package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 5.4.78-2-pve cannot be found.
Please install the linux-headers-5.4.78-2-pve package,
or use the --kernelsourcedir option to tell DKMS where it's located

This is the content of dkms.install.
Code:
. ./dkms.conf
cp -a `pwd` /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
dkms add -m $PACKAGE_NAME -v $PACKAGE_VERSION
dkms build -m $PACKAGE_NAME -v $PACKAGE_VERSION
dkms install -m $PACKAGE_NAME -v $PACKAGE_VERSION

I read somewhere that "you need to install kernel headers on the host OS", so I installed them and rebooted.
Code:
root@www:~# apt install pve-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
pve-headers-5.4.78-2-pve is already the newest version (5.4.78-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

However, it is installed but the error continues.
Can someone please help me?
 
Hi!

I read somewhere that "you need to install kernel headers on the host OS", so I installed them and rebooted.
That is correct, but then you also need to build the DKMS module there.
If you install the headers on the host, they are not available in the Container as the Container has a separate filesystem, which normally isn't shared with the host.

The Container (CT) shares the Linux Kernel with the Proxmox VE host.
So, the Container cannot install new kernel modules as those would affect the security of the Proxmox VE host and other Container running there.

You need to load the DKMS module on the host, so it becomes available for all Container.
 

ホストOSにdkmsをインストールしました。
Code:
root@www:~# apt install dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
dkms is already the newest version (2.6.1-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

However, when I ran dkms as a guest, it told me that the command did not exist.
 
However, when I ran dkms as a guest, it told me that the command did not exist.
you need to run dkms as host.

Build the module on the host and load it on the host, not the guest.
dkms doesn't need to be used in the guest here.
 

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!