A few times recently, I’ve had instances where
Vagrant seems to have forgotten which virtual
machine it’s supposed to load, probably due to renaming a project directory or
the .vagrant directory being moved accidentally.
Here are the steps that I took to fix this and point Vagrant back at the correct
- Stop the machine from running using the
$ vagrant halt command.
- Use the
$ VBoxManage list vms command to view a list of the virtual
machines on your system. Note the ID of the correct VM that should be
loading. For example,
The number within the curly brackets is the ID of the virtual machine.
- Within the .vagrant directory in your project (it is hidden by default),
update the ID within the machines/default/virtualbox/id file.
- Start the new VM with
$ vagrant up.