4

Everything I've read so far makes port forwarding sound like a snap but I must be missing some magic piece. Here's what I'm doing:

  1. Host OS = Mac OS X
  2. Guest OS = Ubuntu 16.04 Server
  3. Run gunicorn web server on port 8000 on Guest OS
  4. Forward port 8000 on Host (OS X) to 8000 on Guest (Ubuntu)

This is a fresh VM with no services configured and I've verified ufw is disabled. I can view 127.0.0.1:8000 within the guest OS but not from the host OS.

I am assuming my VirtualBox installation is simply missing a key step rather than the settings which look quite straightforward. Can anyone guide me the in the correct direction?

Port Forwarding 8000 from Mac OS X host to Ubuntu 16.04 guest

1 Answer 1

3

It looks like the application you are running is binding to 127.0.0.1, which means it will only accept connections from the localhost. Port forwarding is considered a remote connection. You will need to figure out how to configure your application to accept remote connections or bind to either your VM's IP address or 0.0.0.0.

1
  • Thanks, I used -b 0.0.0.0 on Gunicorn and now it works. This is not how I understood VirtualBox's NAT to work but at least it's working now Commented Oct 3, 2017 at 17:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .