Remote desktop cannot connect to the remote computer

In this Azure article, we will discuss how to fix the error “Remote desktop cannot connect to the remote computer” error that I got while connecting to my Azure Virtual Machine.

Remote desktop cannot connect to the remote computer

Recently, While connecting to the Azure virtual machine, I got this error. Below is the complete error message.

Remote desktop cannot connect to the remote computer for one of these reasons:

  • 1-Remote Access to the server is not enabled.
  • 2-The remote computer is turned off.
  • 3-The remote computer is not available on the network.

Make sure the remote computer is turned on and connected to the network, and that remote access is enabled.

You can see the same error in the below screenshot.

remote desktop cannot connect to the remote computer windows 10

“Remote Desktop can’t connect to the remote computer for one of these reasons:”

Problem Cause and solutions

There could be multiple reasons and solutions for this issue. Let’s discuss one by one

Remote desktop cannot connect to the remote computer [Solved]

To fix the issue you need to follow the below steps

Step- 1: 

Login to https://portal.azure.com/

Step- 2: 

Search for Virtual machines there.

Troubleshooting specific RDP error messages to a Windows VM in Azure

Step- 3: 

You will see the list of VM created in your Azure subscription. It will show the VM name, Type, Status, resource group, Location, etc.

Remote desktop cannot connect to the remote computer for one of these reasons:

Step- 4: 

Now click on the VM name. “MyNewVM” in my case. You can able to see the details of your virtual machine like Public IP address, status, Computer name, Operating system, Size, etc.

As you can see the Status of the VM is Stopped(deallocated). The status should be running.

Remote desktop cannot connect to the remote computer for one of these reasons:

Step- 5:

Now click on the Start button.

Remote desktop cannot connect to the remote computer for one of these reasons how to fix

Step- 6:

Now as you can see the VM Status is changed to “Running”.

how to fix Remote desktop cannot connect to the remote computer for one of these reasons

Step- 7:

Now you should able to connect to the virtual machine successfully without any issues. Click on the Connect button.

how to fix Remote desktop cannot connect to the remote computer for one of these reasons

If the above solution didn’t work then you can check out the below solutions

You should Check the network connectivity

One of the most common reasons for the error Remote Desktop can’t connect to the remote computer is the issue with the connectivity of the network. For example, there might be a chance that the firewall is blocking access to the Azure Virtual machine.

You can use the Telnet client to check the connectivity to the Azure Virtual machine. One key advantage of using the Telnet client is, you can easily check the RDP port 3389 is open or not.

You can use the below command from the command prompt to enable the Telnet from the command prompt

dism /online /Enable-Feature /FeatureName:TelnetClient

If are using PowerShell, then you can use the below PowerShell cmdlet to enable the Telnet

Install-WindowsFeature -name Telnet-Client

Check the User Permissions

Cross-check the user permissions that might be the reason for the error Remote Desktop can’t connect to the remote computer. Note that if the user is not having administrator privileges. There is a group called as local Remote Desktop Users group, either the user should belong to that group to access the Remote machine via RDP. Normally, there won’t be any member who belongs to the local Remote Desktop Users group by default unless and until any of the users is getting added manually. So only Administrator’s group members can access the remote machine via RDP.

Enable Remote Desktop Connection

This is one of the common causes that result in you the error Remote Desktop can’t connect to the remote computer. People normally missed enabling the Remote Desktop Connection option. There are multiple ways to enable the Remote Desktop Connection option and those are like using the System Properties, using PowerShell cmdlet, Using Command Prompt, etc

Using System Properties

You can follow the below steps to enable the Remote Desktop Connection option.

  1. On your machine, Select start –> Run –> type sysdm.cpl.
  2. Navigate to the Remote tab.
  3. Select Allow remote connections to this computer and then click on the OK button to save the changes.
Remote computer RDP settings

Using PowerShell cmdlet

To enable Remote Desktop Connection, you can also use the PowerShell cmdlet as below

(Get-WmiObject Win32_TerminalServiceSetting -Computername [ComputerName] ‑Namespace root\cimv2\TerminalServices).SetAllowTsConnections(1,1)

This is how you can use the PowerShell cmdlet to enable the Remote Desktop Connection.

Using the command prompt

If you don’t have PowerShell installed on your machine, you can use the below command on your command prompt to enable the Remote Desktop Connection option.

REG ADD "\\[RemoteComputer] \HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /d 0 /f /t REG_DWORD

