A VirtualBox machine with the name 'homestead' already exists

前端 未结 30 4078
旧巷少年郎
旧巷少年郎 2020-12-02 04:58

Since homestead 2.0 homestead laravel has not been working

I don\'t know why \'homestead init\' creates a Homestead.yaml file in mydirectory/.homestead and not in

30条回答
  •  我在风中等你
    2020-12-02 05:38

    Renaming an already existing default VM

    Disclaimer

    The following procedure will destroy your VM and may be only suiteable in a desting-environment like mine! For production environments, consider to repair the association like described here

    I had this problem after overriding the default name of an already existing VM by using

    Vagrant.configure("2") do |config|
      config.vm.define :ubuntu_test
    

    where the VirtualBox name was also set (as a newbie I assumed that Vagrand will use this name too)

    config.vm.provider "virtualbox" do |vb|
         vb.name = "Ubuntu-Test"
    end
    

    By adding config.vm.define it seems that Vagrant doesn't associate the VirtualBox VM any more with the Vagrant file since even vagrant destroy -f say VM not created but vagrant up throw this error

    A VirtualBox machine with the name 'Ubuntu-Test' already exists.

    To delete those zombie VM
    1. If the VM is running, stop it first: vboxmanage shutdown (Here the name is Ubuntu-Test)
    2. Get the Id by running vboxmanage list vms
    3. Delete it: vboxmanage unregistervm --delete
    4. Now your VM can be re-created using vagrant up
    5. Using vagrant global-status --prune, your new name is present

提交回复
热议问题