Fixing a messed up Vagrant installation

I’m currently struggling with what seems like a bug in Virtualbox that affects the new Core i7 MacBooks. While trying to fix it by building Virtualbox from source, uninstalling and reinstalling, I managed to mess up a box managed with Vagrant, rendering it inaccessible.

If you find yourself in a similar situation, you can try to fix it with the VBoxManage command.

$ VBoxManage list vms
"" {b68ed7a7-6e72-4f16-a438-8775cd80d9b3}
$ VBoxManage unregistervm {b68ed7a7-6e72-4f16-a438-8775cd80d9b3} --delete
VBoxManage: error: The object is not ready
VBoxManage: error: Details: code E_ACCESSDENIED (0x80070005), component Machine, interface IMachine, callee nsISupports
Context: "Delete(ComSafeArrayAsInParam(aMedia), pProgress.asOutParam())" at line 175 of file VBoxManageMisc.cpp
Segmentation fault

As you can see, it died with a segmentation fault, but the broken box was now gone and I could restart it with vagrant up.
Continue reading