Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizanRahman/7b17918a8e23fb493a84e0c6be8950e8 to your computer and use it in GitHub Desktop.
Save mizanRahman/7b17918a8e23fb493a84e0c6be8950e8 to your computer and use it in GitHub Desktop.
Associate a Vagrant project directory with an existing VirtualBox VM
  1. In the directory where your Vagrantfile is located, run the following command and copy the ID of your VM
VBoxManage list vms
=> "virtualMachine" {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
  1. Go to the Vagrant project configuration folder
cd .vagrant/machines/default/virtualbox
  1. Create a file called id without a newline and the ID of your VM xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
echo -n 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' > id
  1. Run Vagrant with new config
vagrant up
@mizanRahman
Copy link
Author

VBoxManage list vms will list the virtual machines and their uuids without having to know the path to the particular vd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment