This blog post will explain how to forward ports with VirtualBox. In order to setup a port forwarding rule, open VirtualBox and select what virtual machine that will have a rule assigned to it. Click settings and then click network. Click the adapter 1 tab and verify its connected to a NAT firewall. Click the advanced drop down menu and click port forwarding. A port forwarding rule will create a pathway from a port on a host machine to a port on the virtual machine. For this example, a port forwarding rule allowing access on an HTTP port will be defined. The example below will accomplish this task.
Name: HTTP
Protocol: TCP
Host IP: 127.0.0.1
Host Port: 8080
Guest IP: 10.0.2.15
Guest Port: 80
After the rule is created, boot up the virtual machine and use a web browser to access the virtual machine from a host computer. The example below will accomplish this task.
http://localhost:8080
