Lately I'm seeing more posts related to possible errors while trying to install Oracle VM VirtualBox 5.2.18 on MacOS 10.14 - Mojave; usually the installation correctly runs but, at the end, the error show is something like:
By checking the logs you can also note following error/problem:
<your-hostname> installd: ./postflight: /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).
As you can see the kext "VBoxDrv" is not loaded due to the "System Policy" that prevented the loading, so the installation is declared as "failed"; the possible work-around to this problem could be to immediately open "System Preferences" => "Security & Privacy" and in the "General Tab" allow the installation of software coming from "Oracle America, Inc.":
After getting "Oracle America, Inc." an authorized developer, you can retry the installation and get, finally, VirtualBox correctly running.
Comments, feedback and possible further improvements to this solution are obviously welcome.