【解決方法】VirtualBoxをHomebrewで再インストール後Vagrant起動時に発生したNS_ERROR_FAILUREの対処

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。
VirtualBoxを再インストール後Vagrant起動時に発生したNS_ERROR_FAILUREの解決手順をメモしました。
環境
- Vagrant 2.2.16
- VirtualBox 6.1.22 r144080
発生したエラー
実行ログ
zsh$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'centos/8' version '2011.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> 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 95 of file VBoxManageHostonly.cpp
VBoxManageのCLIの実行エラー
VagrantがVBoxManage
のCLIを実行しようとした際にエラーが発生しているようです。
zshThere was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
VirtualBoxで確認
VirtualBoxから起動を確認してみるとカーネルドライバーがインストールされていないというエラーが出ています。
zshKernel 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.
エラーの原因
システムソフトウェアアップデートの許可
VirtualBoxのアップデートの際にシステムソフトウェアアップデートの許可を実行していなかったことが原因でした。
システムソフトウェアアップデートを許可して解決
セキュリティとプライバシーを開く
システム環境設定
> セキュリティとプライバシー
を開きます。
実行許可
「開発元"Oracle Ameria, Inc."のシステムソフトウェアがアップデートされました。」の右側の許可
を実行します。
再起動の実施
再起動の案内が表示されるので任意のタイミングで再起動します。
「開発元 Oracle Ameria, Inc. のシステムソフトウェアがアップデートされました。」の右側の許可
を実行します。
Vagrantを再リロード
vagrant reload
コマンドでvagrantをリロードします。
zsh$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'centos/8' version '2011.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions 6.1.22 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Rsyncing folder: /Users/yuki.hayakawa/workspace/sakura-tools/ => /vagrant
==> default: Mounting shared folders...
default: /var/www/app => /Users/yuki.hayakawa/workspace/sakura-tools
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
無事起動することができました。
- article
【早見表】よく使うVagrantコマンドとオプションの一覧まとめ
- article
vagrantで起動したVM内で立ち上げているDockerのVolume(MySQLデータ永続化)で書き込みエラーになる件の対処
- article
【解決方法】Vagrantで構築したUbuntu20.04へsynced_folder を設定した際に発生するマウントエラーの対処
- article
【設定方法】VagrantとVirtualBoxでUbuntu20.04の仮想環境をサクッと構築する手順
- article
【設定方法】VagrantとVirtualBoxでCentOS8の仮想環境をサクッと構築する手順
- article
【解決方法】Vagrantを起動した際に発生するumount: /mnt: not mounted.の対処について
- article
【解決方法】VirtualBoxをHomebrewで再インストール後Vagrant起動時に発生したNS_ERROR_FAILUREの対処
- article
【設定方法】OS内に仮想環境が構築できるVirtualBoxをMacのHomeBrewでサクッとインストールする手順
- article
AI ペアプログラミング時代到来!Codex で効率化するチーム開発術
- article
【トラブル解決】git push が拒否される原因と安全な対応手順
- article
VSCode 拡張との比較でわかる!Cursor を選ぶべき開発スタイル
- article
MySQL 入門:5 分でわかる RDBMS の基本とインストール完全ガイド
- article
Cline × VSCode:最強の AI ペアプログラミング環境構築
- article
Convex 入門:5 分でリアルタイム DB と関数 API を立ち上げる完全ガイド
- blog
Googleストアから訂正案内!Pixel 10ポイント有効期限「1年」表示は誤りだった
- blog
【2025年8月】Googleストア「ストアポイント」は1年表記はミス?2年ルールとの整合性を検証
- blog
Googleストアの注文キャンセルはなぜ起きる?Pixel 10購入前に知るべき注意点
- blog
Pixcel 10シリーズの発表!全モデル Pixcel 9 から進化したポイントを見やすく整理
- blog
フロントエンドエンジニアの成長戦略:コーチングで最速スキルアップする方法
- blog
失敗を称賛する文化はどう作る?アジャイルな組織へ生まれ変わるための第一歩
- review
今の自分に満足していますか?『持たざる者の逆襲 まだ何者でもない君へ』溝口勇児
- review
ついに語られた業界の裏側!『フジテレビの正体』堀江貴文が描くテレビ局の本当の姿
- review
愛する勇気を持てば人生が変わる!『幸せになる勇気』岸見一郎・古賀史健のアドラー実践編で真の幸福を手に入れる
- review
週末を変えれば年収も変わる!『世界の一流は「休日」に何をしているのか』越川慎司の一流週末メソッド
- review
新しい自分に会いに行こう!『自分の変え方』村岡大樹の認知科学コーチングで人生リセット
- review
科学革命から AI 時代へ!『サピエンス全史 下巻』ユヴァル・ノア・ハラリが予見する人類の未来