Verify If Group Policy is blocking RDP

Another reason could be there is a chance that Group Policy is blocking the RDP. You need to follow the below steps to verify that

  1. Select-> Run and then type gpedit.msc
  2. Click on the Computer Configuration –> Administrative Templates –> Windows Components –> Then select the Remote Desktop Services –> Now select Remote Desktop Session Host and then Connections.
  3. The next step is to find the Allow users to connect remotely by using Remote Desktop Services setting.
  4. Make sure to change the settings to Enabled or Not Configured.

Cross-check the RDP listener port status

You can always cross-check the RDP listener port status on your remote computer. By default, it should listen to port 3389. At the same time make sure that the same port 3389 is not occupied by another application. You can verify that using the below steps

  1. Navigate to Start –> Run and then type regedit
  2. Go to HKEY_LOCAL_MACHINE > SYSTEM –> then select CurrentControlSet –> Control –> Terminal Server –> WinStations –> RDP-Tcp
  3. Review the PortNumber setting

Verify the RDP connection using PowerShell

You can run the Get-RDPStatus.Ps1 script which is available here to verify the RDP connectivity status. You can quickly get the status of ping, FQDN, RDP ports, and RDP services, RDP status, RDP Settings, RDPwithNLA, etc.

What are the reasons Remote Desktop connections to fail in Windows?

Below are a few key reasons that might be responsible for the Remote Desktop connections to fail in Windows.

Antivirus / Firewall Might Blocking

There is also a possibility after you installed the Antivirus or configured the firewall, They might block a few features of the Remote Desktop Connection. That’s the reason you might not be able to connect to the Remote Desktop.

RDP not working post Windows Update

There is another chance that you might get the issue with your Remote Desktop Connection post your Windows update. There is a chance that a few of the RDP features might get corrupted after your Windows update. You will have to fix those issues manually in order to make the Remote Desktop Connection work properly.

Issue Due to public network profile

There is also one more reason, you might get some issues connecting the Remote Desktop when you have a public network profile in Windows.

Fix: Remote Desktop can’t Connect to the Remote Computer

You can try out the below solutions to fix the Error: “Remote Desktop can’t connect to the remote computer for one of these reasons”.

Allow the Remote Desktop Connection

Follow the below steps to allow the Remote Desktop Connection

  1. Click on Start –> click on Settings –> click on System
  2. Click on the Remote Desktop option from the left navigation.
  3. “On” the Enable Remote Desktop option.
Remote Desktop can’t connect to the remote computer for one of these reasons error

Update Your Firewall Settings

You need to update your firewall setting that might blocking the Remote Desktop Connection using the below steps

  1. Navigate to your Start menu and search for Allow an app through Windows Firewall.
  2. Click on the Open option.
  3. The next step is to click on the Change Settings button that is present at the top right corner as shown below.
Fix Remote Desktop can’t Connect to the Remote Computer

4. Scroll down till you can see Remote Desktop and select the checkbox for private one.

5. Finally, close the window to save the changes.

Add the IP Address of your Remote Computer to your Host file

You can also try adding the IP Address of your Remote Computer to your host file. Follow the below steps to add the IP address of your remote computer to your host file.

  1. Open the command prompt with run as administrator.
  2. Run the below command.
cd C:/Windows/System32/Drivers/etc

3. The next step is, run the below command

notepad hosts
Fix: Remote Desktop can’t Connect to the Remote Computer for one of these Reasons

4. Add the IP address of your Remote computer at end of this hosts notepad file and then close it and click on the Save button.

Verify Your Remote Desktop Credential

Most of the times, for our easy access, we use to save the Remote Desktop credentials for one particular Remote machine and when we are trying to access a different Remote computer that time we might forget to access the VM with a different credential and when we will try to access the remote machine with the other credential, you will get the error. So, you need to reset the credentials.

You need to follow the below steps to reset your credentials

  1. Type mstsc on your start menu and then click on the Remote Desktop Connection option.
  2. Once, you will type in the computer IP address or the name. If there are any credentials saved for that particular computer, you can able to see the edit or delete option.
  3. Click on the delete option and then it will show you Are you sure want to delete the saved credentials, click on the Yes button to confirm the changes.

Check your Network/Internet connection

You need to make sure your Network or Interconnection is working properly. If there will be an issue with your Network or Internet connection, you might get any issue while accessing your Remote Desktop Connection.

