I Remote Desktop Connection Error Code 0x904 Install ((full)) May 2026

Comprehensive Fix: Resolving Remote Desktop Connection Error Code 0x904 (Installation & Connection Issues)

Error Code 0x904 is one of the most frustrating obstacles Windows users encounter when attempting to establish a Remote Desktop Protocol (RDP) session. Unlike standard network timeout errors, the 0x904 error typically manifests immediately upon connection or during the software installation phase of the Remote Desktop client. If you are searching for "i remote desktop connection error code 0x904 install," you are likely facing a situation where either the RDP client failed to install correctly, or the existing installation is corrupted, preventing any outbound connections.

This article provides a deep dive into the root causes of the 0x904 error and delivers nine proven methods to resolve it permanently. We will cover registry fixes, installation media corruption, permission structures, and specific workarounds for Windows 10, Windows 11, and Windows Server environments.

2. Verify Server Configuration

3. Update Remote Desktop Connection Client

Understanding Error Code 0x904

The error code 0x904 might not be widely documented, but Remote Desktop errors often relate to:

  1. Network Connectivity Issues: Problems connecting to the server.
  2. Server Configuration: The server not accepting connections or not properly configured.
  3. Client Software Issues: Problems with the Remote Desktop client software on your local machine.

8. Conclusion

Error 0x904 during RDP installation is a low-level STATUS_MEDIA_WRITE_PROTECTED error, not a typical connectivity issue. It means the installer attempted to commit an RDP binary or registry key to a location that refused write access. The fix involves removing read-only attributes, clearing the licensing store, and re-running the component installation via DISM or manual CAB expansion.

If the error persists after all steps, use procmon (Process Monitor) to filter Result = ACCESS_DENIED or WRITE_PROTECT for mstsc.exe or dism.exe to find the exact offending file path.

Remote Desktop Connection error code 0x904 (often accompanied by extended error code 0x7) typically indicates a failure to establish a secure connection between the client and the remote host. This is frequently caused by expired RDP certificates, network instability, or firewall blocks. 1. Fix Expired RDP Certificates

The most common cause is an expired self-signed certificate on the host machine that failed to renew automatically.

Identify: On the host computer, press Win + R, type certlm.msc, and navigate to Remote Desktop > Certificates.

Action: If the certificate is expired, right-click and Delete it.

Renew: Open Command Prompt as an administrator and run: restart-service termserv -force. Windows will automatically generate a new certificate. 2. Configure Firewall Exceptions

Windows Defender or third-party antivirus software may block the RDP protocol even if previously allowed.

Action: Search for "Allow an app through Windows Firewall" in the Start menu.

Verification: Ensure both Remote Desktop and Remote Desktop (WebSocket) are checked for both "Private" and "Public" networks.

Manual Entry: Click "Allow another app," browse to C:\Windows\System32\mstsc.exe, and add it to the list. 3. Resolve Network or VPN Instability

Error 0x904 can occur due to insufficient bandwidth, packet loss, or slow VPN connections.

Test Connection: Run Test-NetConnection [Server_Name] -Port 3389 from PowerShell to verify if the RDP port is reachable. i remote desktop connection error code 0x904 install

Bypass DNS: Try connecting using the remote computer's IP address instead of its hostname to rule out DNS resolution issues.

Check VPN: If using a VPN, disconnect and reconnect to ensure a stable tunnel is established. 4. Special Fix for Azure VMs

Azure Virtual Machines often encounter 0x904 due to a corrupt certificate store (MachineKeys).

Action: In the Azure Portal, use the Run Command feature to execute this PowerShell script:Rename-Item -path "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" -NewName "MachineKeys_old".

Restart: Reboot the VM to allow it to recreate a healthy certificate store. 5. Alternative RDP Clients

If the built-in Windows client continues to fail, users have reported success using the Microsoft Remote Desktop app from the Microsoft Store, as it often handles modern updates and encryption differently than the legacy client.

Are you connecting to a local computer or a cloud-hosted virtual machine? Fixed: Remote Desktop 0x904 Error [2 Solutions] - AnyViewer

Step 1 – Remove write protection from target paths

attrib -r -s -h %WinDir%\System32\mstsc.exe
attrib -r -s -h %ProgramFiles%\Remote Desktop /s /d

Prevention: How to Avoid Error 0x904 in the Future

Once you have resolved the error, take these steps to ensure it never returns:

  1. Disable Registry Cleaners: Never use CCleaner, Advanced SystemCare, or similar tools. They routinely delete the HKEY_CLASSES_ROOT\RDP keys.
  2. Update Drivers Sequentially: Do not bypass driver updates. Use Windows Update exclusively, or manually install driver packs.
  3. Backup the RDP Registry Branch: Export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Client to a .reg file after fixing the error.
  4. Avoid "Reset this PC" with Keep Files: This feature frequently breaks RDP. If you must reset, choose "Remove everything" and restore from backup.

Frequently Asked Questions (FAQ)

Q: Is error 0x904 the same as 0x904f? A: No. 0x904f relates to a licensing timeout (network), whereas 0x904 is a client installation/initialization failure.

Q: Can a VPN cause error 0x904? A: Rarely. VPNs cause network errors (0x204, 0x516). However, some VPNs install network adapters that hook into the RDP stack. Try disconnecting the VPN completely and restarting the RDP client.

