Cannot vagrant up - VirtualBox machine already exists

Continuing the discussion from Relinking bedrock project (trellis) to existing VirtualBox:

I’m having a similar problem where when I vagrant up I receive a message telling me:

A VirtualBox machine with the name '*****.dev' already exists.
Please use another name or delete the machine with the existing
name, and try again.

Since I am unable to get the box running I am unable to do a database dump and start anew as suggested in the linked topic. Unless there is another way?

I’m not sure what I did to cause the box (or box’s storage device) to take on a new ID, but I was able to successfully reset the machine ID as suggested in this Stackoverflow thread.

This allows me to get past the “this box already exists” error but gets stuck when it tries to authorize the SSH key:

default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
...

I assume the SSH settings also rely on the ID string somehow to authenticate. If there isn’t a way to SSH into this machine to do a database dump and start fresh, is there a way to reconfigure this to use the proper ID string so that I may boot up the box as usual?

1 Like

I am having this exact same issue right now, on a VM I’ve been using fine all day. I halted it to run up another one, then when I went back to this had the same issues you’ve described.

1 Like

I think I’ve got this fixed by using this method here:

I had to login to the virtual machine in the VirtualBox app (couldn’t SSH into the machine using the terminal) using the username/password vagrant.

I also removed all references to the particular site in /etc/hosts/ as I noticed there were two references to the same site.

1 Like