Vagrantが急に起動できなくなった(NS_ERROR_FAILURE (0x80004005))

Jul 8, 2019 11:44 · 281 words · 2 minute read Vagrant VirtualBox

現象

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: ["startvm", "07dcb84a-1c56-4422-8abc-4a5c4077d7b1", "--type", "gui"]

Stderr: VBoxManage: error: The virtual machine 'xxxxxx_xxxxx_xxxxxxxxxxxxxx_xxxxx' has terminated unexpectedly during startup because of signal 6
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

対応

エラーコード検索して出てきたQiita記事。 https://qiita.com/k-yamada-github/items/22372515bea03d14cd30

VirtualBoxをアップデート

とりあえずVirtualBoxのアップデートが滞っていたので最新版をインストール。 https://www.virtualbox.org/

再度vagrant upしてみると

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

Vagrant has detected that you have a version of VirtualBox installed
that is not supported by this version of Vagrant. Please install one of
the supported versions listed below to use Vagrant:

4.0, 4.1, 4.2, 4.3, 5.0, 5.1

A Vagrant update may also be available that adds support for the version
you specified. Please check www.vagrantup.com/downloads.html to download
the latest version.

今のvagrantのバージョンだとVBのバージョンサポートしてないからアップデートしてくれみたいな感じ。

Vagrantをアップデート

https://www.vagrantup.com/downloads.html からダウンロードしてインストール。

もう一回vagrant up。またなんか出た…。

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-vbguest (= 0.15.1)'

プラグインもアップデートしてねみたいな。

記載されているvagrant plugin updateを実行。

Updating installed plugins...
All plugins are up to date.

これで起動できました!原因は分かりませんでした…。