Port forwarding in Parallels Desktop

30 users found this article helpful

Shared network

Normally, virtual machines set to operate in the Shared network cannot be accessed from external computers.

The port forwarding functionality allows computers on your local network and on the Internet to connect to any of your virtual machines that use the shared networking mode.

The connection to a specific port on your Mac will be redirected to a specific port of your virtual machine according to the port-forwarding rule.

Enabling port forwarding

Note: This feature is available in Parallels Desktop for Mac Pro and Business Edition only

  1. Open Parallels Desktop Network preferences by clicking Parallels Desktop icon > Preferences, then click Network.
  2. Click the Add (+) button below the Port forwarding rules list.

  3. In the displayed window, perform the following:

      4. Click OK to add the rule.

Checking port forwarding

To check that the rule works properly, enable e.g. SSH on your virtual machine (some Linux distributions have it enabled by default).

As an example for SSH, use the following rule:

Protocol TCP
Source Port any
Forward to choose your Linux virtual machine
Destination Port 22

To make sure that port forwarding is enabled from your Mac inside a virtual machine, use one of the following scenarios:

Scenario 1: connect from the same Mac

In Terminal, type in the following command and press Enter:

ssh -l <your_VM_username> -p <source_port> 127.0.0.1

Enter the password for the user in the virtual machine and press Enter.

Scenario 2: connect from another Mac or PC in the same network

In Terminal (on Mac) or PowerShell (on Windows) type in the following command and press Enter:

ssh -l <your_VM_username> -p <source_port> <Mac_host_IP_address>

Enter the password for the user in the virtual machine and press Enter.

Note: Mac host IP address is the address of the Mac machine on which the target virtual machine is running.

To check that you're logged into the virtual machine, execute the following command in Terminal:

uname -a

If you are successfully logged into the virtual machine, you will see a version of Linux kernel.

In case you are on macOS, you will see a version of Darwin kernel.

Was this article helpful?

Tell us how we can improve it.