解决MacOS VirtualBox: Error -610 in supR3HardenedMainInitRuntime!

最近项目转向 Kubernates, 于是想在本地安装使用 minikube.
但不知是因为何时升级了 MacOS (10.13.3) 还是升级了VirtualBox, VirtualBox就是无法正常启动, 总是显示错误:

VirtualBox: Error -610 in supR3HardenedMainInitRuntime!
VirtualBox: dlopen("/Applications/VirtualBox.app/Contents/MacOS/VBoxRT.dylib",) failed: <NULL>

VirtualBox: Tip! It may help to reinstall VirtualBox.

来来回回卸载安装不同版本也毫无作用...
尝试使用 brew cask install virtualbox 也能成功, 但是还是一样的错误, 也没有输出任何有用的信息. 很是郁闷..

但是 brew search virtualbox 的结果里边还有一个
caskroom/cask/virtualbox-extension-pack
于是抱着试试看的态度
brew cask install virtualbox-extension-pack

没想到这次竟然有不同!

0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/local/Caskroom/virtualbox-extension-pack/5.2.8,121009/Oracle_VM_VirtualBox_Extension_Pack-5.2.8-121009.vbox-extpack"
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: The owner is not root: '/Applications'
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: An unknown (and thus untrusted) group has write access to '/Applications' and we therefore cannot trust the directory content or that of any subdirectory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg *)" at line 1211 of file VBoxManageMisc.cpp

连忙查看/Applications的权限, 不知道什么时候改成了 xxx:staff, 赶忙
sudo chown root:wheel /Applications

再次brew cask install virtualbox-extension-pack

==> Installing Cask virtualbox-extension-pack
==> 0%...
==> 10%...20%...30%...40%...50%...60%...70%...80%...90%...
==> 100%
?  virtualbox-extension-pack was successfully installed!

成功的预感!
再次启动 VirtualBox, 久违的界面终于回来了!

minikube start 也可以成功, 终于能安心学习 K8S 了, 去了一块心病 :)

相关推荐