Fix vagrant can’t recognize VM and create new VM problem
Vagrant (www.vagrantup.com) has been my favorite VM manager for development purposes. It’s generally fast, highly-configurable and easy-to-use. Vagrant is based on VirtualBox (www.virtualbox.org), of which the combination sometimes causes problems.
For example, there are times when vagrant couldn’t recognize the existing VM in the folder, and keeps creating new VMs. This typically, but not reliably so, happens after I upgraded VirtualBox/ Vagrant or changed VM stored location. I’ve drawn out steps to fix this in my machine.
- Open VirtualBox. Find your old VM that you want to re-associate and the wrongfully created new VMs. Right click the old VM and select "Show in Explorer"
- In the folder that's opened, find
you-box-name.vbox-prevand open with text editor. Note the
- Now go to the original directory where your VM is supposed to be called up. Expand .vagrantmachinesdefaultvirtualbox and open
idfile with texteditor. Replace the uuid inside with the old VM uuid
In case the above does not work for you, check these useful links: