0

Alternate VirtualBox Port Forwarding Method

Posted December 8th, 2009. Filed under Code

In my Review Board installation on Virtual Box I gave an example of how you could access your guest OS from the host system using port forwarding. In that example you could access an application (Review Board) running on Apache.

In those instructions you had to enter a series of commands in at the command line. I’ve since discovered an easier way to do this.

Virtual Box provides you with a configuration file which you can modify…

On Windows XP this file is located in your home directory and is hidden:

C:\Documents and Settings\priestj\.VirtualBox\VirtualBox

Make sure Virtual Box is shut down and open that file with a text editor.

It’s an XML file and near the top you should see a ExtraData tag. For my Review Board example you would simply add the following lines (adjust your port numbers accordingly):

<extradataitem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" value="80"/>
<extradataitem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" value="80"/>
<extradataitem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" value="TCP"/>

This also assumes you are using the PCnet network adaptor in Virtual Box. If not – adjust the ‘/pcnet/’ above.

Save the file and restart Review Board and you should be set!

Possibly Related:

If you have enjoyed this entry. Please feel free to bookmark it using your favorite social bookmarking site

Leave a Comment