vagrant Getting started with vagrant Easiest way to have a virtual linux in just a few minutes (in 3 steps)


Step 1.

In your host machine (Windows/Linux/OSX), create an empty dir my_project.

Step 2.

Create a file named Vagrantfile with this:

Vagrant.configure("2") do |config| = "gbarbieru/xenial" #An Ubuntu 16.04 based image
  config.vm.hostname = "my_project" :private_network, ip: ""

Step 3.

Run your machine:

host$ vagrant up
host$ vagrant ssh
virtual$ cd /vagrant



  • Maybe you want to assign another IP address.
  • If your host is Windows, maybe you want to ssh from putty. You can do so by ssh-ing to hostname and port 2222. Username is vagrant and password is vagrant.