Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
297 views
in Technique[技术] by (71.8m points)

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

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 machine.

Is there a way to re-associate the Vagrant project with the existing VM? How does Vagrant internally associate a Vagrantfile with a VirtualBox VM directory?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...