I also need to add to this thread...
I updated VirtualBox from 6.1.8 to 6.1.16 on my Mac running Mojave and the installer failed with "The installation failed. The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance."
I remebered this to be common and usually you just need to allow the kernel extensions in "Preferences > Security & Privacy > General". But nothing was there, also I would expect that on a fresh install not an update. VirtualBox ran just fine before the update!
I checked the loaded kexts, but nothing:
- Code: Select all Expand viewCollapse view
# kextstat | grep -i virt
159 0 0xffffff7f8491e000 0x13000 0x13000 com.apple.driver.AppleVirtIO (2.1.3) CAFDF80E-E7BD-3916-9BB0-41F51B5A6471 <79 21 13 6 5 3 1>
I did some googling and found several threads on different forums and tried some of the suggestions.
I ran
- Code: Select all Expand viewCollapse view
# sudo spctl --master-disable
and tried again. No change. I ran the uninstall.tool and installed again. Did that again but rebooted in-between.
Found this script and tried to load/unload the kexts that way and get them to appear in Preferences:
- Code: Select all Expand viewCollapse view
# bash -x vbox_kext.sh
+ case "$1" in
+ unload
++ ps -ef
++ grep -c 'VirtualBox$'
+ '[' 0 -ne 0 ']'
++ ps -ef
++ grep -c '[V]ir'
+ '[' 0 -gt 0 ']'
+ echo 'Unloading Kernel Extensions'
Unloading Kernel Extensions
+ kextstat
+ grep org.virtualbox.kext.VBoxUSB
+ kextstat
+ grep org.virtualbox.kext.VBoxNetFlt
+ kextstat
+ grep org.virtualbox.kext.VBoxNetAdp
+ kextstat
+ grep org.virtualbox.kext.VBoxDrv
+ load
+ echo 'Loading Kernel Extentions'
Loading Kernel Extentions
+ sudo kextload '/Library/Application Support/VirtualBox/VBoxDrv.kext' -r '/Library/Application Support/VirtualBox/'
Password:
/Library/Application Support/VirtualBox/VBoxDrv.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
+ sudo kextload '/Library/Application Support/VirtualBox/VBoxNetAdp.kext' -r '/Library/Application Support/VirtualBox/'
/Library/Application Support/VirtualBox/VBoxNetAdp.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
+ sudo kextload '/Library/Application Support/VirtualBox/VBoxNetFlt.kext' -r '/Library/Application Support/VirtualBox/'
/Library/Application Support/VirtualBox/VBoxNetFlt.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
+ sudo kextload '/Library/Application Support/VirtualBox/VBoxUSB.kext' -r '/Library/Application Support/VirtualBox/'
/Library/Application Support/VirtualBox/VBoxUSB.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).
I then went to rescue mode and ran
- Code: Select all Expand viewCollapse view
# /usr/sbin/spctl kext-consent add VB5E2TV963
I got the ID from
- Code: Select all Expand viewCollapse view
# cd '/Library/Application Support/VirtualBox/'
# spctl -a -vv -t install VBoxNetAdp.kext
VBoxNetAdp.kext: accepted
source=Notarized Developer ID
override=security disabled
origin=Developer ID Application: Oracle America, Inc. (VB5E2TV963)
and re-tried all of the above. Never did I see any prompt to allow the extension in Preferences.
Compare (the consent-list was empty before I did that):
- Code: Select all Expand viewCollapse view
# spctl kext-consent list
Allowed Team Identifiers:
VB5E2TV963
As a last resort I then re-entered rescue mode and entered
- Code: Select all Expand viewCollapse view
# csrutil disable
and rebooted. Without any further intervention the kexts were loaded and VirtualBox worked.
- Code: Select all Expand viewCollapse view
# kextstat | grep -i virt
111 3 0xffffff7f83ee0000 0xf2000 0xf2000 org.virtualbox.kext.VBoxDrv (6.1.16) DAF044F0-5043-3B8E-8758-5A462567BDAA <8 6 5 3 1>
164 0 0xffffff7f848ce000 0x13000 0x13000 com.apple.driver.AppleVirtIO (2.1.3) CAFDF80E-E7BD-3916-9BB0-41F51B5A6471 <79 21 13 6 5 3 1>
166 0 0xffffff7f848e1000 0x8000 0x8000 org.virtualbox.kext.VBoxUSB (6.1.16) CA33FA52-5933-3F0E-9B40-8B1ECF4D6A36 <165 111 64 8 6 5 3 1>
184 0 0xffffff7f85c6b000 0x5000 0x5000 org.virtualbox.kext.VBoxNetFlt (6.1.16) C93EAF6A-676F-3370-BAE2-BDFD2BF16582 <111 8 6 5 3 1>
185 0 0xffffff7f85c70000 0x6000 0x6000 org.virtualbox.kext.VBoxNetAdp (6.1.16) 76200407-D2F0-3D84-BCCF-7EEA18F16654 <111 6 5 1>
But when I enable csrutil again I am back to where I came from.
- Code: Select all Expand viewCollapse view
# sw_vers -productVersion
10.14.6
Any more ideas what I could do to get the extensions approved? Any more logs I could provide?
Thanks!
EDIT: So I have actually been able to fix this right now. I cannot fully recall which error
- Code: Select all Expand viewCollapse view
# sudo kextutil -t VBoxDrv.kext
produced, but it had something to do with a staging error and a temporary directory. I have elaborated on this more in my post below.
In the end I could fix it by running the following from the rescue environment after unlocking "Macintosh HD"
- Code: Select all Expand viewCollapse view
# chflags restricted /Volumes/Macintosh\ HD/private/var/db/KernelExtensionManagement
# chflags restricted /Volumes/Macintosh\ HD/private/var/db/KernelExtensionManagement/Staging
Afterwards rebooted and verified:
- Code: Select all Expand viewCollapse view
# ls -ldO /Volumes/Macintosh\ HD/private/var/db/KernelExtensionManagement
drwxr-xr-x@ 3 root wheel restricted 96 30 Sep 12:16 /Volumes/Macintosh HD/private/var/db/KernelExtensionManagement
# ls -ldO /Volumes/Macintosh\ HD/private/var/db/KernelExtensionManagement/Staging
drwxr-xr-x 2 root wheel restricted 64 4 Nov 21:57 /Volumes/Macintosh HD/private/var/db/KernelExtensionManagement/Staging
Extensions can now be loaded again!