Vagrant, VirtualBox, Ubuntu 16.04 Setup

Setup Vagrant

replace project with any name you wish.

$ mkdir project

$ cd project

$ vagrant init ubuntu/xenial64

In text editor – Vagrantfile located within the ‘project' folder, change “forwarded_port”, guest: 80, host: 8080 to:

Change "forwarded_port", guest: 80, host: 80


Change "forwarded_port", guest: 80, host: 8080

Also by using synced folders, Vagrant will automatically sync your files to and from the guest machine. Uncomment and change the line in Vagrantfile from:

# config.vm.synced_folder "../data", "/vagrant_data"


config.vm.synced_folder "html", "/var/www/html"

where “sites” can be any name you choose inside your ‘project' folder. Now whatever folders/files you place inside “sites” will be processed by Ubuntu/Vagrant local server.

note: can also open a notepad from the command line and edit like this:

start notepad Vagrantfile


$ vagrant up

You can continue using Git and ssh into ubuntu:

$ vagrant ssh
$ sudo apt-get update
$ sudo atp-get upgrade

or open putty and ssh into vagrant using as the Host Name/IP address, and 2222 as the Port.

login: vagrant
password: vagrant


$ sudo apt-get update
$ sudo atp-get upgrade




Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.