Vagrant Up failing because the name already exists

别说谁变了你拦得住时间么 提交于 2019-12-05 02:50:30

Hum .. This is a weird issue. when you run vagrant halt it just send signal to terminate the VM.

Vagrant keeps all the configuration under a .vagrant directory (at least for mac os and linux, not fully sure if windows) , you should never delete this directory as it has all the reference to your vm, so when you run vagrant up next time, vagrant will search for information from this directory to start the corresponding vm, and it knows it does not need to recreate the VM nor provisioning.

The correct way to remove information about your vm is to run vagrant destroy, it will delete all the .vagrant directory and the vm.

The are then ways to make this linkage again from .vagrant and your vm but its a bit tricky and not sure they are officially supported

When you use vagrant, VirtualBox should become (almost) transparent, you should not need to start it to use your VM, everything should be run from vagrant (at least at beginner level)

Note : running on windows, you should be fine if you run as administrator

DDT

If you are on a Mac, and vagrant destroy doesn't work, and you get the message: The name of your virtual machine couldn't be set because VirtualBox is reporting another VM with that name already exists. Then you need to go to the VirtualBox VMs folder in your user folder and delete the VM folder.

It's in a weird state where it can't build the VM because it's trying to create settings for a folder that is already there with the same name.

Mine was a little simpler than most of these. I checked the "Virtual Box VMs" directory (for windows) and deleted the folder that was named what it was trying to be named as. This resolved the issue for me.

Sudhir

I got above mentioned git bash error while vagrant up. There are multiple possibilities to occur this issue.

I have used below mentioned steps and vagrant command working properly.

  1. Open Oracle VM virtual manager - In this Oracle VM virtual manager panel, Remove current running virtual machine.
  2. Exit from git bash command prompt
  3. Open git bash again
  4. Run vagrant up command as vagrant up

Vagrant up command will run successfully.

Please note: Make sure you will run vagrant halt command while close git bash command prompt.

First, vagrant halt and then exit command.

VBoxManage: error: Could not rename the directory '<SOURCE>' to '<DESTINATION>' to save the settings file (VERR_ALREADY_EXISTS)

If you don't care about your VM state and you can provision it from scratch, remove your destination folder, then it should work. Also double check if you've removed it from VirtualBox list as well.

This could happened with VirtualBox not cleaning up properly or you interrupted the process of cleaning (e.g. Ctrl-C in the middle of vagrant destroy).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!