Skip to content

Instantly share code, notes, and snippets.

@lsaffie
Created December 18, 2013 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsaffie/8016013 to your computer and use it in GitHub Desktop.
Save lsaffie/8016013 to your computer and use it in GitHub Desktop.
Vagrantfile with public networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#VM name
config.vm.box = "homestars-devbox-vagrant"
#Public network setting. (Gets the ip from the router and binds it to ethernet en1 on the host computer)
#Since I want to ensure I get the same ip everytime, I have it locked from the router side reserving the ip by MAC
#It's also possible to do this by modifying /etc/networks/interfaces
#If the computer is hardwired, choose the ethernet (exact name displayed. e.g, en0)
config.vm.network :public_network, :bridge => 'en1: Wi-Fi (AirPort)'
#forward ssh keys from host to guest
config.ssh.forward_agent = true
#Increase the memory to 2G and use 2 cores
#Modify as needed.
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2", "--ioapic", "on"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment