VirtualBox Fedora EFI 安全启动您可能需要先对内核模块 (vboxdrv、vboxnetflt、vboxnetadp、vboxpci) 进行签名,然后才能加载它们

VirtualBox Fedora EFI 安全启动您可能需要先对内核模块 (vboxdrv、vboxnetflt、vboxnetadp、vboxpci) 进行签名,然后才能加载它们

你好,我正在尝试在一台联想 AllIn 电脑上安装 VirtualBox 6,我想在其中运行虚拟机,从昨天开始,我就在解决这个问题

答案1

安全启动启用

然后读到这个

vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: You must sign these kernel modules before using VirtualBox:
  vboxdrv vboxnetflt vboxnetadp vboxpci
See the documenatation for your Linux distribution..
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.

然后我像这样对模块进行自我签名

    cd /root/module-signing
    openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=YOUR_NAME/"
    chmod 600 MOK.priv

并导入密钥

mokutil --import /root/module-signing/MOK.der
  input password: type my password
  input password again: type my password

我像这样检查模块

 $ for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do hexdump -Cv  "$modfile" | tail -n 5 ;done
00dcdc20  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00dcdc30  a8 c9 dc 00 00 00 00 00  6b 02 00 00 00 00 00 00  |........k.......|
00dcdc40  00 00 00 00 00 00 00 00  01 00 00 00 00 00 00 00  |................|
00dcdc50  00 00 00 00 00 00 00 00                           |........|
00dcdc58
00094400  11 00 00 00 03 00 00 00  00 00 00 00 00 00 00 00  |................|
00094410  00 00 00 00 00 00 00 00  c0 36 09 00 00 00 00 00  |.........6......|
00094420  bb 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00094430  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00094440
00113470  11 00 00 00 03 00 00 00  00 00 00 00 00 00 00 00  |................|
00113480  00 00 00 00 00 00 00 00  b8 27 11 00 00 00 00 00  |.........'......|
00113490  b1 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
001134a0  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
001134b0
000ddbf0  11 00 00 00 03 00 00 00  00 00 00 00 00 00 00 00  |................|
000ddc00  00 00 00 00 00 00 00 00  38 cf 0d 00 00 00 00 00  |........8.......|
000ddc10  b1 01 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000ddc20  01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

然后运行

$ for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 /root/module-signing/MOK.priv /root/module-signing/MOK.der "$modfile" ;done

然后再次检查

$ for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do hexdump -Cv  "$modfile" | tail -n 5 ;done
00dcddd0  f2 67 a1 c7 88 5f 39 1e  1f e6 34 65 a1 8f ca 24  |.g..._9...4e...$|
00dcdde0  e4 b2 b6 d0 00 00 02 00  00 00 00 00 00 00 01 8c  |................|
00dcddf0  7e 4d 6f 64 75 6c 65 20  73 69 67 6e 61 74 75 72  |~Module signatur|
00dcde00  65 20 61 70 70 65 6e 64  65 64 7e 0a              |e appended~.|
00dcde0c
000945c0  35 19 99 5f 30 f8 21 51  84 00 6d 17 00 00 02 00  |5.._0.!Q..m.....|
000945d0  00 00 00 00 00 00 01 8c  7e 4d 6f 64 75 6c 65 20  |........~Module |
000945e0  73 69 67 6e 61 74 75 72  65 20 61 70 70 65 6e 64  |signature append|
000945f0  65 64 7e 0a                                       |ed~.|
000945f4
00113630  66 35 23 5c b8 d3 de aa  66 69 45 eb 00 00 02 00  |f5#\....fiE.....|
00113640  00 00 00 00 00 00 01 8c  7e 4d 6f 64 75 6c 65 20  |........~Module |
00113650  73 69 67 6e 61 74 75 72  65 20 61 70 70 65 6e 64  |signature append|
00113660  65 64 7e 0a                                       |ed~.|
00113664
000dddb0  54 45 4e 4e 82 5d 75 5e  ab 97 cd 8d 00 00 02 00  |TENN.]u^........|
000dddc0  00 00 00 00 00 00 01 8c  7e 4d 6f 64 75 6c 65 20  |........~Module |
000dddd0  73 69 67 6e 61 74 75 72  65 20 61 70 70 65 6e 64  |signature append|
000ddde0  65 64 7e 0a                                       |ed~.|
000ddde4

然后运行

modprobe vboxdrv 

只需按照步骤操作即可!:P

相关内容