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 config.vm.network “forwarded_port”, guest: 80, host: 8080 to:
Change config.vm.network "forwarded_port", guest: 80, host: 80
Change config.vm.network "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 127.0.0.1 as the Host Name/IP address, and 2222 as the Port.
$ sudo apt-get update $ sudo atp-get upgrade