Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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