Line 3 sets a static IP for the virtual machine. This line is optional but one I always take since I use Vagrant to set up servers.

Live 4 sets the machine’s hostname.

Line 5 ends our configuration block.

Save the file and close your editor. This is all we’re doing with the Vagrantfile today but if you’re interested in learning more check out the documentation on Vagrant’s website.

Step 2: Starting the Vagrant Box

Open a terminal or command-line window and navigate to your project directory.

Type and enter the command vagrant up.

At this point Vagrant will download the base box then setup and boot the virtual machine. If it finishes successfully you’ll see a line that says, “Process finished with exit code 0.” Your machine is now ready to use.

Step 3: SSH into the Vagrant Box

Using SSH to connect to your new virtual machine is just as easy as starting it. In your command-line type vagrant sshand wait until it logs you in. From here you’re in a full have access to the shell of your virtual machine. When you’re ready to log out just type exit.

If you’re on a Windows machine you might get a message that you do not have a SSH client installed. You will need to find and install a client.

Step 4: Stopping and Deleting the Vagrant Box

To shutdown the virtual machine just use the command vagrant halt in the Vagrantfile’s directory using the command-line.

If you want want to completely delete the machine, say if you’re finished with the project and want to recover hard driver space use the vagrant destroy command.

That is it for this article. In Part 3 we’ll start using Puppet to further configure the VM.