diff --git a/Vagrantfile b/Vagrantfile index a9fc26791c..e180932aca 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -27,6 +27,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # The Zulip development environment runs on 9991 on the guest. host_port = 9991 http_proxy = https_proxy = no_proxy = "" + host_ip_addr = "127.0.0.1" config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/srv/zulip" @@ -42,11 +43,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| when "HTTPS_PROXY"; https_proxy = value when "NO_PROXY"; no_proxy = value when "HOST_PORT"; host_port = value.to_i + when "HOST_IP_ADDR"; host_ip_addr = value end end end - config.vm.network "forwarded_port", guest: 9991, host: host_port, host_ip: "127.0.0.1" + config.vm.network "forwarded_port", guest: 9991, host: host_port, host_ip: host_ip_addr if Vagrant.has_plugin?("vagrant-proxyconf") if http_proxy != "" diff --git a/docs/brief-install-vagrant-dev.md b/docs/brief-install-vagrant-dev.md index fc7ab0f3e8..494aff7fcc 100644 --- a/docs/brief-install-vagrant-dev.md +++ b/docs/brief-install-vagrant-dev.md @@ -105,3 +105,16 @@ HOST_PORT 9971 (and halt and restart the Vagrant guest), then you would visit http://localhost:9971/ to connect to your development server. + + +If you'd like to be able to connect to your development environment from other +machines than the VM host, you can manually set the host IP address in the +'~/.zulip-vagrant-config' file as well. For example, if you set: + +``` +HOST_IP_ADDR 0.0.0.0 +``` + +(and restart the Vagrant guest), your host IP would be 0.0.0.0, a special value +for the IP address that means any IP address can connect to your development server. + diff --git a/docs/dev-env-first-time-contributors.md b/docs/dev-env-first-time-contributors.md index 5453e7277b..094fbe0493 100644 --- a/docs/dev-env-first-time-contributors.md +++ b/docs/dev-env-first-time-contributors.md @@ -864,6 +864,18 @@ HOST_PORT 9971 (and halt and restart the Vagrant guest), then you would visit http://localhost:9971/ to connect to your development server. +If you'd like to be able to connect to your development environment from other +machines than the VM host, you can manually set the host IP address in the +'~/.zulip-vagrant-config' file as well. For example, if you set: + +``` +HOST_IP_ADDR 0.0.0.0 +``` + +(and restart the Vagrant guest), your host IP would be 0.0.0.0, a special value +for the IP address that means any IP address can connect to your development server. + + [cygwin-dl]: http://cygwin.com/ [vagrant-dl]: https://www.vagrantup.com/downloads.html [vagrant-dl-win]: https://releases.hashicorp.com/vagrant/1.8.6/vagrant_1.8.6.msi