Azure VM无法通过RDP连接:RDS许可证问题求助
Fixing "Remote session was disconnected because there are no Remote Desktop License Servers available"
Hey there, let's get this frustrating RDS licensing issue sorted out for you—first, we need to get back into your VM, then we can reset the grace period or set up proper licensing.
First: Connect to Your VM Without RDS
Since RDS is blocking your remote desktop access, you'll need an alternative way to log in:
- Local Hyper-V/VMware VMs: Head to your host machine, open Hyper-V Manager/VMware Workstation, right-click your VM, and select Connect. This uses the local console, which bypasses RDS entirely.
- Cloud VMs (Azure/AWS/GCP): Use your cloud provider's built-in console tools:
- Azure: Use the Serial Console or Remote Desktop via Azure Portal (under VM settings)
- AWS: Try EC2 Instance Connect or Systems Manager Session Manager
- Physical Servers: Plug in a monitor and keyboard directly to the server for local login.
Option 1: Reset the RDS Grace Period (Temporary Fix)
Note: You can only reset the grace period once, so use this time to set up permanent licensing. Here's how:
- Open an elevated Command Prompt (right-click Start > Command Prompt (Admin))
- Stop the Remote Desktop Services first:
net stop termservice - Delete the grace period registry key—you might need to fix permissions first:
- Open Registry Editor (
regedit), navigate toHKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod - Right-click the
GracePeriodkey > Permissions > Advanced - Under the Owner tab, change the owner to Administrators, check "Replace owner on subcontainers and objects", then click OK
- Back in Permissions, give Administrators full control, then click OK
- Now run this command to delete the key:
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod" /f
- Open Registry Editor (
- Restart the Remote Desktop Services:
net start termservice - Reboot your VM—your RDS grace period will reset to the default 120 days.
Option 2: Set Up Permanent RDS Licensing (Long-Term Fix)
To avoid this issue forever, you'll need to purchase and configure RDS CALs (Client Access Licenses):
- Buy RDS CALs: Choose between Per User or Per Device licenses based on your use case. Purchase via Microsoft's Volume Licensing Center or an authorized reseller.
- Install a License Server:
- On your VM (or a dedicated server), open Server Manager > Add Roles and Features
- Select Remote Desktop Services > Remote Desktop Licensing, then follow the wizard to install the role
- Activate the License Server:
- Open Remote Desktop Licensing Manager, right-click your server > Activate Server
- Follow the activation wizard (you'll need your Microsoft account or volume licensing info)
- Install Your CALs:
- In Licensing Manager, right-click your server > Install Licenses
- Enter your license key/information to add the purchased CALs
- Configure the RDS Session Host to Use the License Server:
- Open Remote Desktop Session Host Configuration (search for it in Start)
- Right-click RD Session Host Server Settings > Properties
- Go to the Licensing tab, select your license server, and set the licensing mode (match the CALs you bought)
- Alternatively, use Group Policy: Open
gpedit.msc, navigate toComputer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Licensing, and set the two policies for license servers and licensing mode.
Once done, restart the Remote Desktop Services and test your remote connection—you shouldn't see the licensing error anymore.
内容的提问来源于stack exchange,提问作者John Morrison
相关产品推荐
相关产品推荐

