1. Download the latest VirtualBox software and install it.
Download the latest VirtualBox installation package from the VirtualBox official website, download address: https://www.virtualbox.org/wiki/Downloads
2. Uninstall the current VirtualBox
After downloading the latest VirtualBox installation package (the current latest version is 6.1.16), click the installation package and the following interface will pop up, click VirtualBox_Uninstall.tool in the lower right corner to uninstall (remember to exit the VirtualBox running)
Then a window to uninstall VirtualBox will pop up, output yes to confirm the uninstallation, and close the window after the uninstallation is complete.
4. Allow security and privacy
After the installation is complete, you also need to allow the security and privacy of VirtualBox.
Settings -> Security and Privacy -> General -> Click the lock to unlock in the lower left corner -> Click «Allow»
5. Restart MacOS
After allowing the security policy of VirtualBox, you also need to restart MacOS to enable the new system extensions of VirtualBox.
6. Supplementary plan
If the problem is not resolved after trying the above methods, it is most likely that there is a problem with the SIP (System Integrity Protection) settings of your machine.
For example, csrutil disable previously disabled the SIP function on my machine.
After I uninstalled and reinstalled VirtualBox, I found that no kernel errors were reported, but there were still the following errors:
If you have a similar situation, please try to use the following steps to clear the SIP settings.
(1) Restart macOS and press Command + R to enter recovery mode
(2) Open the terminal in recovery mode
(3) In the opened terminal command line, output csrutil clear
Use csrutil status to see that the current SIP of macOS is disabled. Then execute csrutil clear to reset the previous SIP settings.
(4) Restart macOS
After executing csrutil clear, you need to restart the system to take effect, directly enter reboot on the command line to restart.
(5) View and confirm SIP status
After restarting macOS, open the terminal and output csrutil status to check the status of SIP. You can see that SIP is now enabled.
Under normal circumstances, the virtual machine in VirtualBox can be run normally at this step. If you still cannot run the virtual machine system normally, please repeat the above steps 1-5~