Q: Does this error affect Windows Server RDSH (Remote Desktop Session Host)? A: Yes. On Windows Server 2016, 2019, and 2022, the 0x904 error appears on the client machine, not the server. You must apply these fixes to the computer initiating the connection.

Q: I see "Error 0x904" when installing Remote Desktop Services role. What now? A: That indicates a corruption in the Windows Server side. Run DISM /Online /Cleanup-Image /RestoreHealth and ensure the ServerMediaStack feature is not blocked by Group Policy.

When to contact support

If you want, tell me your Windows version (e.g., Windows 10 22H2, Windows Server 2019) and whether this is the client or host install — I’ll give exact commands and tailored steps.

(Invoking related search suggestions.)

Remote Desktop connection error 0x904 (often accompanied by extended error code 0x7) typically indicates a network instability or a certificate authentication failure during the "installation" or handshake phase of the connection. Ensure Remote Desktop is enabled on the server

Below is a complete guide to understanding and fixing this error. Common Causes

Expired or Corrupt Certificates: The most common trigger occurs when the self-signed RDP certificate on the host machine has expired and failed to renew automatically.

Network Instability: High latency, packet loss, or insufficient bandwidth, especially when connecting over a VPN.

Windows 11 Compatibility: A known bug in certain Windows 11 updates (like 22H2) can trigger this error when using hostnames instead of IP addresses.

Firewall Blockage: Security software (like Bitdefender) or Windows Defender Firewall may block the RDP executable (mstsc.exe) or port 3389. Solutions to Fix Error 0x904 1. Renew the Remote Desktop Certificate

If your connection fails suddenly while other servers on the same network work, an expired certificate is likely the culprit.

Access the remote server locally or via an alternative method.

Press Win + R, type certlm.msc, and hit Enter to open the Certificates console. Navigate to Remote Desktop > Certificates. Right-click the expired certificate and select Delete.

Open Command Prompt as administrator and run: net stop termservice then net start termservice.

Windows will automatically generate a new, valid self-signed certificate. 2. Connect via IP Address instead of Hostname

DNS resolution issues often cause 0x904. Bypassing the hostname can establish a more stable link. Open the Remote Desktop Connection client.

In the "Computer" field, enter the IP address (e.g., 192.168.1.50) instead of the computer name. 3. Fix Corrupt MachineKeys (Azure VMs)

For those using Azure, a corrupt certificate store often prevents new certificates from being created.

In the Azure Portal, go to your VM and select Run Command > RunPowerShellScript.

Enter the following command to rename the key folder:Rename-Item -path "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" -NewName "MachineKeys_old". Reboot the server to regenerate the keys. 4. Configure Firewall Exceptions If you want

Ensure that both the RDP service and the application are allowed through your firewall.

Search for "Allow an app through Windows Firewall" in the Start menu.

Click Change settings and ensure Remote Desktop and Remote Desktop (WebSocket) are checked for both Private and Public networks.

If using third-party security like Bitdefender, add C:\Windows\System32\mstsc.exe to the exception list. 5. Use the Microsoft Store RDP App

Many users find that the Microsoft Remote Desktop app from the Microsoft Store is more resilient to the 0x904 bug than the classic mstsc.exe client.

Remote Desktop error code is often described by IT professionals as a "

silent ghost" error because it frequently appears on servers that have worked perfectly for months, only to suddenly block access without any prior warning or obvious configuration change www.remoteaccesspcdesktop.com The "Silent" Root Causes

Experts and system administrators have identified that this specific error rarely stems from a single setting but is usually triggered by one of the following "invisible" issues: Expired RDP Certificates

: This is the most common culprit discovered by admins in troubleshooting communities. Windows creates self-signed certificates for Remote Desktop that do not always renew automatically. When they expire, the connection fails with 0x904. Network Instability

: Unlike other codes that signal a complete block, 0x904 often points to "dodgy" or unstable network paths, such as insufficient VPN bandwidth, packet loss, or mismatched encryption ciphers. Windows 11 Compatibility Quirks

: In builds 22H2 and later, some users found that hostname resolution specifically for RDP is buggy, causing 0x904 unless an IP address is used instead. www.remoteaccesspcdesktop.com Top Recommended "Reviewer" Fixes Based on successful documentation from IT forums like Microsoft Q&A , these are the most effective solutions: Renew the Self-Signed Certificate certlm.msc on the host machine. Navigate to Remote Desktop > Certificates Delete the expired certificate and restart the Remote Desktop Services (TermService) to force Windows to generate a fresh one. Bypass DNS with IP Addresses

: If you are on Windows 11, try connecting using the remote machine's internal IP address (e.g., 192.168.1.50) rather than its computer name. Switch to the Microsoft Store App : Many professionals recommend using the Microsoft Remote Desktop app from the Store rather than the built-in

, as the Store version uses a more resilient networking stack that often bypasses the 0x904 error. The Azure "MachineKeys" Fix

: For Azure Virtual Machines, 0x904 is often caused by a corrupt certificate store. Admins have fixed this by renaming the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys MachineKeys_old and rebooting the server. www.remoteaccesspcdesktop.com Are you attempting to connect to a local workstation cloud-hosted server like Azure?