Accessing Ubuntu guest (VirtualBox) node.js server from Windows host

3

1

I'm attempting to set up a node.js server on my Ubuntu guest OS running on VirtualBox.

A simple "Hello World" HTTP server runs fine if I try accessing it from a browser on the Ubuntu image, but I'm struggling with opening the page on a browser in the host OS, which is Windows 7.

I'm using the "Bridged Adapter" setting in VirtualBox and am getting a 192... local IP address for the guest machine.

The server listens on port 8124, so I forwarded that port (TCP and UDP) in my router settings.

When I try opening [Ubuntu IP Address]:8124 in my browser, I get a 'could not connect' message. As I mentioned before, "localhost:8124" on an Ubuntu browser shows me the "Hello World" page I want.

Any help on this issue would be much appreciated.

funseiki

Posted 2012-07-14T20:31:54.290

Reputation: 297

Answers

1

You have to open the Port on your guest system too. I had a similar error in my system and also set the firewall rules after it was suddenly

Board

Posted 2012-07-14T20:31:54.290

Reputation: 30

How do I open a port on my guest system? – Vince – 2018-07-21T08:30:30.283

I did a "ufw enable," then ufw allow 8124. Doesn't look like that did it either :/ – funseiki – 2012-07-14T20:55:58.893

Actually, it looks like I got it. I was specifying '127.0.0.1' as the address - I left it blank and it looks like it works. – funseiki – 2012-07-14T21:05:16.433

6

It may be too late but I figured out a way to achieve it in very simple steps.

  • In Network settings of Guest OS, use Bridged Adapter.
  • Run Node.js server with IP 0.0.0.0 instead of 127.0.0.1 .

Above settings works and I can access the server from other machine in same networks as well.

kushdilip

Posted 2012-07-14T20:31:54.290

Reputation: 181