mRemoteNG icon indicating copy to clipboard operation
mRemoteNG copied to clipboard

Settings RDP loadbalanceinfo causes An internal error has occured

Open xlash opened this issue 6 years ago • 18 comments

Issue

As soon as I set anything in the loadbalanceinfo of a RDP session, I get a Message: 4 An internal error has occured.

Expected Behavior

To connect to my RDS server farm and provide the loadbalanceinfo

Your Environment

  • Windows 10 Pro 1803 x64 17134.319 mRemoteNG version 1.75.7012.16814

xlash avatar Sep 28 '18 15:09 xlash

Do you get the error message when trying to connect to the server or when setting the loadbalanceinfo property in mRemoteNG?

Is your server hosted in Azure, by any chance? If so, this might be related to #829 or #523.

sparerd avatar Sep 30 '18 16:09 sparerd

Error is when connecting.

Server is on our LAN.

#829 is the pull request to include this functionnality. It could be an error handling this, I don't know.

#523 There isn't enough details about the error. It might be related. I did a network capture, and I saw a TLS1.2 packet before encryption which contains loadbalancinginfo with the RDS pool name. Not the cookie hash mentionned.

xlash avatar Sep 30 '18 19:09 xlash

Does the value in your loadbalanceinfo section follow the rules mentioned in the "remarks" section here? https://docs.microsoft.com/en-us/windows/desktop/TermServ/imsrdpclientadvancedsettings-loadbalanceinfo#remarks

sparerd avatar Sep 30 '18 20:09 sparerd

No, it does not use the Cookie syntax. The configured value is : tsv://MS Terminal Services Plugin.1.RDS-XXXXX\r\n

With native Windows Remote Desktop, I see this field provided in the first TLS packet sent (after TCP/IP handshake). 0000 00 1c 7f 85 6e 1a 9c b6 d0 ff e0 bb 08 00 45 00 ....n..¶Ðÿà»..E. 0010 00 6b 3c 42 40 00 80 06 2e e5 c0 a8 8c 0a c0 a8 .k<B@....åÀ¨..À¨ 0020 82 0a d4 95 0d 3d ce 34 4e 86 75 bd 13 f4 50 18 ..Ô..=Î4N.u½.ôP. 0030 01 00 cb d4 00 00 03 00 00 43 3e e0 00 00 00 00 ..ËÔ.....C>à.... 0040 00 74 73 76 3a 2f 2f 4d 53 20 54 65 72 6d 69 6e .tsv://MS Termin 0050 61 6c 20 53 65 72 76 69 63 65 73 20 50 6c 75 67 al Services Plug 0060 69 6e 2e 31 2e 52 44 53 2d 58 58 58 58 58 58 0d in.1.RDS-XXXXXX. 0070 0a 01 00 08 00 0b 00 00 00 .........

With mRemoteNG I see an extra 0x00 between every char provided. Then the server RST the connection.

