I was working on a virtual machine that I set up with Vagrant when I realized that I needed to access it through port 8000 to test a web interface so I did vagrant halt in order to modify the Vagrantfile and forward port 8000 then I saved the file and did vagrant up
to boot back up that machine and to my surprise instead Vagrant built a new machine from scratch. Now when I look inside the folder named 'VirtualBox VMs' I can see two VMs with the same name + a long number that differs. I believe one is the first machine that I want to boot with all my packages and settings while the other is the new empty one.
How can I switch back to the first one so when I do vagrant up it actually boots that one? And optionally how do I get rid of the new, empty one?
My understanding is each Vagrant project directory (home of the Vagrantfile) is associates with a Virtual Machine managed by vagrant in VirtualBox (default provider). Normally in the pattern of "baseboxname_id".
Your problem could be caused by bugs in old Vagrant versions. Please make sure you are running the latest Vagrant 1.3.3 + VirtualBox 4.2.18. OR, possibly mixed up multiple Vagrantfile (not likely to be the case based on your description).
Vagrantfile resides/path/to/Vagrantfile/.vagrant/.vagrant/machines/default/virtualbox/id,
you'll get an id like a90df491-4c25-4a07-be1a-be137908058c.
NOTE: This is the
uuidof the Virtual Machine associated with the Vagrantfile managed by VirtulBox.
Now that you know the uuid, you can unregister the VM and delete it => VBoxManage unregistervm <uuid> --delete.
Vagrantfile with the 1st VM/path/to/Vagrantfile/.vagrant/.vagrant/machines/default/virtualbox/id
vagrant up
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With