Can packer build vagrant box from another box?

357 views
Skip to first unread message

小川修

unread,
Jun 16, 2015, 1:09:43 AM6/16/15
to packe...@googlegroups.com
Hi.

I want to build vagrant box by packer.
But I wanna to start from another box instead of ISO image.
Can packer builds vagrant box from another box?

Thank you!

Alvaro Miranda Aguilera

unread,
Jun 16, 2015, 3:15:52 AM6/16/15
to packe...@googlegroups.com
Hello,

vmware-vmx and virtualbox-iso allow you start from other box

aws, digitalocean and other in the cloud, start from a base
box/ami/droplet, so here is also yes.

What provider are you going to use? do you have the base box?

Alvaro.
> --
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

小川修

unread,
Jun 16, 2015, 6:10:33 AM6/16/15
to packe...@googlegroups.com
Thank you very much !! @Alvaro.

Now, I am using chef/bento and runnning provision at Vagrantfile.

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "base" do |config|
config.vm.box = "opscode_centos-7.0"
config.vm.box_url =
"http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box"
config.vm.provision "shell", inline: $provision_ansible +
"ansible-playbook -i /etc/ansible/hosts -l host.example.com
/vagrant/playbook.yml"
end
end

Then,I want to do same thing with Packer.

Maybe, virtualbox-iso is answer?

Could you tell me more information?

Regards
> You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/RYoEvpi1oeU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Jun 16, 2015, 1:10:03 PM6/16/15
to packe...@googlegroups.com
in that particular case, you can use virtualbox-iso provider with packer

chef have all the boxes available on github

clone this repo

https://github.com/chef/

and check this file:
https://github.com/chef/bento/blob/master/centos-7.1-x86_64.json

I suggest you do the tutorial first:
https://atlas.hashicorp.com/tutorial/packer-vagrant/0

and then you will see first hand packer working, and you can move to
your very first own box.

Alvaro.

小川修

unread,
Jun 29, 2015, 5:44:14 AM6/29/15
to packe...@googlegroups.com
Hi.

I found same question.
http://stackoverflow.com/questions/29159874/how-to-use-packer-with-box-file

And

There is no virtualbox-box builder at
https://www.packer.io/docs/builders/virtualbox.html.

By default, I can not create virtualbox box from other box.

If something is wrong, please tell me.

Thank you.

Ethan S.

unread,
Jun 29, 2015, 2:19:29 PM6/29/15
to packe...@googlegroups.com
You can extract an existing box using 7zip or tar. A box according to the spec is simply a tar file containing the VM (provider specific) and a Vagrantfile as well as a metadata.json if it was versioned.

Alvaro Miranda Aguilera

unread,
Jun 30, 2015, 4:54:02 AM6/30/15
to packe...@googlegroups.com
Hello,

virtualbox-iso is to start with iso
virtualbox-ovf is to start with other vm from ovf

like this:
https://github.com/kikitux/packer-vagrant-oracle/blob/master/packer-make/oracle6-2pass/oracle6-preinstall.json
> --
> This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAOE%2BHWriQVLeRvaKafxk7cdhA07QEu0edGdmhQEz9R0Cy_GMcQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages