突然 vagrant up ができなくなった

vagrant upしたら、以下のようなエラーが出て、VMの起動ができなかった。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'ubuntu12_04'...
There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["import", "C:/Users/terurou/.vagrant.d/boxes/ubuntu12_04/virtualbox/box.ovf"]

Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting C:\Users\terurou\.vagrant.d\boxes\ubuntu12_04\virtualbox\box.ovf...

OK.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance import failed
VBoxManage.exe: error: Machine settings file 'C:\Users\terurou\VirtualBox VMs\precise64\precise64.vbox' already exists
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine
VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct HandlerArg *)" at line 779 of file VBoxManageAppliance.cpp

なんとなくVMを見失ってる気配を感じたので、IDを確認してみたら、何かの拍子でVMのIDが変更されていたようだ。

$ VBoxManage list vms

の結果と、.vagrant/machines/default/virtualbox/ID ファイルの内容を比較して、値が違っているようなら、VBoxManageで取得したIDで更新する。