24
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MacOS MojaveでVirtualBoxがインストールできないときの対策

Last updated at Posted at 2019-05-18

ダウンロード.png

WEB系エンジニア転職にむけてMacBookProを購入しましたが、Rails学習前のローカル環境設定でいきなりハマりました。
いろいろ試して解決したのでシェアします。

環境

  • MacBookPro corei7 16GB 512GB
  • macOS 10.14.5 Mojave

症状

  1. VirtualBoxがインストールできない。
  2. インストールできてもvagrant up できない。

エラー

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 94 of file VBoxManageHostonly.cpp
mbp:MyCentOS kawahara$ vagrant ssh
VM must be running to open SSH connection. Run `vagrant up`
to start the virtual machine.
mbp:MyCentOS kawahara$ vagrant status
Current machine states:

default                   aborted (virtualbox)

The VM is in an aborted state. This means that it was abruptly
stopped without properly closing the session. Run `vagrant up`
to resume this virtual machine. If any problems persist, you may
have to destroy and restart the virtual machine.
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=500,gid=500 vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

対策

「VirtualBox製造元のOracleにkextを渡せばOK」

以下超訳です。

  • Macのセキュリティが厳しくてVirtualBoxインスコできひんやん!
  • なんやて!そんならセキュリティガバガバにして強制インスコや!
  • さすがにそれはやりすぎやろ!
  • せや!オラクルさんだけ特別に通行証渡したらええやん?

手順

  1. Macをセーフモードで起動。(⌘+R押しっぱなし)
  2. メニューバーからターミナルを起動。
  3. ターミナルで下記のコードを入力しEnter。
  4. Macを通常モードで再起動。
spctl kext-consent add VB5E2TV963

以上です。ありがとうございました。

参照

24
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?