LoginSignup
1
0

More than 3 years have passed since last update.

「A VirtualBox machine with the name 'homestead-7' already exists. Please use another name or delete the machine with the existing name, and try again.」が出た時の対処法

Last updated at Posted at 2019-07-21

問題

vagrant upしようとすると以下のエラーが発生

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

日本語に直すと
「homestead-7という名前の仮想マシン名が既に存在するので他の名前を使うか、既に存在する名前の仮想マシンを削除するかをして、再び試してください」
とのこと

解決策

vagrant global-status --prune

上記のコマンドでVagrantの環境を確認する

$ vagrant global-status --prune
id       name        provider   state    directory
------------------------------------------------------------------------------
cd2734f  default     virtualbox saved    /Users/userName/MyVagrant/MyCentOS
dba0fa1  default     virtualbox poweroff /Users/userName/vagrant/ubuntu64_18
bdf825c  homestead-7 virtualbox poweroff /Users/userName/Homestead

The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"

確認した後にエラーが出た名前のもの(今回はhomestead-7)を削除する。この後にvagrant upをしてやる。これで解決しない場合は②を

vagrant box listでboxごと削除

上記のコマンドでboxの一覧を表示し、エラーが出た名前のboxを削除し、boxを再度追加。再度vagrant upする。これで解決しない場合は③を

vboxmanage list vms

上記のコマンドで仮想マシン一覧を表示

"homestead-7" {f9c95eed-b1ce-426d-ab90-e03f19b6d29f}

VBoxManage unregistervm f9c95eed-b1ce-426d-ab90-e03f19b6d29f --deleteで削除したのちにvagrant upを行う。(僕は①、②を行っても解決しなかったのですが、この③の方法で解決しました)

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0