VM - Part Five: Cleanup and Troubleshooting

VM - Part Five: Cleanup and Troubleshooting

FFW Blog - illustration
default avatar
Thought byTess Flynn
January 09, 2015

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:

vagrant halt

To delete the VM permanently:

vagrant destroy

That’s it!

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

Troubleshooting a vagrant VM can be difficult. The most common problems are bad provisions due to interruption, corrupted download, or misconfiguration.

  1. Ensure your connection is fast and stable.
  2. Reload the VM using vagrant reload.
  3. If the VM still does not provision correctly, vagrant destroy it and try again.
  4. 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.
  5. Don’t be afraid to start over. Sometimes it’s faster to build a new VM than troubleshooting what went wrong.

Summary

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

Topics:
drupal
Best Practices
Learning Series
Technology Tools

Read next:

Blog
BADCamp and Texas Camp logos

Ray Saltini and Leigh Anderson to share expertise on project management for Drupal, customer experience and writing case studies. 

Blog
Display of Warner Classics site on ipad and iphone

The website, which was crafted by FFW, features a custom-built streaming player that works with subscription music streaming services including Apple Music, Deezer, and Spotify.

Blog
Image of accessibility icons on a blue screen

This Global Accessibility Awareness Day, learn how accessibility and inclusion can change your organization.

Blog
Teaser image of DrupalCon Seattle

Proud Platinum Sponsor of DrupalCon 2019