nama depan
nama depan

Reputation: 19

Box vagrant does not change after box update

I have vagrant box, and I make a change to upgrade box.

I ran "vagrant package --output new.box" to save the box and I upload to the server so my friend can download it. He downloaded it but when he ran "vagrant box update", the box did not change. Do I have to destroy the vagrant box first if I want to apply the change? Thank you

Upvotes: 1

Views: 1126

Answers (3)

ddelrio1986
ddelrio1986

Reputation: 289

From the vagrant box update command's documentation.

Note that updating the box will not update an already-running Vagrant machine. To reflect the changes in the box, you will have to destroy and bring back up the Vagrant machine.

This means that you will need to vagrant destroy and then vagrant up to get the new version to be used.

Upvotes: 2

Frederic Henri
Frederic Henri

Reputation: 53713

By default vagrant box version will work specially from boxes that are uploaded on Altas (which is hashicorp product) as atlas creates a default metadata file when you push boxes there.

You can certainly create the box metadata file yourself

It is a JSON document, structured in the following way:

{   "name": "hashicorp/precise64",   "description": "This box contains Ubuntu 12.04 LTS 64-bit.",   "versions": [
    {
      "version": "0.1.0",
      "providers": [
        {
          "name": "virtualbox",
          "url": "http://somewhere.com/precise64_010_virtualbox.box",
          "checksum_type": "sha1",
          "checksum": "foo"
        }
      ]
    }   ] }

As you can see, the JSON document can describe multiple versions of a box, multiple providers, and can add/remove providers in different versions.

If you did not create this metadata file before, your friend will need to create it in their existing box so vagrant can make the match when you will run the update command.

Upvotes: 0

kevin seda
kevin seda

Reputation: 406

You have to remove everything entirely, after this you reinstall it and it should update.

Upvotes: 1

Related Questions