Navigation Menu

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 ArtemBernatskyy/bfdf63283e61d4f881299802e4ea4114 to your computer and use it in GitHub Desktop.
Save ArtemBernatskyy/bfdf63283e61d4f881299802e4ea4114 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment