Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have nginx running on Ubuntu Server (guest) in VirtualBox on Windows 7 (host)

I need to access the nginx webserver's localhost.

I'm assuming there's no way to do this directly from Ubuntu Server's terminal, because I probably need a browser to do this and there's no browser there.

So, I need to access the nginx webserver's localhost from the host's browser.

How do I configure NAT port-forwarding on VirtualBox to accomplish this?

share|improve this question
FYI, you can install command-line web browsers (I like lynx, sudo apt-get install lynx) to access it from the guest command line – Mitch Jan 21 at 16:17

Check the nginx.conf file and look for the listen address. It might be set to only listen on, check the documentation for available options, but usually changing the listen address (or adding) will make it listen on all interfaces and you'll be able to access the webserver on your guest's ip address at the appropriate port. Don't forget to restart nginx after editing its .conf file to activate changes.

Alternatively you could create a port forwarding over SSH using PuTTY, and you could access your guest's webserver via localhost on your host, but it's the more complicated option here I think.

share|improve this answer
I should add for clarification: I don't use nginx myself, but the configuration is often more or less the same for different webservers. You might also look at the 'sites-enabled' directory under '/etc/nginx/'. – Niek Klein Kromhof Sep 29 '13 at 8:45
Thanks Niek -- regarding SSH over PuTTY, I'm already using it to access the terminal on the guest (so that I can share the clipboard between Windows and Ubuntu-Server), but are you saying there's a way to use SSH over PuTTY to access the nginx webserver as well ? – user1883050 Sep 29 '13 at 9:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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