RDP

The Remote Desktop Protocol, which has a long and colorful history. I much prefer it over due to its vastly superior performance and extra features.

H.264/AVC Acceleration up to 60 fps (The Short Version)

On Windows 10/Server 2016 and above, you can enable nearly 60fps connections between clients using H.264, which considerably improves the user experience. To do that, on the server:

  1. Run gpedit.msc (Windows 10 Pro or above, although there are ways to enable it on Home)
  2. Go to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Remote Session Environment
  3. Enable Prioritize H.264/AVC 444 Graphics mode for Remote Desktop
  4. Enable Configure H.264/AVC hardware encoding for Remote Desktop
  5. If your machine has a discrete GPU, enable also Use hardware graphics adapters for all Remote Desktop Services sessions
  6. Run gpupdate /force
  7. Create a DWMFRAMEINTERVAL DWORD (32-bit) under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations with the value 15 (decimal) to set fps to 60.

Modern versions of support this as GFX AVC 444, although the results will greatly vary depending on the client.

The Long Version

This is a more detailed version of the above which I gleaned from various sources when I needed to re-tune a server and had to re-do the whole thing.

If you intend to use UDP, make sure you can receive traffic on port 3391.

Server Policy Changes

Run gpedit.msc and configure these settings, using gpupdate /force in an admin prompt afterwards:

Computer Configuration:
  Administrative Templates:
    Windows Components:
      Remote Desktop Services:
        Remote Desktop Session Host:
          Connections:
            - Select RDP Transfer Protocols = Enabled, Use both UDP and TCP
          Device and Resource Redirection:
            - Do not allow supported Plug and Play device redirection = Disabled
          Remote Session Environment:
            - Configure compression for Remote FX data = Enabled, Do not use an RDP compression algorithm
            - Configure H.264/AVC Hardware encoding for Remote Desktop Connections = Enabled,  Prefer AVC hardware encoding = Always attempt
            - Configure image quality for RemoteFX Adaptive Graphics = Enabled, High
            - Configure Remote FX Adaptive Graphics = Enabled, Optimize for server scalability
            - Enable RemoteFX encoding for RemoteFX clients designed for Windows Server 2008 R2 SP1 = Enabled
            - Prioritize H.264/AVC 444 graphics mode for Remote Desktop Connections = Enabled
            - Remote FX Adaptive Graphics = Enabled
            - Use hardware graphics adapters for all Remote Desktop Services sessions = Enabled
            - Use WDDM graphics display driver for Remote Desktop Connections = Disabled
            Remote FX for Windows Server 2008 R2:
              - Configure Remote FX = Enabled
              - Optimize visual experience when using Remote FX = Enabled, Highest (Best Quality) for both Screen Capture Rate and Screen Image Quality
              - Optimize visual experience for remote desktop sessions = Enabled, Rich Multimedia

Server Registry Changes

Save this out to a .reg file, edit to taste, import and reboot.

Windows Registry Editor Version 5.00

;Sets 60 FPS limit on RDP.
;Source: https://support.microsoft.com/en-us/help/2885213/frame-rate-is-limited-to-30-fps-in-windows-8-and-windows-server-2012-r
;YMMV, since policies also have an impact on this
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations]
"DWMFRAMEINTERVAL"=dword:0000000f

;Increase Windows Responsiveness
;Source:https://www.reddit.com/r/killerinstinct/comments/4fcdhy/an_excellent_guide_to_optimizing_your_windows_10/
;Not really sure how much this helps in Windows 11
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile]
"SystemResponsiveness"=dword:00000000

;Sets the flow control for Display vs Channel Bandwidth (aka RemoteFX devices, including controllers.)
;May not be very useful if your client negotiates other protocols.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermDD]
"FlowControlDisable"=dword:00000001
"FlowControlDisplayBandwidth"=dword:0000010
"FlowControlChannelBandwidth"=dword:0000090
"FlowControlChargePostCompression"=dword:00000000

;Removes the artificial latency delay for RDP.
;Again, not sure how much this helps in Windows 11
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"InteractiveDelay"=dword:00000000

;Disable Windows Network Throttling.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
"DisableBandwidthThrottling"=dword:00000001

;Enable large MTU packets. Might cause some issues over VPNs, so if things start acting funny, revert this.
"DisableLargeMtu"=dword:00000000

;Disables WDDM Drivers and goes back to legacy XDDM drivers (theoretically better for performance on NVIDIA cards, you might want to change this setting for AMD cards.)
;Of dubious effect in Windows 11 given policy settings.
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"EnableWddmDriver"=dword:00000000

Also, if you have a dual GPU system, open the NVIDIA control panel and set it as the preferred graphics processor (Windows 11 has somewhat deprecated this, but it worked for me).

Client Policy Changes

If you need to share USB devices (including webcams, although those rely on your client having UVC pass-through support), do this:

Run gpedit.msc and configure these settings, using gpupdate /force in an admin prompt afterwards:

Computer Configuration:
  Administrative Templates:
    Windows Components:
      Remote Desktop Services:
        Remote Desktop Connection Client:
          RemoteFX USB Device Redirection:
            - Allow RDP redirection of other supported RemoteFX USB devices from this computer = Enabled, Users and Administrators

gpupdate /force

Mac Client .rdp tweaks

Since the official Mac Remote Desktop clients lack a lot of settings, I’ve found that these may help for LAN connections in some regards:

networkautodetect:i:0
connection type:i:6
videoplaybackmode:1

However, Jump Desktop tends to do a better job connecting to xrdp in Mac OS. On iOS, the official RD Client is often better.

Fixing The Black Square Cursor when connecting to xrdp

Add this to /etc/xrdp/xrdp.ini as a workaround:

new_cursors=false

Other Resources

  • IronRDP, a Rust-based RDP client with RFX support
  • Duo, a multi-seat solution that uses RdpWrap and to enable remote gaming.
  • Thincast Client, a cross-platform RDP client that supports GPU acceleration and ARM64.
  • RemoteApp Tool, for managing application access
  • Rustdesk, a new cross-platform client
  • , my favorite client around 2009 or so
  • rdpwrap, a library wrapper to enable multiple connections on multiple Windows versions
  • FreeRDP, the currently best maintained OSS implementation, which includes a DirectFB client
  • rdesktop, the old classic
  • X11RDP-o-Matic, an automated installer to set up a native RDP server
  • Guacamole, a gateway for HTML5 clients
  • FreeRDP WebConnect, a C++ gateway for HTML5 clients
  • rdpy, a set of tools to access RDP servers

This page is referenced in: