Force Vagrant to Re-download the Box File

Sometimes we want to download the operating system image file again and start from scratch when building a Vagrant VM.

If vagrant up does not load a new box even after a vagrant destroy of the existing VM, do the following.

Ensure the box_url variable in the Vagrantfile is set to the correct URL of the new box (config.vm.box_url).

View existing boxes to get the existing box name:

$ vagrant box list

Output:

myBox (virtualbox, 0)

Fully remove the box file:

$ vagrant box remove myBox

Now the box file listed in the Vagrantfile will be downloaded again when running vagrant up.

 

Leave a Reply

Your email address will not be published. Required fields are marked *