

bootstrap.sh is the conventional name used in most cases. We use vm.provision to specify the name of the file that is going to be executed at the machine creation, to provision the machine. The schema for box names is simple: the maintainer account in Vagrant Cloud followed by the box name. It is Ubuntu BionicBeaver (18.04 LTS), 64-bit version, provided by HashiCorp. Vm.box is the base box that we are going to use. We are going to use version 2 of Vagrant API. In the block, we'll use the config alias to refer this object.

nfigure("2") returns the Vagrant configuration object for the new box. Here is a simple Vagrantfile example: nfigure("2") do |config|Ĭonfig.vm.provision :shell, path: "bootstrap.sh" However, while a box is easy to distribute to a team or to a wider public, a Vagrantfile can also directly create one or more Vagrant machines, without generating any box. From a box, we can create new Vagrant machines. You can see a box as a compiled Vagrantfile. Sharing Files Between the Host and a Guest SystemĪ Vagrantfile is a Ruby file that instructs Vagrant to create, depending on how it is executed, new Vagrant machines or boxes.
