How to resolve the virtual machine access issue where I cannot connect via RDP and a licensing error message appears during the connection attempt?

Marcos Nelson Silveira Silva 0 Reputation points
2026-09-17T17:31:46.39+00:00

When a try to connect in VM, licensing error appears during the connection attempt.

Windows for business | Windows Server | User experience | Remote desktop clients
0 comments No comments

2 answers

Sort by: Newest
  1. Daphne Huynh (WICLOUD CORPORATION) 1,550 Reputation points Microsoft External Staff Moderator
    2026-09-18T02:04:11.4533333+00:00

    Welcome to Microsoft Q&A!

    Thank you for providing the details of the issue.

    Based on the error message, it appears that the server is configured as a Remote Desktop Session Host (RDSH) but is unable to obtain a valid Remote Desktop Services (RDS) license. This can occur for several reasons, such as:

    • No RD License Server is configured.
    • The RD License Server is unavailable or cannot be reached.
    • The licensing mode (Per User or Per Device) is configured incorrectly.
    • The Remote Desktop Licensing service is not running.
    • The RDS licensing grace period has expired.
    • The License Server is configured with an incorrect hostname or IP address.

    To help identify the root cause, I recommend the following troubleshooting steps:

    1. Connect to the server using an administrative session, which temporarily bypasses standard RDS licensing checks:

    mstsc /admin

    1. Open RD Licensing Diagnoser and review any errors or warnings that are reported.
    2. Verify the following:
    • The correct RD License Server is specified.
    • The licensing mode matches the installed CALs (Per User or Per Device).
    • The Remote Desktop Licensing service is running.
    1. If the License Server is configured through Group Policy, verify the settings under:

    Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Licensing

    1. Confirm that the RD Session Host can communicate with the License Server. In some cases, I have seen this issue occur when the License Server was configured with a public IP address instead of its internal FQDN or local IP address and updating the configuration to use the server's internal address resolved the issue.
    2. If the server is intended only for administrative access and does not require RDS sessions for users, you may also review whether the Remote Desktop Session Host role is needed.

    Reference: Cannot connect to RDS because no RD Licensing servers are available - Windows Server | Microsoft Learn

    If you find this information helpful, please click Accept Answer. 

    Thank you for using Microsoft Q&A.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-09-17T17:32:10.96+00:00

    This error usually means the VM has the Remote Desktop Session Host role enabled, but no usable Remote Desktop license server is available, the license server is not activated, the grace period has expired, or the CAL configuration is incorrect.

    Use this recovery path:

    1. Connect with an administrative RDP session.
      • Download the RDP file from the Azure portal, then connect with:
         mstsc /v:<Server>[:<Port>] /admin
      
      • A documented workaround is also to run:
         mstsc <File name>.RDP /admin
      
      This disables licensing for that connection only.
    2. If administrative RDP still fails, use the Azure VM Serial Console.
      • In the Azure portal, open Support & Troubleshooting > Serial console.
      • Start a CMD channel, switch to it with:
         ch -si 1
      
      • Sign in with a valid local or domain account for the VM.
    3. Check whether the Remote Desktop Session Host role is enabled. In an elevated CMD window, run:
         reg query "HKLM\SOFTWARE\Microsoft\ServerManager\ServicingStorage\ServerComponentCache\RDS-RD-Server" /v InstallState
      
      • If the value is 0, the role is disabled.
      • If enabled, check the licensing configuration:
         reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core" /v LicensingMode
         
         reg query "HKLM\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" /v SpecifiedLicenseServers
      
    4. Correct the licensing settings if needed.
      • If LicensingMode is not 4 (per user), set it to 4:
         reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core" /v LicensingMode /t REG_DWORD /d 4
      
      • If SpecifiedLicenseServers is missing or incorrect, set the correct license server:
         reg add "HKLM\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" /v SpecifiedLicenseServers /t REG_MULTI_SZ /d "<FQDN / IP License server>"
      
      • Restart the VM after registry changes.
    5. If no license server is actually needed, remove the RDS Session Host role. This is appropriate when no more than two concurrent administrative RDP sessions are needed. Removing the role returns the VM to the default two concurrent RDP connections.
         dism /ONLINE /Disable-feature /FeatureName:Remote-Desktop-Services
      
      • If the VM also has the licensing role installed but unused:
         dism /ONLINE /Disable-feature /FeatureName:Licensing
      
      Risk: removing roles changes remote access behavior. Use this only if the VM is not intended to function as an RDS host.
    6. Verify the VM can reach the license server. Test connectivity from the VM to the license server on port 135:
         telnet <FQDN / IP License Server> 135
      
    7. If RDP still does not work, run the standard Azure VM RDP checks.
      • Reset RDP configuration in the Azure portal: VM > Help > Reset password > Mode = Reset configuration only.
      • Verify NSG rules allow inbound RDP on port 3389.
      • Check boot diagnostics.
      • Reset the NIC.
      • Check Resource health.
      • Restart or redeploy the VM if needed. Note: redeploy can cause ephemeral disk data loss and can change dynamic IP addresses.
      • Ensure local or on-premises firewalls allow outbound TCP 3389.

    If the VM only needs normal admin access, the fastest fix is usually to connect with /admin, then either correct the RDS licensing configuration or remove the Remote Desktop Session Host role.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.