When I close the RDP then the remote system (virtual, cloud) "loses" the screen input.

Achiad Saar 1 Reputation point
2022-01-26T15:57:12.72+00:00

Hello everyone,

I connect to a virtual Windows Server 2019 (desktop experience) on the Google Cloud Platform, but I ran into similar issues in Azure and AWS.

My windows instance runs a user interface that is updated in real time by data from the web.

Also, it runs a script that monitors this data and operates the mouse and keyboard as the data changes, to simulate human activity and enter feedback in response.

In other words, there is a script that "looks" at the screen and performs actions according to what is happening on it.

Everything works great, but when I minimize or completely close the RDP window on my end (my office) then the script on the VM stops receiving visual input, meaning it stops "seeing" the elements on the screen of the remote desktop, then it does not respond at all, let alone able to operate the interface to enter the feedback ( I am using Windows built-in remote desktop connections., I tried to connect with freeRDP without success).

I need to allow the script to continue running according to the input from the screen even when my RDP window is closed. The script runs on the cloud virtual machine itself (it's an .exe file stored on the VM's virtual HDD), so it's independant from my system.

I turned to Google support, who stated in advance that they could not help much because it was beyond their capabilities, and indeed failed to help me get a solution to my need, but suggested that I turn to Microsoft with the same question, and that if there is a solution, the solution will only be provided by Microsoft.

When I run the same script on a local virtual machine on my PC (in this case Windows 10 as a guest system, on top of Windows 11 as the host), there is no problem closing the RDP window and the script continues to work normally.

What should I do to enable the same behaviour on the Google Cloud Platform running Windows Server 2019?

Essentially, what I would like is for the script to operate completely independant from my system, and imitate a human in performing actions (keyboard, mouse) on the on-screen UI.

Thanks in advance for your time :-)

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,480 questions
Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,260 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,391 Reputation points
    2022-01-28T08:54:54.647+00:00

    Hello AchiadSaar,

    This is likely due to the interactive session logon. Please try the next:

    From the local policies
    Browse to Computer Configuration --> Administrative Templates --> Windows Components --> Remote Desktop Services --> Remote Desktop Session Host --> Session Time Limits.

    Enable the "Set time limit for disconnected sessions" and set it to Never

    and change the Local Security Policy under Local Policies->Security Options-> Interactive logon: Do not require CTRL+ALT+Del" to Enabled, the problem disappears.

    There is also a "cloud" component, that may be because some cloud resources are disabled when there is no interactive session logged. In that case I am afraid that is something cloasely related to the infraestructure of the cloud provider, as well the cloud VM model and pre-setting.


    --If the reply is helpful, please Upvote and Accept as answer--


  2. robin breed 1 Reputation point
    2022-08-22T09:10:04.487+00:00

    Hi AchiadSaar,

    Did you find a solution to your problem? I am having the exact same issue / limitation as you are experiencing, with all VM machines using windows so far. Please let me know if you fixed it, thank you.

    0 comments No comments