Site icon Tips Note by TAM

【vagrant】win7 + vbox4.3.12 ssh がクローズするのを解決する方法

端末がスリープ後、復帰したら、vagrant ssh が接続できなくなる時があるのです。
毎回destroy しなくてよくなりました。
一次停止してやるといいみたいです。

vagrant SUSPEND コマンドとは?

【環境】
vbox4.3.12
vagrant
 Installed Version: 1.6.3
 Latest Version: 1.7.0

いろいろ試した結果下記の操作で復帰できます。

vagrant status => Running 状態
vagrant suspend => 一時的な停止
vagrant reload => Vagrantfileの再読み込み
vagrant provison

参考ログ

D:\vagrant\tam-vagrant-master>vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

D:\vagrant\tam-vagrant-master>vagrant suspend
==> default: Saving VM state and suspending execution...
==> default: Removing hosts on suspend disabled

D:\vagrant\tam-vagrant-master>vagrant reload
==> default: Discarding saved state of VM...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
(略)
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.

D:\vagrant\tam-vagrant-master>vagrant provision