ponkiti's blog

主に自分用、イベント参加メモや備忘録として利用

「vagrant up」でVirtualBoxが起動できない

Vagrantコマンドは効くようになったが、VirtualBoxで問題が発生した場合の対処法について書く。
Vagrantのプロジェクトディレクトリに移動し、vagrant upすると、エラーが出る。

$ cd myCentOSVM/
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Resuming suspended VM...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'restoring, running'. The machine is in the
'saved' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.

各サイトで書かれているようにsudo /Library/StartupItems/VirtualBox/VirtualBox restartを実行してみたが、command not found・・・。

$ sudo /Library/StartupItems/VirtualBox/VirtualBox restart
Password:
sudo: /Library/StartupItems/VirtualBox/VirtualBox: command not found

改めて、vagrant upで出力されたエラーを確認すると「VirtualBoxGUI画面を確認せよ」とのこと。
GUI画面で確認したエラーは下記のとおり。

f:id:pyoonn:20140926152517p:plain

これ以上どうしようもないので、再度インストールをし直すことにした。
VirtualBoxの公式サイトからファイルをDLして、アンインストール、インストールを行なう。

f:id:pyoonn:20140926153812p:plain

再インストール完了。

f:id:pyoonn:20140926162628p:plain

再度vagrant upすると、以前と同様に起動した。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
(省略)
==> default: to force provisioning. Provisioners marked to run always will still run.

参考

余談

再インストール後にGUI画面でVirtualBoxを起動させたら、コンソール画面上でログインできなくて操作ができなくなった。[command] + [option] + [esc]で強制終了画面を出して終了させたんだが、この時、ログインIDとパスワードは何を入れたらよかったんだろうか?

f:id:pyoonn:20140926162737p:plain