Skip to content

Instantly share code, notes, and snippets.

@a-zen
Created November 10, 2015 08:05
Show Gist options
  • Save a-zen/509312831f119a160bc0 to your computer and use it in GitHub Desktop.
Save a-zen/509312831f119a160bc0 to your computer and use it in GitHub Desktop.
Vagrantfile with troubling forwarded ports
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
if Vagrant.has_plugin?("berkshelf")
config.berkshelf.enabled=false
end
config.vm.define "elastic-test" do |cfg|
config.vm.box = "boxcutter/ubuntu1404"
cfg.vm.hostname="elastic-test"
cfg.vm.box_check_update = true
# Port forward SSH
cfg.vm.network "forwarded_port", guest: 22, host: 2223, id: "ssh", auto_correct:true
cfg.vm.network "forwarded_port", guest: 9200, host: 9200, id: "elastic", auto_correct:true
cfg.vm.network "forwarded_port", guest: 80, host: 8080, id: "elastic", auto_correct:true
cfg.vm.provider :virtualbox do |vbox, override|
vbox.customize ["modifyvm", :id,
"--name", "elastic-test",
"--memory", 4096,
"--cpus", 2
]
end
cfg.vm.provider :vmware_workstation do |v, override|
v.gui = true
v.vmx["memsize"] = "4096"
v.vmx["numvcpus"] = "1"
v.vmx["cpuid.coresPerSocket"] = "2"
v.vmx["ethernet0.virtualDev"] = "vmxnet3"
v.vmx["RemoteDisplay.vnc.enabled"] = "false"
v.vmx["RemoteDisplay.vnc.port"] = "5900"
v.vmx["scsi0.virtualDev"] = "lsilogic"
end
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root",owner: "vagrant",group: "vagrant",mount_o ptions: ["dmode=775,fmode=664"]
cfg.vm.provision "shell", privileged: false, path: "scripts/update-vm.sh"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment