【原创】MacOS Big Sur 上 VirtualBox 运行报错

相关环境

  • MacOS 11.0.1

  • VirtualBox 6.1.12

  • VirtualBox 6.1.16

问题描述

MacOS 从 Catalina 升级到 Big Sur 之后,运行 VirtualBox 中的虚拟机报错,报错信息如下:

Kernel driver not installed (rc=-1908)
...
Make sure the kernel module has been loaded successfully.
...
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.

如下截图:

问题原因

这种大版本的升级可预料到的会发生一些内核上的变化,而从 VirtualBox 的报错信息来看,也是明确地指出了内核方面的信息。

解决方法

1、下载最新的 VirtualBox 软件并安装。

https://www.virtualbox.org/wiki/Downloads

2、卸载当前的 VirtualBox

下载完最新的 VirtualBox (当前最新版是 6.1.16) 安装包后,点击安装包会弹出如下界面,点击右下角的 VirtualBox_Uninstall.tool 进行卸载(记得先退出正在运行的 VirtualBox)

然后会弹出一个卸载 VirtualBox 的窗口,输出 yes 确认卸载,卸载完成后关闭窗口。

3、重新安装 VirtualBox

点击 VirtualBox.pkg 进行安装

点击 "允许"

点击 "继续"

4、允许安全与隐私

在安装完成后,还需要允许 VirtualBox 的安全与隐私。

设置 -> 安全性与隐私 -> 通用 -> 点击左下角的锁解锁 -> 点击 "允许"

5、重启 MacOS

在允许 VirtualBox 的安全性策略后,还需要重启 MacOS 才能启用 VirtualBox 新的系统扩展。

6、补充方案

如果以上的方法尝试之后没有解决问题,这很有可能是你的机器的 SIP(系统集成保护:System Integrity Protection) 设置有问题。

比如我的机器之前 csrutil disable 关闭了 SIP 功能。

$ csrutil status
System Integrity Protection status: unknown (Custom Configuration).
Configuration:
        Apple Internal: disabled
        Kext Signing: disabled
        Filesystem Protections: disabled
        Debugging Restrictions: disabled
        DTrace Restrictions: disabled
        NVRAM Protections: disabled
        BaseSystem Verification: enabled
This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.

我卸载重装 VirtualBox 以后发现没有报内核错误了,但还有如下的错误:

如果你也有类似的情况,请尝试再使用以下步骤清除 SIP 的设置。

(1) 重启 macOS 并按 Command + R 进入恢复模式

(2) 在恢复模式下打开终端

(3) 在打开的终端命令行输出 csrutil clear

使用 csrutil status 可以看到 macOS 当前的 SIP 都被禁用了。然后执行 csrutil clear 重置之前的 SIP 设置。

$ csrutil status    # 查看当前的 SIP 状态
$ csrutil clear     # 清除当前的 SIP 设置

(4) 重启 macOS

执行 csrutil clear 后,需要重启系统生效,直接在命令行输入 reboot 进行重启。

(5) 查看并确认 SIP 状态

重启 macOS 后,打开终端,输出 csrutil status 查看 SIP 的状态,可以看见现在 SIP 已经是 enabled 状态了。

$ csrutil status
System Integrity Protection status: enabled.

正常情况下,到这一步就可以正常运行 VirtualBox 中的虚拟机了,如果你还是不能正常运行虚拟机系统,请再重复做一遍上面的 1-5 步~

附录

参考:

https://forums.virtualbox.org/viewtopic.php?f=39&t=98763&start=75

You may also like...

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注