Microsoft remote desktop error code 0x4

Microsoft RDS giving me Error Code 0x4 when I try to connect. No VPN, and the troubleshooting tips I've used before to fix this error aren't working. Anyone know whats up? from RemoteDesktopServices

I had this problem with error code 0x4, on a clients' server, and I see questions about it all over the internet. Fortunately for me, I found what caused my problem, and I will share it here with you, and I hope will help someone, if their problem is caused by same issue as mine.

In my case, it was caused by open, unprotected, RDP port 3389. As many would guess, this is a highly targeted port by bots. If your port is open to anyone in the internet, it's just a matter of time that your server or computer will be targeted.

The best solution would be to only allow connections from trusted IP addresses, the ones you use for connecting to your server.

Of course, that can't always be possible, so another solution would be something like the fail2ban utility used on many Linux servers.

The two solution I've found are EvlWatcher which is free and open source, and IPBan that have a free and open source version, but also a paid version.

You only need one of them, as they do the same thing. Do not install both. They will scan your logs and will temporary or permanently block any IP address with repeated fail connections. I suggest you always have your main IP address whitelisted, so you don't lock yourself out.

Best regards to you all.

TLDR: Modify your power plan to ensure your VM isn’t going to sleep!

I had recently deployed a new Windows 10 based VM that would serve as an RDP jump box to access lab resources. Initially RDP worked fine, but I noticed that after a while I couldn’t connect any more. The only way to rouse it from this state was to open a direct console window from the vSphere Client, or to reboot the VM.

The exact error message from the Remote Desktop for Mac window is:

“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.

Error code: 0x204”

In addition to the 0x204 error, I also saw “Error code: 0x4” numerous times as well.

The two error codes I kept getting [0x204 and 0x4] were not helpful and just led me on a wild goose chase. These codes were only reported on the Mac RDP client and Windows was more generic:

Clearly the message “Make sure the PC is turned on” garnered no attention from a seasoned IT professional like me, but in the end turned out to be relevant. The issue was that the Windows 10 VM was going to sleep.

I only noticed this when I saw a blacked-out screen in the console preview and the lack of a hostname or IP address listed. This tells me that VMware tools hasn’t checked in for a period of time.

I’m not sure if an incoming RDP connection attempt would wake a physical machine in this state, but sleep isn’t very beneficial to a VM. I simply modified the power settings to prevent sleep and hibernation and the issue hasn’t happened again.

Windows Server varieties don’t behave this way, but because Windows 10 is primarily intended for bare-metal laptop and desktop use cases, power saving features are enabled by default.

This is a pretty basic problem, but I thought I’d do a post just in case it helps someone else who overlooked the obvious like I did and instead tried chasing up hexadecimal error codes 🙂

Remote Desktop Protocol [RDP] is a proprietary protocol developed by Microsoft which provides a user with a graphical interface to connect to another computer over a network connection. You will receive the following error “Your session has ended because of an error: Error Code 0x4″ whenever your Mac goes to sleep”. Below are some troubleshooting guides relating to RDP  “We could not connect to the remote PC with error code 0x204 and make sure the PC is turned on and connected to the network–Part 1” and We could not connect to the remote PC with error code 0x204 and make sure the PC is turned on and connected to the network–Part 2.

Since this is actually not a problem, please use the following steps below to mitigate this issue.

Solutions: Kindly refer to the steps below to resolve these issues. 1: Launch a new RDP connection or

2: Simply increase the maximum outstanding connections limit on the windows client machine. The following DWORD registry key controls this value.

See the following hyperlinks for what is Registry Editor and how to access the registry hives and how to search through Windows Registry.
– Next, you will have to launch the Windows registry and navigate through the following hives as described below

Computer\HKEY_LOCAL_MACHINE - SYSTEM - CurrentControlSet - Control - Terminal Server - MaxOutstandingConnections

Now create the DWORD key if your machine doesn't have it. - Set it to 10,000 [hex value]

I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.

Video liên quan

Chủ Đề