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

Fill out the form to learn how FFW can support your needs.

Read next:

Blog
Image of plane flying above cloud with pink sky

Open source software can provide many benefits to Chief Information Officers or other technical roles. Here's why.

Blog
Man standing on edge of cliff with clouds

Usher customers through the sales funnel with messages that are consistent, tailored, and effective.

Blog
Image of sailboat with land behind it and cloudy sky

Acquia Drupal Cloud is a content platform built to help users rapidly create content at scale.

Blog
Image of Drupal 8 icon with arrow to Drupal 9 icon on blue background

Test your Drupal 9 upgrade now