You can use the below command in your command prompt to check if all the network resources are working fine as expected

ping 8.8.8.8

Slow connection

Sometimes, if your network connection is very slow, you can able to connect your remote machine but it will disconnect so many times and also you might get some connection errors while trying to connect to your remote computer. In that case, you might have to update the driver software related to your Network Adopters.

RDP Port conflict?, Change RDP port number

In case, another application is trying to use the same port number that your RDP is supposed to use (By default 3389), then, in that case, you will end up with an RDP Port conflict, and then it will not allow you to use the RDP. You can change the port number for your RDP from 3389 to a different one.

The first thing is, you need to find out a free port and you can able to see the list of ports assigned to the different resources using the below command in your command prompt. You can select any free port between 1024 through 49151.

netstat -a -o

You can able to see the list of port and usage like below

How to resolve common errors with Windows Remote Desktop

You need to add a new Windows Firewall Inbound rule using the below information

  1. Rule Type: select Port
  2. Protocol and Ports: TCP, Specific local ports, <port number>
  3. Action: select Allow the connection
  4. Profile: Tick all options
  5. Name: Remote Desktop – TCP <Your New port number>

Note: Always take a backup of your server before making any changes.

The next step is to make the below changes

  • Navigate to the Start menu and search for regedit.
  • Now, you will see the registry file, locate the below key in the file
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal SErver\WinStations\RDP-Tcp\PortNumber
  • As a next step, Open the PortNumber registry key for edit, change the display to option as Decimal, enter your new port number and click OK to save the changes.
  • Now, you need to restart the Remote Desktop Service, so that the changes will get reflected. Navigate to the start button and then search for services, find out the Remote Desktop Service and restart it.
  • Click on the Yes button on the confirmation Pop up to confirm the restart.

Below are some fixes based on the server you are using

Remote desktop can’t connect to the remote computer server 2012 [Solved]

In case, you are using the Windows server 2012, you got the error Remote desktop can’t connect to the remote computer error, then you can follow the below steps to fix the issue

  1. Right click on the “My Computer” –> Select the “Properties” –> Then select the “Remote Settings” option.
  2. On the same screen, You need to uncheck the “Allow connections only for computers running Remote Desktop with Network Level Authentication (recomended)” check box.

Remote desktop can’t connect to the remote computer windows 7 [Solved]

If the machine is running windows 7 and you got the error Remote desktop can’t connect to the remote computer while using RDP, you can try out the below steps which will fix the issue.

  1. Click on the Start button –> Right-click on the Computer –> Select the Properties option.
  2. From the Left, Select the Remote Settings or select the Remote Tab.
  3. Now you need to select the option “Allow connections from computers running any version of Remote Desktop”
  4. Finally, select the Ok button.

or for the same option, you can try out the below steps

  1. Click on the Start button –> Control Panel –> Select System.
  2. Click on the  Advanced System Settings link.
  3. Now, click on the Remote tab.
  4. select the “Allow connections from computers running any version of Remote Desktop” option and click on the Ok button.

Remote desktop can’t connect to the remote computer for one of these reasons windows 10 [Solved]

If the machine is running windows 10 and you got the error Remote desktop can’t connect to the remote computer while using RDP, you can try out the below steps which will fix the issue.

  1. Click on the Start –> click on the Settings –> click on System
  2. Click on the Remote Desktop option from the left navigation.
  3. “On” the Enable Remote Desktop option.

Remote desktop can’t connect to the remote computer server 2016 [Solved]

If the machine is running Windows server 2016, and you got the error Remote desktop can’t connect to the remote computer while using RDP, you can try out the below steps which will fix the issue.

  1. Open the Server Manager, you can select it from the taskbar to open it.
  2. Click on the local server from the left side. You can able to see the Remote Desktop is listed as Disabled.
  3. As the next step, Click on the Disabled option which will open the System Properties window on the Remote tab.
  4. Select the “Allow remote connections to this Computer” option on the System Properties window.
  5. Now one warning pop-up will appear which will say this will create the required firewall rules in Windows firewall to allow remote desktop traffic, Click on the Ok button.
  6. On the System Properties window, click on the Ok button.
  7. Restart your machine which will apply the changes will enable the Remote Desktop option.

Final Thoughts

In this article, we discussed how to fix the error “”Remote desktop cannot connect to the remote computer” error that I got while connecting to my Azure Virtual Machine.”