Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.98k stars 535 forks source link

WebRDP - Not works in windows server agent #3938

Open Mfinadmin opened 2 years ago

Mfinadmin commented 2 years ago

Dear Ylian,

It seems latest WebRDP does not connect with Windows server PC's.

I have tried the same in windows server 2012 & windows server 2019 standard versions.

Ylianst commented 2 years ago

So you tried on regular Windows editions and it works, but fails only on server versions?

Mfinadmin commented 2 years ago

So you tried on regular Windows editions and it works, but fails only on server versions?

Yes, Its working fine in regular windows ( except Servers)

Otsegox commented 2 years ago

I tested on 2008 R2 (I know)... 2012 R2, and 2019. Works on 2019 and 2012 R2. I am running Mesh version 1.0.17

PathfinderNetworks commented 2 years ago

I was testing this last night as well. I was only able to get it to work on one server (my own local server). All the other devices I tried this with just stop at 'Setup..." after you click connect. The one server I was able to get it to work with is running Server 2022. I tried connecting to a variety of Server 2012, 2016, and 2019 boxes as well as a few Windows 10 desktops. None of them would connect. Is there a way to view the connection/error logs for this connection?

Ylianst commented 2 years ago

I think there is an issue with connections on high latency connections. I am messing up my socket/tunnel setup. Working on this now.

JSuenram commented 2 years ago

Same here... just disconnects after entering credentials....

johann8 commented 2 years ago

For me Web-RDP works with MashCentral version 1.0.15 and 1.018. Tested with Windiws Server 2012 R2, 2016, 2019. MeshCentral runs in Docker container.

LPJon commented 2 years ago

I am not experiencing this at all

I do know that I have experienced this in the past with Microsofts built in tool "Remote Desktop Connection". This issue was related to the video driver being used on the server OS failing during the login process and was being reset by the OS. That caused the RDP session to drop. This issue could be related to that and the best way to test it is to install Microsofts generic display driver the re-attempt the login through RDP. If it works then it's your display driver that's causing the issue....if not then it might be a latency issue but it would have to be extremely high. This is especially an issue with certain versions of Windows 10 and Windows 10 based servers.

VINISHVV commented 2 years ago

@LPJon - this is not related to driver issues. Since we are able to access RDP sessions using meshcentral router.

PathfinderNetworks commented 2 years ago

I just did a bit more testing with this. On one system, a Server 2012 box, I was able to get past the 'Setup' phase and it says 'Connected, RDP'. However, the screen is black like it's not actually connected. Other devices, as mentioned, never get past the 'Setup....' phase.

LPJon commented 2 years ago

@LPJon - this is not related to driver issues. Since we are able to access RDP sessions using meshcentral router.

That to me sounds like a firewall issue. MC Router uses the local agent or a relay agent to establish the RDP connection. The Web-RDP interface also does the same thing but instead from the browser interface bypassing the setup that MC Router would normally do when setting up the connection.

@PathfinderNetworks I would sit at the blank screen for at least 10 minutes to see if the server is trying to play catch-up for the session. I have seen where they are extremely busy doing something else and the RDP session setup takes a back seat.

Once again I will iterate that 99% of the time....black screens are display driver issues. For the stuck at "Setup..." issue I'm willing to bet there is a firewall or third party software issue. It's also important to note that when using Meshcentral router you are using the "Remote Desktop Connection" tool from Microsoft. So I suppose there could be a setup issue there for Web-RDP but then why is it only affecting some Microsoft servers and not others.

PathfinderNetworks commented 2 years ago

