HTML5 connection
Web browsers run an html5 javascript session, meaning that there always is an extra layer between the system and the html5 client, as by the web browser itself.
The html5 client uses the resolution that gets reported by the web browser and it sends farther to the session.
Therefore you get a resolution as it is from the browser, but not from the system itself.
In conclusion, no technical solution can be done to support a Retina or High DPI displays on our side, since it is dependent of the web browser's internal rendering engine.
MSTSC.exe connection
The idea is to create wo copies of Remote Desktop Client. One with scaling enabled, the other one without.
Create a copy of mstsc.exe (called mstsc2.exe) and disable HiDPI scaling for mstsc2.exe using AppCompatFlags.
Both executables can exist in parallel.
Whenever you want to RDP into a HiDPI-aware device (i.e. a Windows 10 system), you can use the regular mstsc.exe .
But if you want to connect to a legacy remote system that isn’t DPI aware and you want to enable scaling the remote hosts resolution up, you can do so by starting mstsc2.exe .
In an elevated (admin) cmd shell, create a copy of mstsc.exe and mstsc.exe.mui:
cd %systemroot%\system32 copy mstsc.exe mstsc2.exe cd %systemroot%\system32\en-us\ copy mstsc.exe.mui mstsc2.exe.mui
Please note, the en-us part corresponds to the installed language.
This might be different for you, for example en-gb or de-de.
Now, set an AppCompatFlag for all users for mstsc2.exe:
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /t REG_SZ /v "C:\Windows\System32\mstsc2.exe" /d "~ DPIUNAWARE" /f
When you now start mstsc2.exe and connect to the same legacy Windows 7 remote host, the scaling issues are gone:
Why do you need a mstsc2.exe copy?
Can’t I just disable HiDPI scaling for mstsc.exe?
No, because AppCompatFlags have no effect on executables that belong to the Windows installation.
Setting the above registry key for the original mstsc.exe has no effect.
(Also symlinking mstsc.exe to mstsc2.exe doesn’t work — AppCompatFlags are being applied based on the linked executable, not the link).
If you are experiencing a DPI issue, such as setting text and icons at 125% on client side and the cursor of the mouse doesn't match perfectly the click zone, you might want to change this:
On server side:
- Run regedit and follow this registry key : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations
- In WinStations registry key, create a DWORD (32-bit) value IgnoreClientDesktopScaleFactor
- Set this value to 1
- Reboot server
After this, during RDS connexion, you can set custom DPI, independently from local session.