Since everyone started working remotely, I've personally needed to Remote Desktop into more computers lately than ever before. More this week than in the previous decade.
I wrote recently about to How to remote desktop fullscreen RDP with just SOME of your multiple monitors which is super useful if you have, say, 3 monitors, and you only want to use 2 and 3 for Remote Desktop and reserve #1 for your local machine, email, etc.
Set up and Configure a new Azure Resource Manager VM to RDP via port 3389 to the Remote Desktop Access. Connect to the virtual machine using the Remote Desktop Connection (RDC) client: In the Azure portal open the Resource groups view, and then click the resource group to use for the deployment. Select the new RDSH virtual machine (for example, Contoso-Sh1). Click Connect Open to open the Remote Desktop client. For anyone in need of testing VM’s, Remote Desktop is part of the mix of helpful tools for using Azure hosting services or even developing a virtual footprint. Everything begins with accessing the Azure Portal and creating a virtual machine. Connecting to the Azure VM (Remote Desktop) After this tutorial let’s change to my VM. Php scraping library. I’m very proud to have my first VM in the cloud! The first difficulty was that I was not able to connect to my VM via Remote Desktop. I clicked on Virtual Machines and was faced with a greyed out Connect button. By default, every Azure virtual machine has RDP (Remote Desktop Protocol), port 3389 enabled, and allows any RDP connection from any IP in the world. As great as that is, this can be a (huge) security risk.
IMHO, the Remote Desktop Connection app is woefully old and kinda Windows XP-like in its style.
There is a Windows Store Remote Desktop app at https://aka.ms/urdc and even a Remote Desktop Assistant at https://aka.ms/RDSetup that can help set up older machines (earlier than Windows 10 version 1709 (I had no idea this existed!)
The Windows Store version is nicer looking and more modern, but I can't figure out how to get it to Remote into an Azure Active Directory (AzureAD) joined computer. I don't see if it's even possible with the Windows Store app. Let me know if you know how!
So, back to the old Remote Desktop Connection app. Turns out for whatever reason, you need to save the RDP file and open it in a text editor.
Add these two lines at the end (three if you want to save your username, then include the first line there)
Note that you have to use the style .AzureADemail@domain.com
The leading .AzureAD is needed - that was the magic in front of my email for login. Then enablecredsspsupport along with authentication level 2 (settings that aren't exposed in the UI) was the final missing piece.
Add those two lines to the RDP text file and then open it with Remote Desktop Connection and you're set! Again, make sure you have the email prefix.
The Future?
Given that the client is smart enough to show an error from the remote machine that it's Azure AD enabled, IMHO this should Just Work.
More over, so should the Microsoft Store Remote Desktop client. It's beyond time for a refresh of these apps.
NOTE: Oddly there is another app called the Windows Desktop Client that does some of these things, but not others. It allows you to access machines your administrators have given you access to but doesn't allow you (a Dev or Prosumer) to connect to arbitrary machine. So it's not useful to me.
There needs to be one Ultimate Remote Windows Desktop Client that lets me connect to all flavors of Windows machines from anywhere, is smart about DPI and 4k monitors, remotes my audio optionally, and works for everything from AzureAD to old school Domains.
Between these three apps there's a Venn Diagram of functionality but there's nothing with the Union of them all. Yet.
Until then, I'm editing RDP files which is a bummer, but I'm unblocked, which is awesome.
Sponsor: Couchbase gives developers the power of SQL with the flexibility of JSON. Start using it today for free with technologies including Kubernetes, Java, .NET, JavaScript, Go, and Python.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
AboutNewsletter-->
The Remote Desktop Protocol (RDP) connection to your Windows-based Azure virtual machine (VM) can fail for various reasons, leaving you unable to access your VM. The issue can be with the Remote Desktop service on the VM, the network connection, or the Remote Desktop client on your host computer. This article guides you through some of the most common methods to resolve RDP connection issues.
If you need more help at any point in this article, you can contact the Azure experts on the MSDN Azure and Stack Overflow forums. Alternatively, you can file an Azure support incident. Go to the Azure support site and select Get Support.
Quick troubleshooting steps
After each troubleshooting step, try reconnecting to the VM:
- Reset Remote Desktop configuration.
- Check Network Security Group rules / Cloud Services endpoints.
- Review VM console logs.
- Reset the NIC for the VM.
- Check the VM Resource Health.
- Reset your VM password.
- Restart your VM.
- Redeploy your VM.
Continue reading if you need more detailed steps and explanations. Verify that local network equipment such as routers and firewalls are not blocking outbound TCP port 3389, as noted in detailed RDP troubleshooting scenarios.
Tip
If the Connect button for your VM is grayed out in the portal and you are not connected to Azure via an Express Route or Site-to-Site VPN connection, you need to create and assign your VM a public IP address before you can use RDP. You can read more about public IP addresses in Azure.
Ways to troubleshoot RDP issues
You can troubleshoot VMs created using the Resource Manager deployment model by using one of the following methods:
- Azure portal - great if you need to quickly reset the RDP configuration or user credentials and you don't have the Azure tools installed.
- Azure PowerShell - if you are comfortable with a PowerShell prompt, quickly reset the RDP configuration or user credentials using the Azure PowerShell cmdlets.
You can also find steps on troubleshooting VMs created using the Classic deployment model.
Troubleshoot using the Azure portal
After each troubleshooting step, try connecting to your VM again. If you still cannot connect, try the next step.
Reset your RDP connection. This troubleshooting step resets the RDP configuration when Remote Connections are disabled or Windows Firewall rules are blocking RDP, for example.
Select your VM in the Azure portal. Scroll down the settings pane to the Support + Troubleshooting section near bottom of the list. Click the Reset password button. Set the Mode to Reset configuration only and then click the Update button:
Verify Network Security Group rules. Use IP flow verify to confirm if a rule in a Network Security Group is blocking traffic to or from a virtual machine. You can also review effective security group rules to ensure inbound 'Allow' NSG rule exists and is prioritized for RDP port(default 3389). For more information, see Using Effective Security Rules to troubleshoot VM traffic flow.
Review VM boot diagnostics. This troubleshooting step reviews the VM console logs to determine if the VM is reporting an issue. Not all VMs have boot diagnostics enabled, so this troubleshooting step may be optional.
Specific troubleshooting steps are beyond the scope of this article, but may indicate a wider problem that is affecting RDP connectivity. For more information on reviewing the console logs and VM screenshot, see Boot Diagnostics for VMs.
Reset the NIC for the VM. For more information, see how to reset NIC for Azure Windows VM.
Check the VM Resource Health. This troubleshooting step verifies there are no known issues with the Azure platform that may impact connectivity to the VM.
Select your VM in the Azure portal. Scroll down the settings pane to the Support + Troubleshooting section near bottom of the list. Click the Resource health button. A healthy VM reports as being Available:
Reset user credentials. This troubleshooting step resets the password on a local administrator account when you are unsure or have forgotten the credentials. Once you have logged into the VM, you should reset the password for that user.
Select your VM in the Azure portal. Scroll down the settings pane to the Support + Troubleshooting section near bottom of the list. Click the Reset password button. Make sure the Mode is set to Reset password and then enter your username and a new password. Finally, click the Update button:
Restart your VM. This troubleshooting step can correct any underlying issues the VM itself is having.
Select your VM in the Azure portal and click the Overview tab. Click the Restart button:
Redeploy your VM. This troubleshooting step redeploys your VM to another host within Azure to correct any underlying platform or networking issues.
Select your VM in the Azure portal. Scroll down the settings pane to the Support + Troubleshooting section near bottom of the list. Click the Redeploy button, and then click Redeploy:
After this operation finishes, ephemeral disk data is lost and dynamic IP addresses that are associated with the VM are updated.
Verify routing. Use Network Watcher's Next hop capability to confirm that a route isn't preventing traffic from being routed to or from a virtual machine. You can also review effective routes to see all effective routes for a network interface. For more information, see Using effective routes to troubleshoot VM traffic flow.
Ensure that any on-premises firewall, or firewall on your computer, allows outbound TCP 3389 traffic to Azure.
If you are still encountering RDP issues, you can open a support request or read more detailed RDP troubleshooting concepts and steps.
Troubleshoot using Azure PowerShell
If you haven't already, install and configure the latest Azure PowerShell.
The following examples use variables such as myResourceGroup
, myVM
, and myVMAccessExtension
. Replace these variable names and locations with your own values.
Note
You reset the user credentials and the RDP configuration by using the Set-AzVMAccessExtension PowerShell cmdlet. In the following examples, myVMAccessExtension
is a name that you specify as part of the process. If you have previously worked with the VMAccessAgent, you can get the name of the existing extension by using Get-AzVM -ResourceGroupName 'myResourceGroup' -Name 'myVM'
to check the properties of the VM. To view the name, look under the 'Extensions' section of the output.
After each troubleshooting step, try connecting to your VM again. If you still cannot connect, try the next step.
Reset your RDP connection. This troubleshooting step resets the RDP configuration when Remote Connections are disabled or Windows Firewall rules are blocking RDP, for example.
The follow example resets the RDP connection on a VM named
myVM
in theWestUS
location and in the resource group namedmyResourceGroup
:Verify Network Security Group rules. This troubleshooting step verifies that you have a rule in your Network Security Group to permit RDP traffic. The default port for RDP is TCP port 3389. A rule to permit RDP traffic may not be created automatically when you create your VM.
First, assign all the configuration data for your Network Security Group to the
$rules
variable. The following example obtains information about the Network Security Group namedmyNetworkSecurityGroup
in the resource group namedmyResourceGroup
:Now, view the rules that are configured for this Network Security Group. Verify that a rule exists to allow TCP port 3389 for inbound connections as follows:
The following example shows a valid security rule that permits RDP traffic. You can see
Protocol
,DestinationPortRange
,Access
, andDirection
are configured correctly:If you do not have a rule that allows RDP traffic, create a Network Security Group rule. Allow TCP port 3389.
Reset user credentials. This troubleshooting step resets the password on the local administrator account that you specify when you are unsure of, or have forgotten, the credentials.
First, specify the username and a new password by assigning credentials to the
$cred
variable as follows:Now, update the credentials on your VM. The following example updates the credentials on a VM named
myVM
in theWestUS
location and in the resource group namedmyResourceGroup
:Restart your VM. This troubleshooting step can correct any underlying issues the VM itself is having.
The following example restarts the VM named
myVM
in the resource group namedmyResourceGroup
:Redeploy your VM. This troubleshooting step redeploys your VM to another host within Azure to correct any underlying platform or networking issues.
The following example redeploys the VM named
myVM
in theWestUS
location and in the resource group namedmyResourceGroup
:Verify routing. Use Network Watcher's Next hop capability to confirm that a route isn't preventing traffic from being routed to or from a virtual machine. You can also review effective routes to see all effective routes for a network interface. For more information, see Using effective routes to troubleshoot VM traffic flow.
Ensure that any on-premises firewall, or firewall on your computer, allows outbound TCP 3389 traffic to Azure.
If you are still encountering RDP issues, you can open a support request or read more detailed RDP troubleshooting concepts and steps.
Troubleshoot VMs created using the Classic deployment model
Important
Classic VMs will be retired on March 1, 2023.
Can't Rdp To Azure Vm
If you use IaaS resources from ASM, please complete your migration by March 1, 2023. We encourage you to make the switch sooner to take advantage of the many feature enhancements in Azure Resource Manager.
For more information, see Migrate your IaaS resources to Azure Resource Manager by March 1, 2023.
After each troubleshooting step, try reconnecting to the VM.
Reset your RDP connection. This troubleshooting step resets the RDP configuration when Remote Connections are disabled or Windows Firewall rules are blocking RDP, for example.
Select your VM in the Azure portal. Click the ..More button, then click Reset Remote Access:
Verify Cloud Services endpoints. This troubleshooting step verifies that you have endpoints in your Cloud Services to permit RDP traffic. The default port for RDP is TCP port 3389. A rule to permit RDP traffic may not be created automatically when you create your VM.
Select your VM in the Azure portal. Click the Endpoints button to view the endpoints currently configured for your VM. Verify that endpoints exist that allow RDP traffic on TCP port 3389.
The following example shows valid endpoints that permit RDP traffic:
If you do not have an endpoint that allows RDP traffic, create a Cloud Services endpoint. Allow TCP to private port 3389.
Review VM boot diagnostics. This troubleshooting step reviews the VM console logs to determine if the VM is reporting an issue. Not all VMs have boot diagnostics enabled, so this troubleshooting step may be optional.
Specific troubleshooting steps are beyond the scope of this article, but may indicate a wider problem that is affecting RDP connectivity. For more information on reviewing the console logs and VM screenshot, see Boot Diagnostics for VMs.
Check the VM Resource Health. This troubleshooting step verifies there are no known issues with the Azure platform that may impact connectivity to the VM.
Select your VM in the Azure portal. Scroll down the settings pane to the Support + Troubleshooting section near bottom of the list. Click the Resource Health button. A healthy VM reports as being Available:
Reset user credentials. This troubleshooting step resets the password on the local administrator account that you specify when you are unsure or have forgotten the credentials. Once you have logged into the VM, you should reset the password for that user.
Select your VM in the Azure portal. Scroll down the settings pane to the Support + Troubleshooting section near bottom of the list. Click the Reset password button. Enter your username and a new password. Finally, click the Save button:
Restart your VM. This troubleshooting step can correct any underlying issues the VM itself is having.
Select your VM in the Azure portal and click the Overview tab. Click the Restart button:
Ensure that any on-premises firewall, or firewall on your computer, allows outbound TCP 3389 traffic to Azure.
Vmware
Azure Virtual Machine Scale Set Remote Desktop
If you are still encountering RDP issues, you can open a support request or read more detailed RDP troubleshooting concepts and steps.
Troubleshoot specific RDP errors
You may encounter a specific error message when trying to connect to your VM via RDP. The following are the most common error messages:
Azure Virtual Machine Enable Remote Desktop
- The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.
- Remote Desktop can't find the computer 'name'.
- An authentication error has occurred. The Local Security Authority cannot be contacted.
- Windows Security error: Your credentials did not work.
- This computer can't connect to the remote computer.
Rdp Into Azure Vm
Additional resources
If none of these errors occurred and you still can't connect to the VM via Remote Desktop, read the detailed troubleshooting guide for Remote Desktop.
Azure Virtual Machine Remote Desktop Services
- For troubleshooting steps in accessing applications running on a VM, see Troubleshoot access to an application running on an Azure VM.
- If you are having issues using Secure Shell (SSH) to connect to a Linux VM in Azure, see Troubleshoot SSH connections to a Linux VM in Azure.