Apple - VirtualBox 5.1.28 fails to install on MacOS 10.13 due to KEXT security

Managed to solve it.

  • Eject the VirtualBox image from: Finder > Devices

    Remove VirtualBox device

  • Now allow the exception in: System Preferences > Security & Privacy

    Security & Privacy

  • Finally but not least click Allow button so that way the developer with the name "Oracle America, Inc" will be accepted and the installer using that certificate will run just fine (basically this installer is signed using "Oracle America, Inc" certificate so we are required to enable it use on our machine first)

  • Then try to install from the .dmg again so that it remounts the device.

Now its working fine for me.


For those still struggling with this issue:

IF YOU ARE CONNECTING VIA REMOTE DESKTOP OR SCREEN SHARING or have any other mouse emulation running: It is not possible to actually click the Allow button in this mode!!

So do the following:

  1. Run the installer until the location prompt
  2. open System Preferences
  3. Take a screenshot (CMD+SHIFT+3)
  4. Open the screenshot with Preview, and select from top left to the button, and note down the coordinates
  5. Then open Script Editor, and run the following line of code: tell application "System Events" to click at {890, 460} Use the coordinates from step 4. and make sure you don't move the Preferences window, and that no other window is overlaying the button. (It could be you need to give Script Editor Accessibility permission, but it will prompt you)

Now the button is actually clicked, and you can allow "Oracle America, Inc." to install. You might be prompted for a reboot. Then run the installer again and everything should work as expected!


The answer at the following link worked for me. It required running the script provided by dstroot, approving the kext in Security & Privacy and then installing with brew cask reinstall --force virtualbox --verbose --debug. https://github.com/caskroom/homebrew-cask/issues/39369