Tamas Hegedus
Tamas Hegedus

Reputation: 29906

Can't download older vagrant ubuntu/trusty64 boxes

I am about to use vagrant to deploy an application automatically. This application needs to be installed on a specific kernel version, so I selected and try use a specific version of the box in the Atlas. However, it seems no matter which specific version I use, I always get the newest version, which breaks my application. I did a quick test:

wget 'https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20170517.0.1/providers/virtualbox.box' -O v20170517.0.1.box
wget 'https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20170517.0.0/providers/virtualbox.box' -O v20170517.0.0.box
md5sum *.box
date

5a6660d4e37a3af79b70af7f13a69f3b  v20170517.0.0.box
5a6660d4e37a3af79b70af7f13a69f3b  v20170517.0.1.box
Thu Jun  1 14:49:46 CEST 2017

So the downloaded files are indeed identical. I did not find any evidence if this behavior is intentional or not. Is it a bug? Is there a way to pin a box version for real?

UPDATE

Using vagrant box add still downloads the same boxes for every version:

$ vagrant box add ubuntu/trusty64 --box-version 20170517.0.0
$ vagrant box add ubuntu/trusty64 --box-version 20170517.0.1
$ ls ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/
20170517.0.0  20170517.0.1  metadata_url
$ diff -Nqr ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/20170517.0.*
$ echo differences would be listed above if there were any

Upvotes: 0

Views: 732

Answers (2)

Michael
Michael

Reputation: 350

This seems to have been intentional and not a bug. Someone has gone through and updated ALL of the old versions of Ubuntu in the hashicorp repo, making every one of them but the latest useless/redundant.

I suspect this was intentional to keep people from deploying versions with security issues in line with Canonical's update policies, but that's pure speculation based on my own experience with them.

Every one of the focal64 and trust64 images I've tried have been identical to the "latest", regardless of the date they're tagged with. I banged my head against this for some hours before I found your post and checked a bunch of md5sums.

If you're looking for an older version, I recommend you do what I did:

There are a couple tutorials on how to do this spread throughout the internet, but full instructions are out of scope as an answer to your question.

Upvotes: 1

Frederic Henri
Frederic Henri

Reputation: 53713

you can install a specific box version with the following command

$ vagrant box add ubuntu/trusty64 --box-version 20170517.0.1

you can check the vagrant doc for vagrant box add

for example, you have some differences

fhenri@machine:~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64$ diff -Nqr 20170418.0.0 20170307.0.0/
Files 20170418.0.0/virtualbox/Vagrantfile and 20170307.0.0/virtualbox/Vagrantfile differ
Files 20170418.0.0/virtualbox/box-disk1.vmdk and 20170307.0.0/virtualbox/box-disk1.vmdk differ
Files 20170418.0.0/virtualbox/box.ovf and 20170307.0.0/virtualbox/box.ovf differ

Upvotes: 1

Related Questions