How do I associate a Vagrant project directory with an existing VirtualBox VM?

后端 未结 10 1802
梦如初夏
梦如初夏 2020-12-02 03:57

Somehow my Vagrant project has disassociated itself from its VirtualBox VM, so that when I vagrant up Vagrant will import the base-box and create a new virtual

10条回答
  •  Happy的楠姐
    2020-12-02 04:14

    For Vagrant 1.6.3 do the following:

    1) In the directory where your Vagrantfile is located, run the command

    VBoxManage list vms
    

    You will have something like this:

    "virtualMachine" {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
    

    2) Go to the following path:

    cd .vagrant/machines/default/virtualbox
    

    3) Create a file called id with the ID of your VM xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

    4) Save the file and run vagrant up

提交回复
热议问题