To fix RDP error 0x104 on Windows Server: Test transport reachability using Test-NetConnection -ComputerName <ServerIP> -Port 3389, connect via static IPv4 address rather than NetBIOS hostname to eliminate local DNS drops, enable the RemoteDesktop-UserMode-In-TCP rule in Windows Defender Firewall, and set the network connection profile to Private using Set-NetConnectionProfile.[1][2]
Follow this step-by-step systems administration runbook to trace TCP 3389 routing drops, repair firewall perimeter rules, and eliminate network interface deadlocks across Windows Server and macOS Remote Desktop clients.[1][3]
Why Does Windows Server Trigger RDP Error 0x104?
Remote Desktop error code 0x104—often rendered as “We couldn’t connect to the remote PC. Make sure the PC is turned on and connected to the network, and that remote access is enabled”—is strictly a pre-authentication network transport failure.[1] Unlike credential or CredSSP errors, error 0x104 indicates that the client device never established an initial TCP/UDP handshake with the listening Terminal Services port.[2]
This communication failure typically traces to one of five architectural bottlenecks:
- DNS Hostname Resolution Failure: When connecting via server hostname (e.g.,
APP-SRV01), local routers or client DNS resolvers fail to translate the NetBIOS name into a routable IPv4 address, causing the client to terminate the connection instantly.[1] - Windows Defender Firewall Profile Restrictions: By default, Windows Defender Firewall binds inbound Remote Desktop rules (
TCP 3389) exclusively to Domain and Private network profiles. If a network interface spontaneously switches to Public following a reboot or gateway refresh, inbound traffic drops silently.[3] - Disabled Remote Desktop Daemon: The
TermServicedaemon is stopped, or the core registry flagfDenyTSConnectionsis set to1inHKLM:\System\CurrentControlSet\Control\Terminal Server.[2] - Port Number Mismatches: If an administrator modified the default listening port from
3389to a custom port in the registry (PortNumber) without appending the port suffix (hostname:port) in the client, error 0x104 triggers immediately.[4] - macOS Local Network Privacy Sandboxing: On macOS clients running Microsoft Remote Desktop or the Windows App, missing Local Network privacy permissions prevent the app from broadcasting ARP or TCP packets across the local subnet.[5]
Diagnostic Matrix: RDP Error 0x104 Root Causes and Remediations
| Failure Vector | Diagnostic Indicator | Affected Layer | Direct Remediation Action |
|---|---|---|---|
| DNS Resolution Drop | Connection succeeds by IP, fails by hostname | Name Resolution (DNS/LLMNR) | Point client to static IPv4 address or configure DNS suffix |
| Blocked Inbound Port | Test-NetConnection -Port 3389 returns False |
Transport / Firewall | Enable RemoteDesktop-UserMode-In-TCP in firewall |
| Public Network Profile | Network status shows “Public Network” | OS Network Profile | Run Set-NetConnectionProfile -NetworkCategory Private |
| TermService Disabled | TermService process status is Stopped |
OS Service (TermService) |
Execute Set-Service TermService -StartupType Automatic -Status Running |
| macOS Permission Sandbox | Error 0x104 occurs only from Apple devices | macOS Security Sandbox | Grant “Local Network” permission in macOS System Settings |
Diagnostic Checklist: How to Fix RDP Error 0x104 on Windows Server
Execute this sequential diagnostic protocol to verify network reachability, firewall integrity, and Terminal Services daemon status.
Step 1: Test Port 3389 Socket Reachability from the Client
Before adjusting server settings, determine whether the network path is open from your client workstation:
# Run from Windows Client PowerShell
Test-NetConnection -ComputerName 192.0.2.50 -Port 3389
Review the terminal output:
TcpTestSucceeded : True: The network socket is open. The failure relates to authentication or display rendering.TcpTestSucceeded : False: The packet was dropped. A host firewall, routing boundary, or stopped service is blocking TCP 3389.[1]
From macOS or Linux workstations, test socket connectivity via Netcat:
# Run from macOS / Linux terminal
nc -zv -w 3 192.0.2.50 3389
Configuring Windows Defender Firewall for Remote Desktop Port 3389
On production hardware—such as Nextgen Hosting Dedicated Servers and high-throughput Pakistan Dedicated Servers—firewall rules must permit inbound traffic across all assigned network interfaces.
Step 1: Inspect Inbound Remote Desktop Firewall Rules
Open elevated PowerShell on the target Windows Server and query active rules:
# Query inbound Remote Desktop firewall rules
Get-NetFirewallRule -DisplayGroup "Remote Desktop" |
Select-Object Name, DisplayName, Enabled, Direction, Action, Profile
If the rules return Enabled : False, enable them immediately across all profiles:
# Enable all built-in Remote Desktop inbound firewall rules
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
# Explicitly ensure TCP 3389 rule is active on Domain, Private, and Public
Set-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP" -Enabled True -Profile Any -Action Allow
Step 2: Fix the Active Network Connection Profile
If the network adapter reverted to the restrictive Public classification, Windows blocks incoming connections by default.[3] Switch it back to Private:
# Identify active network profiles
Get-NetConnectionProfile
# Change network category from Public to Private
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
Pro Tip: Custom Port Verification
Always verify the exact TCP port the server is listening on by inspecting the registry:
(Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp").PortNumber. If the returned value is not 3389 (for example, 33890), connect from the client using IPAddress:33890.[4]
Verifying the Remote Desktop Daemon and Registry Settings
Ensure the Remote Desktop Service is active and permitted to accept inbound socket connections:
# Enable Remote Desktop via Windows Registry
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" `
-Name "fDenyTSConnections" -Value 0 -Force
# Configure Remote Desktop Service to start automatically
Set-Service -Name "TermService" -StartupType Automatic
Start-Service -Name "TermService"
Verify that the UserMode port listener is actively listening on TCP 3389:
# Confirm listener status on port 3389
Get-NetTCPConnection -LocalPort 3389 -State Listen
Resolving macOS Local Network and VPN Routing Collisions
A significant percentage of 0x104 errors occur when users connect from Apple macOS devices using Microsoft Remote Desktop or the newly released Windows App.[5]
Step 1: Grant macOS Local Network Permissions
Apple macOS Sequoia (15.x) and Sonoma (14.x) isolate application network access via sandboxing flags:
- Open System Settings on your Mac.
- Navigate to Privacy & Security → Local Network.[5]
- Locate Microsoft Remote Desktop (or Windows App).
- Ensure the toggle switch is set to ON. (If already ON, toggle it OFF, wait 5 seconds, and toggle it back ON to clear cached privacy entitlements).[5]
Step 2: Eliminate Conflicting Virtual Network Adapters
Virtual machines (VMware Fusion, Parallels, Docker Desktop) and third-party VPN clients frequently install virtual bridge interfaces (e.g., bridge0, utun3) that hijack the default routing table.[5]
- On your Mac, open System Settings → Network.
- Identify inactive Thunderbolt bridges, virtual adapters, or split-tunnel VPNs.
- Click the adapter → select Make Service Inactive or disconnect the secondary VPN.
- Relaunch Microsoft Remote Desktop and reconnect.
Common Pitfall: Connecting Over WAN Without a VPN or Gateway
Never expose raw TCP port 3389 directly to the public internet on cloud servers without IP whitelisting. Automated bots launch brute-force attacks within seconds of port discovery, causing connection exhaustion and error 0x104. Always route remote access through an encrypted WireGuard VPN tunnel, an SSH port forward, or an official Remote Desktop Gateway.[2]
Step-by-Step Server Administrator Remediation Plan
Follow this terminal checklist when resolving RDP Error 0x104 tickets on enterprise Windows Server fleets:
[ ] Step 1: Run 'Test-NetConnection -Port 3389' from client to verify raw packet transit.
[ ] Step 2: Attempt connection using direct static IPv4 address instead of hostname.
[ ] Step 3: Verify server's active network profile: run 'Get-NetConnectionProfile'.
[ ] Step 4: If profile is 'Public', execute 'Set-NetConnectionProfile -NetworkCategory Private'.
[ ] Step 5: Run 'Enable-NetFirewallRule -DisplayGroup "Remote Desktop"' on the target server.
[ ] Step 6: Verify 'fDenyTSConnections' is set to 0 in HKLM:\System\CurrentControlSet\Control\Terminal Server.
[ ] Step 7: Check 'Get-NetTCPConnection -LocalPort 3389' to ensure TermService is listening.
[ ] Step 8: On macOS clients, verify 'Local Network' permission in System Settings -> Privacy.
[ ] Step 9: Reconnect client and confirm active desktop session establishment.
Frequently Asked Questions About Remote Desktop Error 0x104
Why do I get Remote Desktop error code 0x104?
Error code 0x104 indicates that the client device cannot locate or establish a TCP network connection with the remote computer.[1] Common triggers include DNS hostname resolution failures, Windows Defender Firewall blocking port 3389, the network adapter being classified as “Public”, or the Remote Desktop service (TermService) being disabled on the host.[1][3]
How do I fix RDP error 0x104 on Windows Server?
To fix error 0x104, connect directly using the server’s numeric IPv4 address instead of its hostname, enable the RemoteDesktop-UserMode-In-TCP rule in Windows Defender Firewall, change the network connection profile from Public to Private using PowerShell, and verify that Remote Desktop is enabled in System Properties (sysdm.cpl).[1][2]
How do I enable port 3389 through Windows Defender Firewall?
Open an elevated PowerShell window on the Windows Server and run Enable-NetFirewallRule -DisplayGroup "Remote Desktop".[3] To ensure the rule applies across all interfaces, run Set-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP" -Enabled True -Profile Any -Action Allow.[3]
Why does Remote Desktop fail when connecting by hostname instead of IP?
When connecting via hostname, your computer depends on local DNS, WINS, or LLMNR broadcast protocols to resolve the name to an IP address.[1] If router DNS suffixes are mismatched or NetBIOS over TCP/IP is disabled, name resolution fails, prompting error 0x104.[1] Connecting directly by IP address bypasses name resolution completely.
How do I fix error 0x104 on macOS Microsoft Remote Desktop?
On macOS, open System Settings → Privacy & Security → Local Network, and toggle Microsoft Remote Desktop (or Windows App) to ON.[5] Furthermore, disconnect any secondary virtual network bridges or overlapping VPN adapters that could route local subnet traffic out of interface order.[5]
Deploy Enterprise Windows Remote Workstations
Eliminate RDP connection drops, firewall deadlocks, and network routing bottlenecks. Power your mission-critical operations with enterprise NVMe storage, dedicated hardware GPUs, and low-latency network uplinks from Nextgen Hosting.
Explore Global Dedicated Servers Explore Pakistan Dedicated ServersDisclaimer: This post is for informational and educational purposes only, accurate to the best of our knowledge at publication. It does not constitute advice. We do not guarantee accuracy or completeness and accept no liability for any decisions or losses resulting from reliance on this content.
Sources & Official References
- Microsoft Corporation. "Troubleshoot Remote Desktop connection issues and error codes in Windows." Microsoft Learn Technical Documentation. Available at: https://learn.microsoft.com/en-us/troubleshoot/windows-server/remote/troubleshoot-remote-desktop-services-issues
- Microsoft Corporation. "Remote Desktop Protocol (RDP) architecture and network port specifications." Windows Server Core Documentation. Available at: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds-rdp-protocol
- Microsoft Corporation. "Windows Defender Firewall with Advanced Security Administration Guide." Windows Security Technical Reference. Available at: https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/
- Microsoft Corporation. "Change the listening port for Remote Desktop on your computer." Windows Client Support Archive. Available at: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/change-listening-port
- Apple Inc. "Control access to your local network on Mac." macOS User Guide and Security Reference. Available at: https://support.apple.com/guide/mac-help/control-access-to-your-local-network-on-mac-mchlb7eb6373/mac
