macOSをHighSerriaにアップグレードしたらVagrantやVirtualBoxが動かなくなった

解決法

システム環境設定 -> セキュリティとプライバシー -> いくつかのシステムソフトウェアの読み込みがブロックされました -> 許可
Oracle America inc にチェック

f:id:kuronekopunk:20171023171844p:plain

状況

vagrant up したら何やら怒られた

vagrant up     
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-14.04' is up to date...
==> default: A newer version of the box 'bento/ubuntu-14.04' is available! You currently
==> default: have version '2.2.7'. The latest is version '201708.22.0'. Run
==> default: `vagrant box update` to update.
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg*)" at line 71 of file VBoxManageHostonly.cpp

vagrant失敗する場合VirtualBoxを再インストールしたらいいとの記事を見つけて再インストールしてみた

brew cask install virtualbox
==> Satisfying dependencies
==> Downloading http://download.virtualbox.org/virtualbox/5.1.26/VirtualBox-5.1.26-117224-OSX.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask virtualbox
==> Installing Cask virtualbox
==> Running installer for virtualbox; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is Oracle VM VirtualBox
==> installer: Installing at base path /
==> installer: The install failed (エラーによってインストールできませんでした。ソフトウェアの製造元に問い合わせてください。)
Error: Command failed to execute!

==> Failed command:
/usr/bin/sudo -E -- /usr/sbin/installer -pkg /usr/local/Caskroom/virtualbox/5.1.26-117224/VirtualBox.pkg -target /

==> Standard Output of failed command:
installer: Package name is Oracle VM VirtualBox
installer: Installing at base path /
installer: The install failed (エラーによってインストールできませんでした。ソフトウェアの製造元に問い合わせてください。)


==> Standard Error of failed command:


==> Exit status of failed command:
#<Process::Status: pid 8033 exit 1>
Error: Install incomplete.

失敗

改めて解決法

環境設定でロックされているだけでした。

システム環境設定 -> セキュリティとプライバシー -> いくつかのシステムソフトウェアの読み込みがブロックされました -> 許可 Oracle America inc にチェック

f:id:kuronekopunk:20171023171844p:plain

エラーは分かりやすくして欲しい…