背景
あるとき、Vagrantfileを編集したらこんなエラーになった。言われるがままにvagrant upしたら今まで作った環境を捨ててCreateしちゃうのでせっかく作った開発環境をやりなおしってなことになりかねません。あと、vagrant haltとかvagrant reloadもやめといたほうがいいっぽい。
toki-mac:my_vagrant tokifuji$ vagrant status
Current machine states:
default                   not created (virtualbox)
The environment has not yet been created. Run `vagrant up` to
create the environment. If a machine is not created, only the
default provider will be shown. So if a provider is not listed,
then the machine is not created for that environment.
toki-mac:my_vagrant tokifuji$
.vagrant/machines/default/virtualbox/idがいるか?
いないお(´;ω;`)ブワッ
toki-mac:my_vagrant tokifuji$ ll .vagrant/machines/default/virtualbox   
total 0
drwxr-xr-x  2 tokifuji  staff   68 Mar  1 14:35 .
drwxr-xr-x  3 tokifuji  staff  102 Feb 29 16:36 ..
UUIDを調べる
慌てるなって。
toki-mac:my_vagrant tokifuji$ vboxmanage list vms
"my_vagrant_default_*************_*****" {********-****-****-****-************}
この********-****-****-****-************をコピーしておく。
.vagrant/machines/default/virtualbox/idを作る
toki-mac:my_vagrant tokifuji$ vim .vagrant/machines/default/virtualbox/id
vimで作って先ほどコピったUUIDをペーストして保存。
.vagrant/machines/default/virtualbox/id
********-****-****-****-************
vagrant statusで確認
toki-mac:my_vagrant tokifuji$ 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`.
toki-mac:my_vagrant tokifuji$

