I have the following Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.network "forwarded_port", guest: 4200, host: 4200
end
That is, super simple Ubuntu 18.04 and I will be running a web service on it that uses port 4200. I want to be able to go to
http://localhost:4200 on a browser on my host machine and hit this service running inside the Vagrant box.
So I run
vagrant up && vagrant ssh and I start the service, and I absolutely see it running. I can
curl http://127.0.0.1:4200 and get HTML output back in the response right there inside the VM.
But, back on my host, if I point my browser to
http://localhost:4200 I get a "
The site can't be reached" error. Is there anything in my Vagrantfile that would prevent port 4200 on the vagrant machine from forwarding to port 4200 on my host?
Thanks!