Super User is a question and answer site for computer enthusiasts and power users. 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

How can I forward port from Guest (OS on virtual box) to Host (my actual machine)?

Guest - Windows 7
Host  - Ubuntu 12.10

On my host, I run a web-server on port 3000.

I want to be able to open a browser from Guest on url

and see my web app which I run on Host. (the reason is I need IE browser to test some stuff).

In Virtual Box settings, I selected NAT and in Port Forwarding I wrote

Host IP:     Port: 3000 
Guest IP:  Port: 3000

where is IP of my Guest machine which I obtained from ipconfig.

I thought this should work but now, once I try to run a web-server and Guest is running, I get an error that the port is already in use.

Actual error

/home/username/.rbenv/versions/2.0.0-rc2/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)

Web-server is Webrick (default Rails and Ruby web-server in development mode).

I tried different combination of host/guest IP's and ports but none of them seems to be working.

share|improve this question
up vote 2 down vote accepted

The easiest way for me seems to be to use the host's IP address instead of You can obtain this from ipconfig by looking at the default gateway.

If you really want to to do port forwarding, I suggest you take a look at I am not even sure that this works on the loopback interface.

share|improve this answer

You must log in to answer this question.

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