CHAPTER 7

image

Creating Boxes from Scratch

By now, it should be completely clear to you that Vagrant boxes are preinstalled OSs stored in files with a *.box extension, and you can easily download and start them using Vagrant. To perform automated downloads and booting of VMs, you need to create a Vagrantfile containing a config.vm.box entry like the following and then run the $ vagrant up command:

config.vm.box = "ubuntu/trusty32"config.vm.box = "puppetlabs/centos-6.6-64-puppet"

To download the box manually, you can use curl or wget like this:

$ curl http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box ...

Get Pro Vagrant now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.