Skip to content

Instantly share code, notes, and snippets.

@SQLJames
Last active March 29, 2024 09:01
Show Gist options
  • Save SQLJames/fe6fcd5e819d864986ce2eff6ad350da to your computer and use it in GitHub Desktop.
Save SQLJames/fe6fcd5e819d864986ce2eff6ad350da to your computer and use it in GitHub Desktop.
proxmox realtek driver issues

Edit 1

Updating the proxmox kernel will require you to remove this and potentially reapply https://forum.proxmox.com/threads/autoinstall-for-kernel-6-5-11-3-pve-failed.136818/

Ansible role

https://github.com/PragmaticEngineering/ansibleRole-proxmox-realtek

Descripton

As part of proxmox 8.0 the realtek drivers are having issues where after a certain amount of time the node will go offline and lose connectivity. Here are the steps I took with a no-subscription repo.

to know if you could be affected by this issue, log into your proxmox host, either via ssh or keyboard and display and run:

lspci -nnk

if you are affected, you should see a Ethernet controller from Realtek Semiconductor Co. using the r8169 driver

for example

01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
        Subsystem: Dell RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1028:07a3]
        Kernel driver in use: r8169
        Kernel modules: r8169

Summary

vi /etc/apt/sources.list


deb http://ftp.us.debian.org/debian bookworm main contrib non-free non-free-firmware

deb http://ftp.us.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

# security updates
deb http://security.debian.org bookworm-security main contrib non-free non-free-firmware

deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription

apt update

apt install pve-headers -y

apt install r8168-dkms -y

apt upgrade -y

echo blacklist r8169 >> /etc/modprobe.d/blacklist-r8169.conf

sudo sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="r8168.aspm=0 r8168.eee_enable=0 pcie_aspm=off loglevel=3"/' /etc/default/grub

proxmox-boot-tool refresh

reboot -n

Walkthrough

modify the repository source list. These repositories provide packages and updates for your system. vi /etc/apt/sources.list

deb http://ftp.us.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://ftp.us.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
# security updates
deb http://security.debian.org bookworm-security main contrib non-free non-free-firmware
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription

After modifying the sources.list file we need to make sure the system updates the package list from the repositories

apt update

Heres where most issues came up for me, we need to install the pve-headers pacakge. because without it, we will have issues compiling the realtek-dkms package. The -dkms suffix indicates that it's a Dynamic Kernel Module Support package, which means it can be automatically rebuilt whenever the kernel is updated. When you install this package, it uses the kernel headers (provided by pve-headers) to build and install the Realtek network card driver as a kernel module.

apt install pve-headers -y

Install the Realtek 8168 network card driver as a Dynamic Kernel Module Support package. It can automatically rebuild the driver when the kernel is updated.

apt install r8168-dkms -y

Then, for good measure I made sure my other packages were updated.

apt upgrade -y

blacklist the 8169 driver from being loaded

echo blacklist r8169 >> /etc/modprobe.d/blacklist-r8169.conf

Once all of this is completed we are going to update our GRUB to have some specific kernel parameters for our realtek driver

sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="r8168.aspm=0 r8168.eee_enable=0 pcie_aspm=off loglevel=3"/' /etc/default/grub

Finally, we are are going to refresh the boot configuration for Proxmox and reboot.

proxmox-boot-tool refresh reboot -n

@shaunsull
Copy link

See this forum post for the 6.5.11-4-pve kernel. update. I know nothing about how all this driver issue works, but this fixed my issue after upgrading. Since I upgraded three nodes without reading this first (duh!), I had to connect a keyboard and monitor and boot to the old kernel. Note to self, wait for updates to settle and check the forums before jumping in.

https://forum.proxmox.com/threads/proxmox-ve-8-1-released.136960/post-608898

To be able to update the kernel to 6.5.11-4-pve, WITH R8168 kernel module working, you need to build the kernel module for the new version of the kernel. The module was previously build for the kernel version you were running.

@PP-Mclappins
Copy link

I've done the fix, and I am now seeing the correct driver in place when running "lspci -nnk"

Unfortunately after the node reboot, I am still not seeing the card in my networking tab as a Network interface.

going to attempt to manually bring the card up, but not sure how it's going to go, Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment