Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My working minimalist Vagrantfile with everything I have used so far in my use of Vagrant
VAGRANTFILE_CLIENT_NAME = "example"
Vagrant.configure(2) do |config|
config.vm.define VAGRANTFILE_CLIENT_NAME do |localdevbox|
localdevbox.vm.box = "localdev"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
localdevbox.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# localdevbox.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# localdevbox.vm.network "public_network"
localdevbox.vm.synced_folder ".", "/var/www", :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=775', 'fmode=775']
end
config.vm.provider "virtualbox" do |vb|
vb.name = VAGRANTFILE_CLIENT_NAME
# Tell vagrant to use the host computer as resolver
# vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Display the VirtualBox GUI when booting the machine
# vb.gui = true
# Customize the amount of memory on the VM:
# vb.memory = "1024"
end
#config.vm.provision "shell", inline: "sudo apt-get update && sudo apt-get upgrade -y"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.