In host machine, cannot connect webserver, vagrant

336 Views Asked by At

I am running ubuntu 14.10 through vagrant

host machine is windows 8.1

In host machine (windows 8.1),

  1. I can send ICMP message to guest:ubuntu
  2. I can connect ssh to guest:ubuntu, for portforwarding - In windows, localhost:2222
  3. But only cannot connect to webserver of ubuntu, localhost:3000 or 4000 or anyport just showed ERR_CONNECTION_REFUSED

of course, portforwarding is done

actually, In ubuntu, I can connect webserver for

lynx localhost:3000

but in windows, I can't connect only webserver. ssh, icmp are works. Really, I can't understand why it doesn't work. sombody help me

1

There are 1 best solutions below

0
On BEST ANSWER

solution is running with code below when start server.

rails s -b 0.0.0.0

I found this soulution from other post about same problem The answerer said 'You'll want to make sure that the server is bound to 0.0.0.0 so that all interfaces can access it."

I hope this post help people who meet with the same problem :)