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

6,826

Solution 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

Solution 2

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.

Share:
6,826

Related videos on Youtube

funseiki
Author by

funseiki

Python wrestler, by day. High-fiber eating, app-developing, video game playing being, by night.

Updated on September 18, 2022

Comments

  • funseiki
    funseiki over 1 year

    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
    funseiki almost 12 years
    I did a "ufw enable," then ufw allow 8124. Doesn't look like that did it either :/
  • funseiki
    funseiki almost 12 years
    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.
  • Vince
    Vince almost 6 years
    How do I open a port on my guest system?