Vagrant Box With This Name Already Exists
A VirtualBox machine with the name 'ubuntu-xenial-16.04-cloudimg' already exists.
Please use another name or delete the machine with the existing name, and try again.
There’s a stackoverflow question about this and a good answer (not the accepted one, the highest-voted one) which helped me a bit but it still wasn’t completely clear to me how to fix my problem and I had to dig about a bit.
EDIT: This is completely different to my original proposed solution, which actually broke other VMs! Do it this way instead …
The problem is that the box has been packaged with its name hardcoded in it – usually it’s better not to set the name of the box and let vagrant pick a name for it (usually the name of the directory, plus the date or something). The first VM you bring up will be fine but the second one will collide. To stop this happening, you need to manually name all of your boxes by doing something like this in your Vagrantfile
:
config.vm.provider "virtualbox" do |vb| vb.name = "myapp-database" end
By setting the name for each box, we override their packaged name and correct the problem above.
Tangent: Ubuntu/Xenial Vagrant Box Has No Guest Additions
If you’re using this box then one of the other problems you will encounter is that it was packaged without the guest additions installed. Try the vagrant-vbguest plugin to fix that problem as well. You’re welcome :)
https://stackoverflow.com/questions/37165846/vagrant-error-a-virtualbox-machine-with-the-name-already-exists/38523445#38523445