Somehow my Vagrant project has disassociated itself from its VirtualBox VM, so that when I vagrant up
Vagrant will import the base-box and create a new virtual
Had the issue today, my .vagrant
folder was missing and found that there was a few more steps than simply setting the id:
Set the id:
VBoxManage list vms
Find the id and set in {project-folder}/.vagrant/machines/default/virtualbox/id
.
Note that default
may be different if set in your Vagrantfile
e.g. config.vm.define "someothername"
.
Stop the machine from provisioning:
Create a file named action_provision
in the same dir as the id
file, set it's contents to: 1.5:{id}
replacing {id}
with the id found in step 1.
Setup a new public/private key:
Vagrant uses a private key stored in .vagrant/machines/default/virtualbox/private_key
to ssh into the machine. You'll need to generate a new one.
ssh-keygen -t rsa
name it private_key
.
vagrant ssh
then copy the private_key.pub
into /home/vagrant/.ssh/authorized_keys
.