Using HAProxy with MS Remote Desktop

Remote Desktop Services, formerly Terminal Services, is a technology from Microsoft that allows users to access remotely to a session-based desktop, virtual machine-based desktop, or applications hosted in a data center from their corporate network or the internet.

Multiple RDS servers can be used in a farm, which need to be load-balanced. To achieve this purpose, there are different methods that you can use:

  • A connection broker
  • A load-balancer with the connection broker
  • A load-balancer without the connection broker

MS Terminal Services architecture is split into multiple components:

  • RDP client (can be mstst.exe, rdsktop, xfreerdp, etc.)
  • Windows Terminal servers
  • Connection brokers / Session Directory (optional) or a load-balancer
  • Terminal Server Gateway (for external access)

There are three main scenarios possible to load-balance terminal services: