Cleaning up is one of the advantages of working with VMs over a bare metal install. Since everything is in the disk image files, we only need to delete the VM. Vagrant provides two commands for this purpose:
Stopping and Deleting the VM
Change to the directory containing the Vagrantfile, and then stop the VM:
To delete the VM permanently:
Cleaning up the Hosts File
You may choose to remove any custom hostnames you created in your hosts file on your host OS. If you’re using VDD across multiple projects, however, there’s no need to delete the drupal7.dev and drupal8.dev host file entries. Even if you decide to clone VDD again in a different directory, it will still use the same IP address and hostnames.
Troubleshooting a vagrant VM can be difficult. The most common problems are bad provisions due to interruption, corrupted download, or misconfiguration.
- Ensure your connection is fast and stable.
- Reload the VM using vagrant reload.
- If the VM still does not provision correctly, vagrant destroy it and try again.
- If you used vagrant box to import the VM (as instructed on http://vagrantbox.es), you need to delete the base VM from your system using vagrant box remove.
- Don’t be afraid to start over. Sometimes it’s faster to build a new VM than troubleshooting what went wrong.
This was a short post, but we’ve covered so much throughout this series! I hope that you’ll find using Vagrant and VMs can be a huge boost to your development workflow, especially when switching clients