【问题标题】:The vboxdrv kernel module is not loaded (Unknown rela relocation - debian buster) [closed]vboxdrv 内核模块未加载(Unknown rela relocation - debian buster)[关闭]
【发布时间】:2020-11-03 14:25:25
【问题描述】:

将 Debian 从 Stretch 更新到 Buster 后,Virtualbox 无法加载内核模块。 我有 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 也被配置为从 Legacy 启动

我见过很多类似的案例,但是所有建议的解决方法都对我不起作用。

我尝试了下一个解决方案:

~$ 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.

~$ sudo modprobe vboxdrv  modprobe: ERROR: could not insert 'vboxdrv': Exec format error

~$ 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.

我还尝试了另一种可能的解决方法:

  • 重启我的电脑并尝试执行 modprobe 和 vboxconfig 命令
  • 以 root 身份运行 virtualbox
  • 从 Debian 仓库安装 Virtualbox 5.2、6.0、6.1
  • 直接从 .deb 包安装最新的 Virtualbox
  • sudo /opt/VirtualBox/vboxdrv.sh force-reload
  • sudo /opt/VirtualBox/vboxdrv.sh 设置

所有与 vboxdrv 内核模块相关的失败操作在 stdoutdmesg 中返回此消息:

module: vboxdrv: Unknown rela relocation: 4

【问题讨论】:

  • dmesg 说什么?
  • 同理,[ 57.782047] module: vboxdrv: Unknown rela relocation: 4 [ 87.412310] module: vboxdrv: Unknown rela relocation: 4 [ 132.103972] module: vboxdrv: Unknown rela relocation: 4 [ 555.694328] module: vboxdrv: Unknown rela relocation: 4 [ 603.724296] module: vboxdrv: Unknown rela relocation: 4 [ 607.392530] module: vboxdrv: Unknown rela relocation: 4 [ 695.696342] module: vboxdrv: Unknown rela relocation: 4 [ 1007.680936] module: vboxdrv: Unknown rela relocation: 4 [ 1472.050823] module: vboxdrv: Unknown rela relocation: 4
  • 看起来像是构建模块时使用的内核和 binutils 版本之间的兼容性问题。请参阅这些讨论:link1link2。另外:binutils version
  • @a_bridges 您是否尝试过将binutils 降级到
  • @a_bridges 看来降级可以解决这个问题?更多细节会有所帮助,甚至可能是这个新问题的新问题。

标签: linux linux-kernel debian virtualbox


【解决方案1】:

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

执行格式错误和未知的rela重定位:

This kernel commit 看起来相关——0x02 和 0x04 分别是 R_X86_64_PC32 和 R_X86_64_PLT32——但你的内核中没有它。看起来您已升级到 binutils >= 2.31,因此您的链接器决定现在使用 R_X86_64_PLT32 重定位。

已确认,将 binutils 降级到 2.30 即可解决问题

关于堆栈溢出,请参阅 binutils version

【讨论】:

    猜你喜欢
    • 2014-07-07
    • 1970-01-01
    • 2017-06-21
    • 2012-08-20
    • 2016-01-05
    • 1970-01-01
    • 2012-03-14
    • 2018-08-18
    • 1970-01-01
    相关资源
    最近更新 更多