This is definitely not a driver issue nor is it a firewall issue- as the connection is being routed by and through the Mesh agent. The same ports are being utilized by the Mesh agent for this RDP connection as they would be for the standard Mesh agent connections as well as the MeshRouter (but, if I'm wrong about that, Ylian can correct me). I know it's not a driver issue as I can RDP to these same servers via other means. One is even a Remote Desktop Services server that actively accepts multiple connections on a daily basis.

LPJon commented 2 years ago

What are the builds for MeshCentral, Meshcentral Agent, and Windows Server 2012?

LPJon commented 2 years ago

You should also know that Web-RDP also uses different display resolutions than the windows tool. Try setting the resolution on the Web-RDP interface to something standard like 1024x768. Display resolutions would affect this. the option is on the far right of the Desktop Tab under "Settings" then the tab "RDP".

Note that I am using MC version 1.0.18

PathfinderNetworks commented 2 years ago

So it seems to be hit or miss if the connection is made or not. For example, on the Server 2012 box I referenced in my earlier message where it said 'Connected' but with a blank screen. I then tried it multiple times. Some times it connects and shows the desktop. Other times it's just a blank screen. No changes made between connections. No changes made to resolution, drivers, firewall, etc. This particular server is behind a fiber connection so the latency between them and me is low (less than 20ms). All that said, the vast majority of the devices (be it desktops or servers) I try never get past the 'Setup' message. I suspect there are errors being logged just have no idea how to see them.

LPJon commented 2 years ago

I'm using this same system on Windows 10 Pro, Home, Windows Server 2012 R2, 2016, 2019 and have exactly no issues with any of them. This is across multiple clients from fiber connected all the way down to DSL. (I'm not stating that to be a smart #$@ it's just for information)

You can do tracing and logs at the server web interface by going to the "My Server" tab and selecting "Show Server Error Log" or by clicking on the "Trace" tab then selecting the "Tracing" button and selecting what points you want to trace and then attempt your connection then come back and review the "Tracing Log". The only other thing I can think of would be like ModSecurity or a Reverse Proxy config.

GauchoEsq commented 2 years ago

I tested on 2008 R2 (I know)... 2012 R2, and 2019. Works on 2019 and 2012 R2. I am running Mesh version 1.0.17

It's not working for me in 2008 R2 either but it seems to be because TLS 1.2 is not enabled by default. I tried to add registry keys to allow TLS 1.2 but it didn't work for me, though I didn't spend much more than about 10 minutes working on it.

Ylianst commented 2 years ago

Oh! If this is TLS 1.2 related, the problem will only happen on older versions of NodeJS. For anyone running into this issue, can you indicate that NodeJS version you are using?

If I get some data on this, I can add proper warnings & indications.

Mfinadmin commented 2 years ago

Oh! If this is TLS 1.2 related, the problem will only happen on older versions of NodeJS. For anyone running into this issue, can you indicate that NodeJS version you are using?

If I get some data on this, I can add proper warnings & indications.

Dear Ylian, I think its not related to TLS because we have tried with TLS update.

I am using latest version of node.

My Server Console Download console text

versions { "node": "18.0.0", "v8": "10.1.124.8-node.13", "uv": "1.43.0", "zlib": "1.2.11", "brotli": "1.0.9", "ares": "1.18.1", "modules": "108", "nghttp2": "1.47.0", "napi": "8", "llhttp": "6.0.4", "openssl": "3.0.2+quic", "cldr": "41.0", "icu": "71.1", "tz": "2022a", "unicode": "14.0", "ngtcp2": "0.1.0-DEV", "nghttp3": "0.1.0-DEV" }

Ylianst commented 2 years ago

Ok. Does not look like TLS. I need to try to replicate this.

Ylianst commented 2 years ago

I have been playing around with group policies in Windows 11 Pro to see if I can get RDP to fail. I also downgraded to NodeJS v10.0.0, but in all cases, RDP still works.

image

I tried on an older Windows Server and RDP worked, but may need to install a new version an see.

GauchoEsq commented 2 years ago

Oh! If this is TLS 1.2 related, the problem will only happen on older versions of NodeJS. For anyone running into this issue, can you indicate that NodeJS version you are using?

If I get some data on this, I can add proper warnings & indications.

Just to update my earlier observation - I updated from Nodejs 10 to 16. Previously, trying to connect through the Desktop tab with RDP Connect would immediately fail and the TLS error would appear in the Windows event log. Now, on Node 16, it sits on Setup for some time and eventually fails back to showing the Connect buttons. Nothing appears in the event log on the Windows machine now. I (sadly) have 2 Server 2008R2 machines and this behavior occurs on both. I'm not sure it's really worth your time to troubleshoot given that it works on Windows 2012, but I thought that I would report back.

As an aside, Mesh wouldn't start after I upgraded node using n. I updated the meshcentral service to point to the new node binary and I noticed that a large amount of modules (including meshcentral) were missing from the node_modules folder. I renamed it and reinstalled mesh and everything was fine again.

SpikeyDan commented 2 years ago

I am also getting this issue when connecting to Windows Server. I can help provide further information and testing if needed. Not sure if anyone has had success in fixing this yet. Latest version of Meshcentral (Ubuntu Server 20.04) and connecting to Server 2019. Thanks.