Port forwarding in Parallels Desktop

27 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 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 password for the user in 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> <virtual_machine_IP_address>

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

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

uname -a

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

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

You have already left your feedback.