Fix ERROR_CTX_SERVICE_NAME_COLLISION (0X00001B5E) on Remote Desktop
This error pops up when you try to start a Remote Desktop service that conflicts with an existing service name. Here's the fix.
You're setting up Remote Desktop Services on a Windows Server—maybe 2019 or 2022—and when you try to start the service, you get slapped with ERROR_CTX_SERVICE_NAME_COLLISION (0X00001B5E). The message says: "A service with the same name already exists on the system." I've seen this happen most often after you uninstall and reinstall the Remote Desktop Services role, or when a third-party app like LogMeIn or TeamViewer left a service stub behind. It's infuriating because the service you want to start looks right, but Windows says nope.
Why does this happen?
The root cause is simple: Windows maintains a registry key where each service has a unique name. If something else—even a disabled or orphaned service—already claims that name, the new service won't start. The Remote Desktop Services (TermService) is especially prone to this because other remote access tools sometimes borrow the same service name or create a conflicting entry. The collision isn't with a running service; it's with a dead entry in the registry. You just need to clean it out.
Steps to fix ERROR_CTX_SERVICE_NAME_COLLISION
I'll walk you through the fix. You'll need admin rights—local admin on the server works.
- Open Services console. Press Win + R, type
services.msc, and hit Enter. Look for any entry named "Remote Desktop Services" or "TermService." If you see more than one, that's your problem. Right-click the duplicate and choose Properties. Note the Service name field (e.g., TermService). If it's disabled or stopped, that's the ghost. - Check the registry for the conflicting service. Open Registry Editor (
regeditas admin). Navigate to:
Look for keys namedHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ServicesTermServiceor variations likeTermService_. You might see multiple entries. Each key corresponds to a service name. If there's more than one key with the exact name your Remote Desktop service wants (usuallyTermService), that's the collision. - Delete the offending registry key. Right-click the duplicate key (not the original TermService) and choose Delete. Confirm. Back up the key first—right-click, Export, save to a .reg file. I've seen people accidentally delete the real service key. That breaks Remote Desktop entirely.
- Restart the Remote Desktop service. Back in Services.msc, right-click "Remote Desktop Services" and choose Start. If it fails with the same error, reboot the server—sometimes the registry change doesn't take until a restart.
- If reboot doesn't help, check for hidden services. Open an elevated command prompt (Admin) and run:
This lists all services whose name contains "TermService." If you see multiple entries, delete the extra one with:sc query type= service state= all | findstr /i "TermService"
sc delete "TermService_"
ReplaceTermService_with the exact duplicate name. This is cleaner than registry editing for some admins.
What if it still fails?
If the service still won't start, check the Application and System logs in Event Viewer (eventvwr.msc). Look for errors from source TermServDevices or RDP-Tcp. I've seen cases where the service name was correct, but the service's dependencies were missing—like the RPC Endpoint Mapper or the Session Manager service. Run sc qc TermService to list dependencies. If any are missing, start them first.
Last resort: uninstall the Remote Desktop Services role completely, reboot, and reinstall. That clears all orphaned keys and dependencies. I know that's a pain, but it's bulletproof. If you're still stuck, drop me a comment with your Event Viewer error details—I'll help you track it down.
Was this solution helpful?