question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to connect: The remote connection failed or was closed unexpectedly

See original GitHub issue

Hi there, Firstly, thank you for such an awesome tool. I am having issues getting the Remote Connection working on the Amazon EC2 Windows Server 2019 instance.

I installed IIS with Web Sockets and I am trying to connect with the Administrator account itself. Able to connect RDP with Microsoft Remote Desktop but not with Myrtille.

This is the error I am getting: image

I am using: Protocol: RDP, Security: AUTO, Server(;port): <Public IP of the AWS instance>:8431 Domain: Public DNS User: Administrator Password: <Password that I use to connect to RDP with MS Remote Desktop>

I checked the logs in Myrtille.Service, it shows:

2020-01-19 10:56:32,869 [45] INFO  System.Diagnostics redirection [(null)] - Connecting remote session d5ae4ab9-2f5b-4a7a-b64f-c4b8b31526f2, type RDP, security RDP, server (:port) 
13.232.225.245:8431, vm (none), domain ec2-13-232-225-245.ap-south-1.compute.amazonaws.com, user Administrator, program (none)

2020-01-19 10:56:49,227 [50] INFO  System.Diagnostics redirection [(null)] - Disconnected remote session d5ae4ab9-2f5b-4a7a-b64f-c4b8b31526f2, exit code 131078

2020-01-19 10:59:34,054 [43] INFO  System.Diagnostics redirection [(null)] - Connecting remote session 84891574-a4ec-4ebe-b936-f02327e1c2eb, type RDP, security AUTO, server (:port) 13.232.225.245:3389, vm (none), domain ec2-13-232-225-245.ap-south-1.compute.amazonaws.com, user Administrator, program (none)

2020-01-19 10:59:35,106 [43] INFO  System.Diagnostics redirection [(null)] - Disconnected remote session 84891574-a4ec-4ebe-b936-f02327e1c2eb, exit code 131092

2020-01-19 10:59:53,135 [49] INFO  System.Diagnostics redirection [(null)] - Connecting remote session 4abad21d-59a1-4718-a43a-b7b27882fe75, type RDP, security AUTO, server (:port) 13.232.225.245:3389, vm (none), domain (none), user Administrator, program (none)

2020-01-19 10:59:54,541 [49] INFO  System.Diagnostics redirection [(null)] - Disconnected remote session 4abad21d-59a1-4718-a43a-b7b27882fe75, exit code 131092

2020-01-19 11:34:02,996 [49] INFO  System.Diagnostics redirection [(null)] - Connecting remote session 12ed890d-651a-456f-abee-f84801c9bcdb, type RDP, security AUTO, server (:port) 13.232.225.245:8431, vm (none), domain ec2-13-232-225-245.ap-south-1.compute.amazonaws.com, user Administrator, program (none)

2020-01-19 11:34:19,781 [45] INFO  System.Diagnostics redirection [(null)] - Disconnected remote session 12ed890d-651a-456f-abee-f84801c9bcdb, exit code 131078

I also checked the FreeRDP for the same Error Code 131078 (0x20006) but couldn’t get a proper solution. I have disabled NLA on Server too. I’ve tried keeping Stats ON and Debug ON, and this is what it shows:

image

Would be great if you can help.

Thanks, Manan

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mananjadhavcommented, Jan 21, 2020

Hi Cedric, Trying different combinations, finally it did work. Yes you’re right, problem with the port.

Now with Protocol RDP, Security Auto, Server and Domain as Public DNS and credentials it worked. (Also NLA had to be disabled).

If I change the Security to RDP or add the Port it doesn’t work. Guessing something wrong with my setup.

Thanks a lot for your help. Appreciate it.

0reactions
cedrozorcommented, Jan 20, 2020

Hi manan,

The freerdp exit code was different (131092) when you were using the standard rdp port 3389. It occurs with invalid credentials (https://github.com/cedrozor/myrtille/blob/3780cebf52d6109cc335064efde141fadbfbf079/Myrtille.Services.Contracts/Enums/RemoteSessionExitCode.cs#L39); assuming username and password are valid, did you try a nslookup on ec2-13-232-225-245.ap-south-1.compute.amazonaws.com from the myrtille machine ?

Can you retry with port 3389, with another security protocol (i.e. TLS or RDP), after checking that NLA is not enforced on the target?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix 8 common remote desktop connection problems
Network failure. A lack of a valid communications path can prevent a client from connecting to a remote desktop session. The easiest way...
Read more >
VNC Connect Error Messages
VNC Viewer may display the following error messages if a connection attempt to VNC Server running on a remote computer fails.
Read more >
How to Fix All Remote Desktop Connection Not ... - YouTube
Remote Desktop cannot connect error, certificate expired invalid, ... So, if you can't connect to Remote Desktop in Windows 10, ...
Read more >
Troubleshoot Remote desktop disconnected errors
Because of a security error, the client could not connect to the remote computer. Verify that you are logged onto the network and...
Read more >
3 Tested Solution to Fix VNC The Connection Closed ...
When connecting to a VNC Server, the VNC Viewer is unable to connect, and shows this message, 'Connection closed unexpectedly'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found