I need advice on how to forward to port 80 and how to make my VirtualBox service accessible to outside world. I can access the web server with my host computer and with putty.

I'm following a tutorial on Ars Techica.

I think it's relevant that I'm using nginx instead of apache (as suggested in the tutorial).

2 Answers 2


Definitely not related to nginx, which just listens in your guest on port 80, just like any Web server would do.

You should look at the network configuration of you guest, both at the machine configuration level in VirtualBox and at the guest interfaces configuration (/etc/network/interfaces, ifconfig).

The fact that you can reach it from your host means you already have access from outside VirtualBox, so host-guest connection is OK/possible.

How have you configured your guest network in VirtualBox?

1 Your host sits on a network behind a router/NAT

Bridged connection might be the simplest setup, plugging your guest directly on the network of your host through its card, and getting its own IP address. It depends on whether you network controller (switch/hub) accepts it (MAC filtering/white-listing could prevent it). In the latter, you should configure it with NAT (see below).

What you would need then is making your host available to the outside world. You will need to configure the NAT on your network gateway (router).

2. Your host is directly connected to the outside world

You should configure your guest network as NAT in VirtualBox and make a port redirection in VirtualBox to make it listen to TCP port 80 and forward it to this guest. That is because you probably have a single IP address on your 'outside world' network, so the bridged connection will fail.

In both cases you will need to open incoming TCP 80 in your host firewall (already OK unless you changed it on Linux) and, obviously, not having anything listening on that port to allow VirtualBox to do it.


Forwarding ports below 1024 is blocked by the kernel for non-root users. Therefore, forward attempts to access port 80 of guest to a higher port (e.g. 8080). From VirtualBox:

Settings (secondary click on server icon) → Network → Adapter 1 (Attached to: NAT) → Advanced → Port Forwarding

Name | Protocol | Host Port | Guest Port
HTTP | TCP      | 8080      | 80

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.