「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
で出力されたエラーを確認すると「VirtualBoxのGUI画面を確認せよ」とのこと。
GUI画面で確認したエラーは下記のとおり。
これ以上どうしようもないので、再度インストールをし直すことにした。
VirtualBoxの公式サイトからファイルをDLして、アンインストール、インストールを行なう。
再インストール完了。
再度vagrant up
すると、以前と同様に起動した。
$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... (省略) ==> default: to force provisioning. Provisioners marked to run always will still run.
参考
- ゆったりぶろぐ: VirtualBoxが開けなくなったら
- 挫折から始まるプログラム開発奮闘記~フルスタックエンジニアを目指して~ 2014年06月08日
- Mac OS X Mavericks で Vagrant がこける時の対処法 | firegoby
余談
再インストール後にGUI画面でVirtualBoxを起動させたら、コンソール画面上でログインできなくて操作ができなくなった。[command] + [option] + [esc]で強制終了画面を出して終了させたんだが、この時、ログインIDとパスワードは何を入れたらよかったんだろうか?