Can't create new vagrant box from existing created one -
i have problem while creating new vagrant box existing created one. means trying create new box base box hashicorp/precise64
, created e.g. name : first_box.box
. but, while trying create anothe new box using first_box.box
base box
, it's not created, looks created hashicorp/precise64
not first_box.box
, details please see commands below:
first step, vagrantfile this:
vagrant.configure("2") |config| config.vm.define "first" |first| first.vm.box = "hashicorp/precise64" first.vm.network "private_network", ip: "192.168.31.10" first.vm.hostname = "firstserver" first.vm.synced_folder "/home/eman/dev", "/home/vagrant/dev" end end
and run commands:
vagrant box add hashicorp/precise64
vagrant up
vagrant ssh
sudo apt-get update
sudo apt-get install bla-bla-bla
exit
vagrant package --output first_box.box
now have first_box.box
inside vagrant directory.
and continue second step, creating new vm using first_box.box
base box
, can see vagrantfile first:
vagrant.configure("2") |config| config.vm.define "second" |second| second.vm.box = "first_box" second.vm.network "private_network", ip: "192.168.33.10" second.vm.hostname = "secondserver" second.vm.synced_folder "/home/eman/dev", "/home/vagrant/dev" end end
and run commands again:
vagrant box add first_box first_box.box
vagrant up
vagrant ssh
sudo apt-get update
sudo apt-get install another-bla-bla-bla
exit
vagrant package --output second_box.box
the problem is, second_box.box
become more little first_box.box
. first_box.box
(650mb), second_box.box
(647mb). supposedly has bigger 650mb because install application in first , second step.
this vagrantfile in third step:
vagrant.configure("2") |config| config.vm.define "third" |third| third.vm.box = "second" third.vm.network "private_network", ip: "192.168.35.10" third.vm.hostname = "thirdserver" third.vm.synced_folder "/home/eman/dev", "/home/vagrant/dev" end end
and run commands:
vagrant box add second_box second_box.box
vagrant up
vagrant ssh
the virtual machine becomes empty, can't find installed first , second step.
anyone know answer?
Comments
Post a Comment