签署虚拟盒模块(vboxdrv vboxnetflt vboxnetadp vboxpci)Centos8

我最近开始使用 Centos 8,我安装了 VirtualBox 来管理我的虚拟机,我遇到的问题是我的 VirtualBox 无法启动任何虚拟机,它告诉我执行这个脚本/sbin/vboxconfig作为根,当我运行这个脚本时,会出现以下消息:

我最近开始使用 Centos 8,我安装了 VirtualBox 来管理我的虚拟机,我遇到的问题是我的 VirtualBox 无法启动任何虚拟机,它告诉我执行这个脚本/sbin/vboxconfig作为根,当我运行这个脚本时,会出现以下消息:

vboxdrv.sh: Stopping VirtualBox services.
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.

请注意,我的安全启动已启用。我的问题是如何在 Centos 8 中对这些内核模块进行签名?

44

经过一番研究,我找到了解决办法。

解决方案 1:禁用安全启动。

解决方案 2:

1-安装mokutil

sudo dnf update
sudo dnf install mokutil

2-在新文件夹下创建 RSA 密钥。

sudo -i
mkdir /root/signed-modules
cd /root/signed-modules
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VirtualBox/"
chmod 600 MOK.priv

3-此命令将要求您添加密码,下次重新启动后需要此密码。

sudo mokutil --import MOK.der

4-重新启动系统并出现蓝屏,选择注册 MOK--& gt;继续--& gt;输入以前的密码,您的系统将启动。

5-将以前的 cmmands 放在一个脚本中,以便稍后运行(在系统更新后)

cd /root/signed-modules
vi sign-virtual-box

将以下 cmd 添加到此脚本中:

#!/bin/bash
for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do
  echo "Signing $modfile"
  /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 \
                                /root/signed-modules/MOK.priv \
                                /root/signed-modules/MOK.der "$modfile"
done

如果上述失败,请使用以下命令查找 signfile & amp;相应地编辑脚本。

find /usr/src -name sign-file

5-添加 exec 权限并运行脚本

chmod 700 sign-virtual-box
./sign-virtual-box 

6-启动 VirtualBOx

modprobe vboxdrv

有关更多信息,请参阅此链接(适用于 ubuntu 用户)https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/

9

我遵循@Younes LAB给出的solution,但我需要在sign-virtual-box脚本中更改sign-file路径,因为它工作正常:

#!/bin/bash
for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do
  echo "Signing $modfile"
  /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \
                                /root/signed-modules/MOK.priv \
                                /root/signed-modules/MOK.der "$modfile"
done

我正在使用 Ubuntu 20.04.2 LTS 和 VirtualBox 6.1

-3

我从 virtualbox 6.0 升级到 6.1 和 vboxconfig 运行没有错误(或需要签署内核模块)。

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(434)
如何将整数表示为其主要因子的乘积 (what are factors for 32)
上一篇
返回的 mac地址对于不同的设备是相同的
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(79条)