Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant port forwarding not working on Mavericks

Tags:

macos

vagrant

I'm using a vagrant Geodjango box and port forwarding is not working for me.

On the box, I have run:

python manage.py runserver 0.0.0.0:8000

But http://localhost:8000 and http://localhost:4567 both find nothing on the host machine.

On the Vagrant box, curl -v 'http://localhost:8000/' gives the usual:

<h2>Congratulations on your first Django-powered page.</h2>

which suggests that Django is running okay. But on the host machine, trying curl -v 'http://localhost:8000/' gives the following output:

curl: (7) Failed connect to localhost:8000; Connection refused

My Vagrantfile has the following port forwarding set up:

config.vm.forward_port 8000, 4567

Disabling the Mac's firewall does not help and stopping Apache makes no difference. I have tried running lsof -i :8000 on the host machine and there is no output, so I figure nothing is using the port.

Can anyone suggest anything?

like image 848
Richard Avatar asked Nov 26 '13 13:11

Richard


1 Answers

I had the same issue on Yosemite and none of the ports were forwarding. Disabling the Firewall filter on the guest machine helped:

sudo service iptables stop
like image 94
user2333522 Avatar answered Nov 09 '22 19:11

user2333522