Apple - virtualbox installation failed on macOS Catalina

To install and/or use virtualbox you may need to enable its kernel extension in: System Preferences → Security & Privacy → General

For more information please refer the documentation or this Apple Technical Note:

If you've used Migration Assistant

I'd moved from an old machine running macOS Mojave to a new machine using macOS Catalina using Migration Assistant. This bypassed the normal installation process, so the Security & Privacy System Preference never displayed a prompt that would allow me to grant VirtualBox permission to run.

The solution was to download the latest, Catalina-compatable VirtualBox installer .dmg (version 6.12 and up) and run VirtualBox_Uninstall.tool. This failed, but prompted for extra permissions in System Preferences... Security & Privacy. After I granted permission to the uninstall tool, I ran the Uninstall tool again successfully.

I then ran the VirutalBox install .pkg, which will failed. VirtualBox did install, just not completely. I then launched VirtualBox, which failed, but gave me a prompt in System Preferences... Security & Privacy that allowed me to grant permission for VirtualBox to run. I then launched VirtualBox again, and was good to go.

For Catalina you'll need to do this:

Restart your mac in Recovery mode (cmd + R)

Then open a Terminal and enter: spctl kext-consent add VB5E2TV963

Restart your mac.

VB5E2TV963 is the code for oracle.

(Taken from )

For me was the only way to install it.