Mac – Forward port from guest to host

networkingport-forwardingrubyvirtual machinevirtualbox

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

`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.

Best Answer

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.

Related Question