How to recompile stock Proxmox kernel?

stinkyCheeze

Member
Dec 21, 2021
7
0
6
54
I was trying to install Frigate on an LXC container and wanted to pass in my vGPU to the LXC container. After spending a few days trying to get that to work, I finally realized that the reason I could not get it to work is because my CPU (Intel Xeon E5-2697) does not have a vGPU. The problem I'm facing now is that I had followed this blog's post on how to get the vGPU passthrough to work: https://www.derekseaman.com/2023/11...u-vt-d-passthrough-with-intel-alder-lake.html and ended up patching the kernel.

Well after that stupid mistake on my part, I am now left with a custom kernel and I want to get back to the stock proxmox kernel. I have read a few threads on how to recompile my kernel, but I'm a little hesitant because I have screwed this up in the past. My concern is that I mess this up and then I'll be force to rebuild my proxmox server. Can anyone guide me or point me in the right direction on how to restore the stock proxmox kernel?

I am currently running Proxmox 8.1.4, Kernel Version: Linux 6.5.11-7-pve (2023-12-05T09:44Z).
 
Hi,
while I quickly skimmed trough the blog post you linked, I could not find any indication of a patched custom kernel. What the blog post describes is rather how to compile and install a custom kernel module via dkms.
So in order to get back to the previous state, it should be enough to uninstall the custom dkms module via dkms uninstall -m <module>/module-version> (module name and version you can get via dkms status), and restore the kernel command line parameters for grub by moving the backed up one into place via mv /etc/default/grub.bak /etc/default/grub and recreating the initial ramdisk via update-initramfs -u -k all. If you use systemd boot instead, remove changes to /etc/kernel/cmdline and update the initial ramdisk, followed by a proxmox-boot-tool refresh.

Good news is, there is no need for you to recompile any kernel!
 
Thanks Chris. I followed those steps but I'm not sure if this worked. Here is a summary of what I did:

Code:
~# dkms uninstall -m i915-sriov-dkms/6.5.11-7
Module i915-sriov-dkms-6.5.11-7 for kernel 6.5.11-7-pve (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

i915.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.5.11-7-pve/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod......
~# mv /etc/default/grub.bak /etc/default/grub
~# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-6.5.11-7-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
Copying and configuring kernels on /dev/disk/by-uuid/3996-1675
        Copying kernel and creating boot-entry for 5.15.131-2-pve
        Copying kernel and creating boot-entry for 6.5.11-7-pve
Copying and configuring kernels on /dev/disk/by-uuid/3996-B8D7
        Copying kernel and creating boot-entry for 5.15.131-2-pve
        Copying kernel and creating boot-entry for 6.5.11-7-pve
update-initramfs: Generating /boot/initrd.img-5.15.131-2-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
Copying and configuring kernels on /dev/disk/by-uuid/3996-1675
        Copying kernel and creating boot-entry for 5.15.131-2-pve
        Copying kernel and creating boot-entry for 6.5.11-7-pve
Copying and configuring kernels on /dev/disk/by-uuid/3996-B8D7
        Copying kernel and creating boot-entry for 5.15.131-2-pve
        Copying kernel and creating boot-entry for 6.5.11-7-pve

However, I'm not sure if I did something wrong because after I rebooted, I ran dkms status again but that module is still there:

Code:
~# dkms status
i915-sriov-dkms/6.5.11-7, 6.5.11-7-pve, x86_64: built
~#
 
However, I'm not sure if I did something wrong because after I rebooted, I ran dkms status again but that module is still there:
That is because the dkms uninstall command will not remove the kernel module. You can also remove it for all kernel versions via dkms remove -m <module>/module-version> --all, see the corresponding action description in man dkms.
 

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!