Forum Discussion
RDP connection not possible and RDS-Virtualization role comes back after restart
You're running Windows Server 2022 Standard (Essentials) with Domain Controller + Hyper-V + previously installed Remote Desktop Services (RDS) roles.
Why the RDS-Virtualization role keeps returning
The RDS-Virtualization feature is installed automatically if the system detects a VDI deployment flag in:
HKLM\SOFTWARE\Microsoft\RDVirtualizationHost
HKLM\SYSTEM\CurrentControlSet\Services\VmHostAgent
Hyper-V checks for these keys and re-enables the role during boot.
On a Domain Controller, Remote Desktop Virtualization Host is unsupported and cannot be fully uninstalled through Server Manager or PowerShell.
How to cleanly remove the leftover configuration
Run the following from an elevated PowerShell prompt:
# Stop related services
Stop-Service Rdms, RdAgent, VmmAgent -ErrorAction SilentlyContinue
# Remove RDS-Virtualization feature forcefully
Remove-WindowsFeature RDS-Virtualization -Verbose
# Delete leftover registry keys
Remove-Item "HKLM:\SOFTWARE\Microsoft\RDVirtualizationHost" -Recurse -ErrorAction SilentlyContinue
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Services\VmHostAgent" -Recurse -ErrorAction SilentlyContinue
Then restart the server.
After reboot, confirm it’s gone:
Get-WindowsFeature | Where-Object {$_.Name -like "RDS*"}
If it re-appears, export and delete this scheduled task if it exists:
C:\Windows\System32\Tasks\Microsoft\Windows\RemoteDesktopServices