Skip to content

Troubleshooting VirtualBox

Erkin Matkaziev edited this page May 29, 2018 · 5 revisions

VirtualBox can't load Kernel Extensions on MacOS

BACKGROUND

  • You are failing to create to Peer from Control Center
  • VirtualBox installation was unsuccessful
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
  • When run above command you have following error message:
Loading VBoxDrv.kext
/Library/Application Support/VirtualBox/VBoxDrv.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxDrv.kext
Loading VBoxUSB.kext
/Library/Application Support/VirtualBox/VBoxUSB.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxUSB.kext
Loading VBoxNetFlt.kext
/Library/Application Support/VirtualBox/VBoxNetFlt.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxNetFlt.kext
Loading VBoxNetAdp.kext
/Library/Application Support/VirtualBox/VBoxNetAdp.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8).
Error: Failed to load /Library/Application Support/VirtualBox/VBoxNetAdp.kext
(kernel) Kext org.virtualbox.kext.VBoxNetAdp not found for unload request.
Failed to unload org.virtualbox.kext.VBoxNetAdp - (libkern/kext) not found.
(kernel) Kext org.virtualbox.kext.VBoxNetFlt not found for unload request.
Failed to unload org.virtualbox.kext.VBoxNetFlt - (libkern/kext) not found.
(kernel) Kext org.virtualbox.kext.VBoxUSB not found for unload request.
Failed to unload org.virtualbox.kext.VBoxUSB - (libkern/kext) not found.
(kernel) Kext org.virtualbox.kext.VBoxDrv not found for unload request.
Failed to unload org.virtualbox.kext.VBoxDrv - (libkern/kext) not found.
Fatal error: VirtualBox

Reason

  • Your MacOs is not approving loading VirtualBox kernel extensions

Solution

  • Manual load VirtualBox kernel extensions and approve from them from "System Preferences -> Security & Privacy"
  1. Download script to load kernel extensions manually
  2. Open Terminal and run following commands
# path_to_script probably is ~/Downloads/
cd /path_to_script/
# load_kernel_extensions_manual is script name you downloaded
chmod +x ./load_kernel_extensions_manual.sh
# run script with sudo
sudo ./load_kernel_extensions_manual.sh
  1. Then, check "System Preferences -> Security & Privacy" and approve
  2. Launch again script
sudo ./load_kernel_extensions_manual.sh
  1. Restart VirtualBox
sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart

Reference

https://github.com/Homebrew/homebrew-cask/issues/39369 https://developer.apple.com/library/content/technotes/tn2459/_index.html