0000 00 1c 7f 85 6e 1a 9c b6 d0 ff e0 bb 08 00 45 00 ....n..¶Ðÿà»..E. 0010 00 97 42 f1 40 00 80 06 28 0a c0 a8 8c 0a c0 a8 ..Bñ@...(.À¨..À¨ 0020 82 0a d5 92 0d 3d 80 fa 6f a4 e7 8c b0 d2 50 18 ..Õ..=.úo¤ç.°ÒP. 0030 01 00 35 8b 00 00 03 00 00 6f 6a e0 00 00 00 00 ..5......ojà.... 0040 00 74 00 73 00 76 00 3a 00 2f 00 2f 00 4d 00 53 .t.s.v.:././.M.S 0050 00 20 00 54 00 65 00 72 00 6d 00 69 00 6e 00 61 . .T.e.r.m.i.n.a 0060 00 6c 00 20 00 53 00 65 00 72 00 76 00 69 00 63 .l. .S.e.r.v.i.c 0070 00 65 00 73 00 20 00 50 00 6c 00 75 00 67 00 69 .e.s. .P.l.u.g.i 0080 00 6e 00 2e 00 31 00 2e 00 52 00 44 00 53 00 2d .n...1...R.D.S.- 0090 00 58 00 58 00 58 00 58 00 58 00 58 00 01 00 08 .G.S.-.M.T.L.... 00a0 00 0b 00 00 00 .....

xlash avatar Oct 01 '18 13:10 xlash

Hmm that is interesting. The original reason for #829 was that .NET uses UTF-16 encoded strings by default, but Azure was expecting UTF-8 encoded. It seems like that may be what is happening here as well.

Would you be able to try the most recent v1.76 version (you can grab the portable version if you don't want to upgrade fully yet)? Turn on the following setting and see if the connection works: Tools -> Options -> Advanced -> Use UTF8 encoding for RDP 'Load Balance Info' property

sparerd avatar Oct 03 '18 12:10 sparerd

Works with 1.76.3 Alpha 5 (2018-03-14). I had another issue. Seems like, after the TLS connection is established, the RD server redirects to another server, which works seemlessly with RDP, but don't with mRemoteNG. However, going directly to that host works for me.

Thanks,

image

xlash avatar Oct 03 '18 13:10 xlash

Maybe same here.. trying to connect to our RDS farm with "loadbalanceinfo" many times with different options/mremoteng versions, but was too lazy to create issue :(

Now it's 1.76.8, "tsv://MS Terminal Services Plugin.1.1cdev" or "tsv://MS Terminal Services Plugin.1.1cdev\r\n" in loadbalaceinfo.

Without "UTF8" checked it's error that says cannot connect ot gateway, with "UTF8" checked it's just closes connection in 1-5 sec after "Connecting" without any errors.

And if I use .rdp file with all this options in it all works fine without mremoteng :(

Sorry for my poor english ;)

Shooshka avatar Oct 04 '18 10:10 Shooshka

@xlash You can try setting the Use Console Session property for that connection to True (or right click the session -> Connect with options -> Connect to console session). Beyond that I'm not entirely sure what could be causing that error.

@Shooshka does the mRemoteNG.log file show why the session was disconnected? https://github.com/mRemoteNG/mRemoteNG/wiki/Troubleshooting-and-Logging

sparerd avatar Oct 04 '18 13:10 sparerd

@sparerd Thanks!

xlash avatar Oct 04 '18 20:10 xlash

@xlash Is it working for you now?

sparerd avatar Oct 04 '18 20:10 sparerd

@Shooshka does the mRemoteNG.log file show why the session was disconnected? https://github.com/mRemoteNG/mRemoteNG/wiki/Troubleshooting-and-Logging

@sparerd

UTF8 checked, tsv://MS Terminal Services Plugin.1.1cdev\r\n in loadbalanceinfo:

Smth like: "Your computer cannot connect to the remote desktop, because broker/gw can't verify parameters of RDP file."

So I think problem in "signature:s:" section that persists in .rdp file but missing in mRemoteNG.

Shooshka avatar Oct 05 '18 04:10 Shooshka

No, got session denied (visually by RDS host). Investigating the delta.

xlash avatar Oct 10 '18 13:10 xlash

I see the TLS negotiation successfull, I'm able to authenticate using Windows (NTLM?), but then, it silently closes without notification. In the network capture, I see a TCP reset send by mRemoteNG to the host.

xlash avatar Oct 10 '18 13:10 xlash

@sparerd Any updates/news on connections with "signature"?

Shooshka avatar Dec 07 '18 04:12 Shooshka

Hello. Could you confirm if mRemoteNG will be able to manage "signature" in next releases ? Thanks.

tiboudchik avatar Mar 08 '19 08:03 tiboudchik

Got only once connect by mRemoteNG with loadbalanceinfo in version 1.77. But it was only once. Cannot reproduce this now and it's sad.

7OH avatar Sep 09 '19 06:09 7OH

Same issue here I'm afraid. Exactly as the others said. Tried latest nightly build and it errors whether or not the UTF8 option is ticked.

AdamPD avatar Aug 23 '22 06:08 AdamPD

Hi, I have the same issue in the lastest nightly build (1.77.3 build: 1784) Here's what the log says : "Your computer cannot connect to the remote computer because the Broker service can't verify the specified settings in the RDP file." Is there any news about it ?

Xyllac avatar May 10 '24 12:05 Xyllac