I was getting that exact same error and tried the same steps bobpoole mentioned (and many more) but Darius123's solution of adding Oracle to approved kexts in recovery mode did not work for me until after I'd successfully installed VirtualBox. After a lot of trial and error, I ended up getting VirtualBox installed and run with vagrant by disabling csrutil (in recovery mode) then rebooting and running `chflags -R restricted /V*/*/Library/StagedExtensions` in recovery mode. However, after everything was successfully installed and working, I enabled csrutil and tried to test it again but VirtualBox didn't start properly with the messages:
Code: Select all
The virtual machine 'vagrant' has terminated unexpectedly during startup with exit code 1 (0x1).
Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
MachineWrap
Interface:
IMachine {5047460a-265d-4538-b23e-ddba5fb84976}
and
Code: Select all
Kernel driver not installed (rc=-1908)
Make sure the kernel module has been loaded successfully.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
Once again, googling showed the solution as going to Security & Privacy to allow the blocked item but nothing shows up there and it still gives me that error when spctl is disabled. I then tried Darius123's solution again and this time it worked (maybe because it was now installed successfully or something). Hopefully this can help someone else if they run into the same issue.
Some of the many things I tried that didn't work:
- Installing older versions of VirtualBox
- Installing Virtualbox with Homebrew
- Monitoring System Preferences > Security & Privacy for an access blocked dialogue
- Disabling spctl
- Running the uninstall tool countless times throughout this process
- Restarting my computer a number of times
- Deleting any VirtualBox files I could find with `ag VirtualBox /` and `find / -name VirtualBox`
- Entering recovery mode and searching for any VirtualBox related files to try and delete them
- In recovery mode, running `chflags -R restricted /V*/*/Library/StagedExtensions` and rebooting before trying to install VirtualBox again
- Running sudo kextutil -v -t /Library/Application\ Support/VirtualBox/VBoxDrv.kext which outputs the following (no it's not cut off, it really does end on the "Diagnostics for ....kext:" and I also get this same rejection message even if I have done `sudo spctl --master-disable`)
Code: Select all
Defaulting to kernel file '/System/Library/Kernels/kernel'
Kext rejected due to system policy: <OSKext 0x7fc9d643e740 [0x7fff8ac5f8e0]> { UR = "file:///Library/StagedExtensions/Library/Application%20Support/VirtualBox/VBoxDrv.kext/", ID = "org.virtualbox.kext.VBoxDrv" }
Kext rejected due to system policy: <OSKext 0x7fc9d643e740 [0x7fff8ac5f8e0]> { UR = "file:///Library/StagedExtensions/Library/Application%20Support/VirtualBox/VBoxDrv.kext/", ID = "org.virtualbox.kext.VBoxDrv" }
Diagnostics for /Library/Application Support/VirtualBox/VBoxDrv.kext:
^ it made me remove an "L" where the URs are so I could post this as a new user