Creating virtual machines with Vagrant

Redactado por: Felipe Juarez

It’s been awhile since I wrote a post, but in compensation I would make a series of post talking about deploying applications with edeliver. But for this, we need to prepare the path. So, in this first post I will talk about Vagrant and how to use to setup an environment.

First of all, we’re going to install Vagrant and Virtual Box. We’ll download Vagrant from this link and follow the instructions(i.e. next, next, next, agree, install) When that is complete, we can verify the correct installation using the command vagrant -v

❯ vagrant -v
Vagrant 1.9.3

We can download Virtual Box from this link. This step is required because Vagrant use images for running in a virtual machine. You can configure Vagrant to be used with other providers, but that is out of this scope.

After that is finished, we can start with our first command which is vagrant init. Once that you run the command you will see a message like this

❯ vagrant init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com`for more information on using Vagrant.

And a file called Vagrant is created with the following content (without comments)

Vagrant.configure("2")do |config|
config.vm.box ="base"
end

Change the config.vm.box = "base" for config.vm.box = "ubuntu/trusty64" and then run vagrant up you will see something like this: