Created
January 5, 2014 16:51
-
-
Save leocosta/8270609 to your computer and use it in GitHub Desktop.
Re-associate vagrant with vm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Had the same issue and found a workaround. This is how it occurred: | |
Had two VMs running, went home for the day | |
Windows updated and restarted during the night | |
Came to work, fired up cygwin and ran vagrant up dev. Saw that vagrant began creating a new box and cancelled. | |
Opened Virtualbox and saw that no VMs where listed. Found the path to "Default Machine Folder", opened it in Windows and saw that my previous VMs still existed on disk | |
Deleted the thrid VM on disk that was accidentally created with "vagrant up" | |
Readded the old VMs to Virtualbox by going to "Machine -> Add..." and adding the VMs from disk manually | |
Ran vagrant status | |
At this point the VMs where still listed as "(not created)". | |
Ran VBoxManage list vms to find the ids of the VMs | |
Went in to ./vagrant/machines/dev/virtualbox/id and updated the id | |
Ran vagrant status | |
At this point the VMs where STILL listed as (not created). Began debugging by putting puts around in vagrant source code (tip if you ever need to do this, manipulate vagrant directly in C:\vagrant\embedded\gems\vagrant-1.2.1) | |
Found the issue why vagrant wouldn't report status correctly, even if the IDs matched. When I manipulated the ID directly in ./vagrant/machines/dev/virtualbox/id, I accidentally added a newline to the end. | |
Without the newline (eg. echo -n "insert-hash-to-vm-here" > vagrant/machines/dev/virtualbox/id), vagrant status finally worked again. I suspect this is your issue as well @ReeceMarsland ? | |
I still don't know what got VirtualBox to "loose" the VMs in the first place, but as far I can tell, that's a bug in VirtualBox and not Vagrant. | |
Vagrant version: 1.2.1 | |
VirtualBox version: 4.2.12 r84980 | |
Windows 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment