Reputation: 491
This may be a noob question, but after making some changes to an image with vagrant up
and then installing something, I then call vagrant package --box [name] --output [new.box]
.
After I create a new vagrant init from new.box
, it doesn't have the new things I installed on the box that I packaged.
Anyone know what I am doing wrong?
Upvotes: 0
Views: 774
Reputation: 16126
The reason could be that you used the same box name.
As you described, you've done something like this:
Created a Vagrantfile
:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'base'
config.vm.box_url = 'http://the-url-of-box-you-used-as-base.com/precise.box'
end
vagrant up
vagrant ssh
=> there you've made some changesvagrant package --box [name] --output [new.box]
Edit the original Vagrant
file (or create a new one) to load your new box:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'base'
config.vm.box_url = 'my-new.box'
end
And here I'm assuming you kept the config.vm.box
the same, which means Vagrant didn't use your box, but the original previous box as there's already downloaded box with that name in your ~/.vagrant.d/boxes
.
There might be two solutions:
Vagrantfile
(if you have actually used different name when generating custom box)~/.vagrant.d/boxes/[name]
Upvotes: 1