Forum Discussion
RDP connection not possible and RDS-Virtualization role comes back after restart
Hello everyone,
I have here an Windows Server 2022 Standard 21H2 (Build 20348.4052) (essentials) with the newest updates. This is the Domain Controller. Hyper-V is installed with one VM. The VM is a terminal server. In the past I have tried to install the terminal server on the Hyper-V Server. To do so I have installed all kind of remotdesktop roles. This was stupid of me. Especially it does not work on a DC.
I want to connect as administrator by RDP (mstsc) to the server but it does not work anymore since I have installed all these roles and features. No other users are connected. I can still connect to the VM.
In one situation I was able to connect to the server but after entering the password I have received the error 0x808 (0x101) that there is no licence server for remote desktop available.
I have now removed all roles related to the terminal server and the rdp which I have installed. But I can not uninstall RDS-Virtualization. After uninstalling it comes back when I perform a restart. I have already tried Uninstall-WindowsFeature -Name RDS-Virtualization -Remove
In the server manager appears a menu item about remote desktop services. But there is written that no connection broker server is in the pool. The submenu server lists my DC.
I have found in the eventmanager a error related to the uninstalling process 0x80070057 wrong parameter But I do not have more information.
DISM /RestoreHealth and sfc /scannow did not find any problems.
I am not using VDI but is maybe the Hyper-V reinstalling the role after the restart?
Do I need to uninstall the role to make RDP working again or could be there other reasons?
Do you know where I find a detailed log about the problems about uninstalling the role and maybe the installing?
Do you have any idea how I can find out more about the problem?
Thank you!
1 Reply
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\VmHostAgentHyper-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