2014/01/23

「Your VM has become "inaccessible."」メッセージでVagrant起動に失敗した場合の復旧方法

Posted on 9:34 in
Vagrant環境の起動(Vagrant up)を実行した所、
以下メッセージで起動に失敗した時の復旧方法になります。
-----------------------------------------------------------------------
C:\HashiCorp\Vagrant\localdev>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
Your VM has become "inaccessible." Unfortunately, this is a critical error
with VirtualBox that Vagrant can not cleanly recover from. Please open VirtualBox
and clear out your inaccessible virtual machines or find a way to fix
them.

C:\HashiCorp\Vagrant\localdev>
-----------------------------------------------------------------------

VirtualBox上で確認すると、「アクセスできません」というステータスで
操作できなくなっているようです。




ここで、
対象のVirtualBox用ディレクトリにある仮想マシンイメージファイル(.vox)
の「xxxxxx.vbox-tmp」を「xxxxxx.vbox」にリネームして、
Virtualboxを再起動すると「中断」状態で正常認識されました。


この状態で再度vagrantupを実行すると正常起動を確認できました。
-----------------------------------------------------------------------
C:\HashiCorp\Vagrant\localdev>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => xxxx (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
-----------------------------------------------------------------------

Virtualbox上でも正常起動が確認できました。




直前にvagarant halt実行しないまま、うっかりPCシャットダウンしてしまったので、間違いなくそれが原因だと思います。。
この時、起動時に参照するべきVirtualBox用仮想マシンイメージファイル(.vox)が正常終了していないためにtmpファイルとして別名保存されていたようです。

同様の現象の場合はお試しあれ。

1 件のコメント

  1. 「直前にvagarant halt実行しないまま、うっかりPCシャットダウンしてしまったので、間違いなくそれが原因だと思います。。」

    はい、まさにその通りでした。。。。
    ファイル名が.vbox-tmp になっていたのが原因でした

    とっても助かりました!ありがとうございました!

    返信削除