Skip to content

Instantly share code, notes, and snippets.

@UrsaDK
Last active April 16, 2020 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UrsaDK/bffb53fb52ed0bd72e8b721729a9ea97 to your computer and use it in GitHub Desktop.
Save UrsaDK/bffb53fb52ed0bd72e8b721729a9ea97 to your computer and use it in GitHub Desktop.
How to recover from VirtualBox installer failure on macOS host

I find that every now and again VirtualBox glitches out and fails to install (or update) on macOS. This has happened to me a few times now, and every single time it's because Apple security policies prevent VirtualBox kernel extensions from being loaded.

Screenshot of the failed install

Attempt 1 of 2: Start with OSXDaily fix: check your "System Preferences > Security & Privacy > General". There might be a discreet note in the lower part of the window saying that kernel extensions from the developer Oracle could not be loaded and an option to whitelist them by clicking on the "Allow" button. Done! :)

Screenshot of the failed install

Attempt 2 of 2: If the above didn't work then I'm afraid you will have to do the same manually:

  1. Run "VirtualBox_Uninstall.tool" from VirtualBox.dmg

  2. Examine you existing KextPolicy database:

    $ sqlite3 /private/var/db/SystemPolicyConfiguration/KextPolicy
    > select * from kext_policy;
    > select * from kext_policy where team_id = 'VB5E2TV963';
    > delete from kext_policy where team_id = 'VB5E2TV963';
    > .quit
    

    This will probably not work because KextPolicy database is in the write-protected area, but it will ensure that the team id where about to add is indeed that of Oracle.

  3. Restart in the RECOVERY mode: reboot, then hold Cmd-R as your mac is powering up

  4. Open "Utilities > Terminal" and ran the following commands (Careful! At this point you are running as root!):

    spctl kext-consent list
    spctl kext-consent add VB5E2TV963
    
  5. Finally, reboot as normal and re-run Virtual box installer.

VirtualBox should now install without failures! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment