This may be because Vagrant NAT (VirtualBox) NAT redirection does not work properly (port conflicts).
To narrow down the problem, you can make sure port 5000 is open at both ends, this can be done using nmap, nc (netcat) or netstat, etc.
eg. on the host
nmap 127.0.0.1 nc -vz 127.0.0.1 5000 curl http://127.0.0.1:5000
Away
nmap GUEST_IP nc -vz GUEST_IP 5000 curl http:
NOTE. GUEST_IP is most likely located on a 10.0.2.0/24 network (the NAT NAT module is used by default).
Executing these commands both on your host and inside the virtual machine (guest box) will tell you if the ports are open.
Make sure your python hello world is not ONLY bound to the loopback device so that it can handle requests from external clients.
Use lsof -i :5000 or netstat -nap | grep :5000 netstat -nap | grep :5000 to determine which program is binding the port for further troubleshooting.
source share