How to Keep a Remote Desktop or Windows App Session From Disconnecting on Mac
Updated · by the ProMacTools team
Why sessions disconnect
Windows servers and Azure Virtual Desktop apply session limits such as "disconnect after N minutes of inactivity" and the screen lock timeout. They measure input received inside the remote session.
caffeinate or Amphetamine keep the Mac from sleeping, which prevents the connection from dropping because your Mac slept — but the remote computer still sees no input.
Fix 1: change the policy (if you control the server)
Adjust the Remote Desktop Services session time limits in Group Policy or the host pool settings, and the screen saver / lock timeout inside the remote Windows session.
Fix 2: send input from your Mac with AutoKey
- Open AutoKey and choose Windows App (or Microsoft Remote Desktop) as the target app.
- Pick Shift or F15 and an interval shorter than the timeout, for example every 4 minutes.
- Keep "wait until I stop typing" on, and click Start.
AutoKey brings the remote window forward for a moment, presses the key and returns you to what you were doing.
Check your organisation's rules
Idle timeouts are often a security requirement. If the remote machine belongs to your employer, make sure keeping sessions alive is allowed.