hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.

Home Page:https://www.vagrantup.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot change the box_url after the initial vagrant up

tallen1983 opened this issue · comments

Vagrant version

2.0.3

Host operating system

Windows

Guest operating system

Irrelevant

Vagrantfile

    config.vm.box_url = "file://some/path/to/mybox.json"

Expected behavior

If I change the box_url later, it should begin checking the new location, not the old location the next time I vagrant up when it checks for an outdated box.

Actual behavior

No matter what you change the box_url to in Vagrantfile, it always uses the url it used to initially provision the box.

Steps to reproduce

  1. Provision a box
  2. Change where the json file exists in Vagrantfile
  3. Run vagrant box outdated --debug and see that it still uses the old URL (also happens with vagrant up)

Details

The metadata_url file in ~/.vagrant.d/boxes/< some string >/ contains the original URL used to provision the box, and is never updated based on the new contents of an updated Vagrantfile.

Hi there,

This is the expected behavior. You can update the box URL by destroying and creating the guest again.

Cheers!

Hi there,

just for documentary reasons. I just had this issue with custom box urls, as well. I had to change the domain of the page hosting my own boxes.

The solution was not just to destroy the current Vagrant box but to remove all old box versions from the local Vagrant installation, too. After doing this Vagrant used the new box_url value of the VagrantFile.

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.