Forwarding Ports to a Virtual Machine

print

Forwarding Ports to a Virtual Machine

If you prefer to use NAT network mode for some reason, you can also forward ports through the virtual machine’s NAT. Note that only one of these steps is necessary – you don’t have to forward ports if you enabled bridged networking above.

At one point, you had to use the VBoxManage command to forward ports in VirtualBox, but VirtualBox now contains a simple graphical port-forwarding window. If you need to set up port forwarding with the VBoxManage command instead of using the graphical interface, you’ll find instructions for doing so in VirtualBox’s manual.

To forward ports in VirtualBox, first open a virtual machine’s settings window by selecting the Settings option in the menu.

image

Select the Network pane in the virtual machine’s configuration window, expand the Advanced section, and click the Port Forwarding button. Note that this button is only active if you’re using a NAT network type – you only need to forward ports if you’re using a NAT.

image

Use VirtualBox’s Port Forwarding Rules window to forward ports. You don’t have to specify any IP addresses – those two fields are optional.

image

If you’re using VMware, you’ll need to use the Virtual Network Editor (vmnetcfg) application to do this. VMware Workstation users can select Edit –> Virtual Network Editor to open it.

Unfortunately, this utility is not included with VMware Player. There are methods for installing it yourself by extracting the vmnetcfg.exe file from the VMware Player installer, but I couldn’t locate the vmnetcfg.exe utility in the latest version of VMware Player, VMware Player 5.0 – it may no longer be included in the installer. If you’re using VMware Player, you can still use bridged networking mode to make your server accessible.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.