Linux vboxdrv内核模块未加载(未知rela重新定位-debian buster)

Linux vboxdrv内核模块未加载(未知rela重新定位-debian buster),linux,linux-kernel,debian,virtualbox,Linux,Linux Kernel,Debian,Virtualbox,Virtualbox在将Debian从Stretch更新为Buster后无法加载内核模块。 我有Virtualbox 6.1和下一个内核版本: ~$ uname -a Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linux 此外,我的Bios上有旧版支持,并且禁用了secureboot。Debian还配置为从遗留系统启动 我见过很多类似的案例,但是所有提议的解决方案都不适合我

Virtualbox在将Debian从Stretch更新为Buster后无法加载内核模块。 我有Virtualbox 6.1和下一个内核版本:

~$ uname -a Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linux
此外,我的Bios上有旧版支持,并且禁用了secureboot。Debian还配置为从遗留系统启动

我见过很多类似的案例,但是所有提议的解决方案都不适合我

我尝试了以下解决方案:

~$ sudo /sbin/vboxconfig  vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: Building
VirtualBox kernel modules. vboxdrv.sh: failed: modprobe vboxdrv
failed. Please use 'dmesg' to find out why.
 
There were problems setting up VirtualBox.  To re-start the set-up
process, run   /sbin/vboxconfig as root.  If your system is using EFI
Secure Boot you may need to sign the kernel modules (vboxdrv,
vboxnetflt, vboxnetadp, vboxpci) before you can load  them. Please see
your Linux system's documentation for more information.





此外,我还尝试了其他可能的解决方法:

  • 重新启动我的电脑并尝试执行modprobe和vboxconfig命令
  • 以root用户身份运行virtualbox
  • 从Debian repo安装Virtualbox 5.2、6.0、6.1
  • 直接从.deb包安装最新的Virtualbox
  • sudo/opt/VirtualBox/vboxdrv.sh强制重新加载
  • sudo/opt/VirtualBox/vboxdrv.sh设置
与vboxdrv内核模块相关的所有失败操作在stdoutdmesg中返回此消息:

module: vboxdrv: Unknown rela relocation: 4

重新定位错误看起来像是正在运行的内核与构建模块时使用的binutils版本之间的兼容性问题。见以下讨论:

Exec格式错误和未知的rela重新定位:

看起来很相关-0x02和0x04分别是R_X86_64_PC32和R_X86_64_PLT32-但您的内核中没有这些。看起来您已升级到binutils>=2.31,因此您的链接器已决定立即使用R_X86_64_PLT32重新定位

经确认,将binutils降级至2.30可解决问题

关于堆栈溢出,请参阅

dmesg怎么说?同样,
[57.782047]模块:vboxdrv:未知关系重定位:4[87.412310]模块:vboxdrv:未知关系重定位:4[132.103972]模块:vboxdrv:未知关系重定位:4[555.694328]模块:vboxdrv:未知关系重定位:4[603.724296]模块:vboxdrv:未知关系重定位:4[607.392530]模块:vboxdrv:未知rela重定位:4[695.696342]模块:vboxdrv:未知rela重定位:4[1007.680936]模块:vboxdrv:未知rela重定位:4[1472.050823]模块:vboxdrv:未知rela重定位:4
看起来在构建模块时使用的内核和binutils版本之间存在兼容性问题。见以下讨论:。另外:@a_bridges您是否尝试将
binutils
降级为@a_bridges降级似乎解决了这个问题?更多的细节可能会有帮助,甚至可能是这个新问题的一个新问题。
~$ sudo dpkg-reconfigure virtualbox-6.1 dkms addgroup: The group
`vboxusers' already exists as a system group. Exiting. vboxdrv.sh:
failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up
process, run   /sbin/vboxconfig as root.  If your system is using EFI
Secure Boot you may need to sign the kernel modules (vboxdrv,
vboxnetflt, vboxnetadp, vboxpci) before you can load  them. Please see
your Linux system's documentation for more information.
~$ sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
virtualbox-6.1 --reinstall ... Unpacking linux-headers-amd64
(4.19+105+deb10u7) over (4.19+105+deb10u7) ... Setting up
linux-headers-amd64 (4.19+105+deb10u7) ... Setting up virtualbox-6.1
(6.1.16-140961~Debian~buster) ... addgroup: The group `vboxusers'
already exists as a system group. Exiting. vboxdrv.sh: failed:
modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up
process, run   /sbin/vboxconfig as root.  If your system is using EFI
Secure Boot you may need to sign the kernel modules (vboxdrv,
vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see
your Linux system's documentation for more information. Processing
triggers for mime-support (3.62) ... Processing triggers for
hicolor-icon-theme (0.17-2) ... Processing triggers for systemd
(241-7~deb10u4) ... Processing triggers for shared-mime-info (1.10-1)
... Processing triggers for desktop-file-utils (0.23-4) ...
:~$ sudo /sbin/rcvboxdrv 
setup vboxdrv.sh: Stopping VirtualBox services. 
vboxdrv.sh: Starting VirtualBox services. 
vboxdrv.sh:
Building VirtualBox kernel modules. vboxdrv.sh: failed: modprobe vboxdrv failed. 
Please use 'dmesg' to find out why.
module: vboxdrv: Unknown rela relocation: 4