linux - 签署虚拟盒模块(vboxdrv、vboxnetflt、vboxnetadp、vboxpci)Centos 8

标签 linux centos virtual-machine virtualbox centos8

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为 on-topic对于堆栈溢出。


11 个月前关闭。


社区在 5 个月前审查了是否重新打开此问题并将其关闭:

原始关闭原因未解决






Improve this question




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

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 中签署这些内核模块?

最佳答案

经过一番研究,我找到了解决方案。
解决方案 1:禁用安全启动。
解决方案 2:
1- 安装 mokutil包裹

sudo dnf update
sudo dnf install mokutil
2- 在新文件夹下创建 RSA key 。
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- 重新启动系统并出现蓝屏,选择 Enroll MOK --> Continue --> 输入以前的密码,您的系统将启动。
5- 将之前的命令放入脚本中以便稍后运行(系统更新后)
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
如果上述失败并相应地编辑脚本,请使用以下内容查找符号文件。
find /usr/src -name sign-file
5-添加执行权限并运行脚本
chmod 700 sign-virtual-box
./sign-virtual-box 
6- 启动 VirtualBOX
modprobe vboxdrv
有关更多信息,请参阅此链接(适用于 ubuntu 用户)
https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/

关于linux - 签署虚拟盒模块(vboxdrv、vboxnetflt、vboxnetadp、vboxpci)Centos 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61248315/

相关文章:

c++ - 从 C/C++ 到内存的 GUI 窗口屏幕截图

python - 在具有共享 Windows 文件夹的 VMWare 中使用 virtualenv

Apache - 如何将 http 请求仅转换为 https?

linux - 输出到文件时如何设置输出缓冲区宽度/列?

linux - 测量代码性能时的虚拟机或双启动

linux - 使: no rule to make target

python - 选择不适用于 python 中的管道?

centos - centos 7上未安装httpbeat包

vagrant - 将项目从 VM 导入到 IntelliJ

azure - 将azure虚拟机操作系统从windows更改为ubuntu。我如何更改操作系统?