Vagrant VirtualBox VM is initializing new instead of loading the existing VM after VagrantFile change
I setup a Vagrant Ubuntu 12.04 box (VirtualBox as the provider) on Windows and it's been working great for the past few months. Yesterday, I added another forwarded port to the VagrantFile and did vagrant halt
and vagrant up
. Once I logged in, none of the programs I had installed were there ( which git
showed nothing ).
I can boot the VM manually through the VirtualBox gui and everything is correct, so I know it's there and working. I tried the solution in this related stackoverflow question, but vagrant up
still doesn't start the existing vm.
Here's the VirtualBox Log for my Vagrant VM: http://paste.ubuntu.com/6460060/
Not sure where else to look. Is there a way to force vagrant to load the existing VM?
Edit: Here's my VagrantFile as well. It's pretty standard, but I guess it might help. https://gist.github.com/gorrillamcd/7694989
Keep in mind that the machine was working fine until I made a change to my VagrantFile. It's the only thing that changed between functioning and non-functioning.
Solution 1:
The link between your working directory (the one with the Vagrantfile
) and the VirtualBox VM is a file called id
placed in the following subdirectory:
.vagrant\machines\<machine_name>\virtualbox
(Usually the <machine_name>
for a single VM Vagrantfile
is default
).
The id
file contains the UUID of the VirtualBox VM. You should check out the correct UUID using the following command:
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" showvminfo <VM_NAME> | findstr /B UUID
Then you should replace the id
file with that UUID, and finally run vagrant up
.