How should I do to create a box?

18 views
Skip to first unread message

Edgar Oliveira

unread,
May 10, 2016, 5:45:26 PM5/10/16
to Vagrant
Hello everyone,

I installed the Ubuntu server on virtual machine and add a couple service! How can I create a box to use with vagrant from this virtual machine?

To create a VM I used virtual box!

Thanks

Alvaro Miranda Aguilera

unread,
May 10, 2016, 5:49:58 PM5/10/16
to vagra...@googlegroups.com
Hello Edgard,

Basically are 2 ways, one is manual, other is autoamated.

For the manual one, install OS is fine, plus have a read here:
https://www.vagrantup.com/docs/boxes/base.html

Depending on the version, you need to delete /etc/udev/rules.d/70-persistent-net.rule if present (or similar name)

Then:

- add vagrant user
- allow vagrant user sudo without password
- set vagrant ssh known public key

You can use an script like this:
https://github.com/cbednarski/packer-ubuntu/blob/master/scripts/vagrant.sh


Other option is use a tool to create a box for you. ie packer.io

A repo that will create a vagrant box can be found here:

16.04
14.04
https://github.com/cbednarski/packer-ubuntu

12.04
https://github.com/hashicorp/atlas-packer-vagrant-tutorial

Alvaro.



--
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/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/ac750cd7-a35f-416a-9db6-b0e3ffbda70c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages