Skip to main content
There are many ways to provision a Windows VM for automation. At Cyberdesk, we’ve tested dozens of configurations and found most have critical flaws—unexpected restarts, session disconnects, or inconsistent resolutions. This guide shows you the most reliable setup we’ve found.

Why This Matters

The ideal Windows automation environment must:
  • Stay active without an RDP session
  • Maintain consistent resolution at 1024x768 (optimal for computer use models)
  • Never restart unexpectedly or require manual intervention
If you or your client already has a Windows VM or physical machine, this guide will help you optimize it for reliable automation.

Setup Guide

1

Launch Windows Server 2022

You can use any cloud provider or virtualization platform. We recommend AWS EC2 for reliability.Configuration checklist:
  • Enable inbound port 3389 for RDP (only needed for initial setup)
  • Save your RDP credentials securely (you’ll only need them once)
  • Generate and save the access key pair
If you’re unfamiliar with AWS security groups or RDP configuration, ask ChatGPT: “How do I enable RDP access on AWS EC2 for Windows Server 2022?”
2

Connect via RDP

Use your RDP client to connect to the Windows Server. You’ll only need RDP for this initial configuration—RustDesk will replace it.
3

Install RustDesk

Copy this link into your Windows VM’s browser to download RustDesk:
https://github.com/rustdesk/rustdesk/releases/download/1.4.2/rustdesk-1.4.2-x86_64.msi
Once downloaded, run the installer to complete the installation.
If you have trouble with this download link, visit rustdesk.com to download the latest version of RustDesk.
4

Configure RustDesk security

Launch RustDesk and configure a permanent password:
  1. Click the three dots menu in the left sidebar
  2. Navigate to the Security tab
  3. Click Unlock Security Settings (blue button)
  4. Scroll to Password section
  5. Select Use permanent password
  6. Enter a strong password and click Save RustDesk Settings
Save these credentials securely:
  • RustDesk ID (displayed on the home screen)
  • Permanent password (you just created)
Store these credentials in a password manager. You’ll need them to connect from your local machine.
5

Install RustDesk locally

On your local machine (laptop/desktop):
  1. Download RustDesk from rustdesk.com
  2. Install and launch the application
  3. Enter the ID and password from Step 4
  4. Click Connect
When prompted to select a Windows session, choose the Console session.Optional - Better viewing experience:
  • Click the Display icon in the RustDesk toolbar
  • Select Scale adaptive
  • This scales the remote display to fill your local monitor for easier viewing
The Console session is the main desktop session. This is critical for automation to work correctly.
6

Disconnect RDP and set resolution

You can now close the RDP connection permanently. Continue using RustDesk:
  1. In the RustDesk toolbar, click the Display icon
  2. Hover over Resolution
  3. Select 1024x768 RustDesk Resolution Settings
This resolution is optimal for computer vision models and provides consistent behavior across different screen sizes.
7

Install and configure Cyberdriver

Follow the Cyberdriver Installation Guide to set up desktop automation.Important recommendations:
  • Use the --keepalive flag to prevent Windows from locking due to inactivity
  • Run Cyberdriver as Administrator if you need to automate applications that require elevated privileges
Example:
cyberdriver join --secret YOUR_API_KEY --keepalive
The keepalive mode ensures Windows doesn’t automatically lock and return to the login screen, which would interrupt automation.
8

Close RustDesk (on your local machine)

You can now close the RustDesk connection on your local machine (Mac/PC).Important: Leave RustDesk running on the Windows VM—it helps keep the console display active for automation.Whenever you need manual access, simply open RustDesk on your local machine and reconnect using your saved credentials.
9

Force resolution to 1024×768 via Cyberdesk

Navigate to the Desktops page in your Cyberdesk Dashboard.
  1. Click on your Windows VM to open the desktop details page
  2. Click the Tools button
  3. Scroll to the Set Resolution to 1024×768 section
  4. Click Set to 1024×768 Force Resolution via Cyberdesk
This ensures the console session maintains 1024×768 resolution even when you’re not actively connected via RustDesk—critical for reliable automation.
This step uses Cyberdriver to remotely execute a PowerShell command that sets the display resolution. Make sure Cyberdriver is running and connected.
10

Verify and finish setup

While still in the Cyberdesk Dashboard:
  1. Rename your desktop to something descriptive (e.g., “Production Windows Server” or “Client-ABC VM”)
  2. Verify the resolution shows 1024×768 in the desktop details
  3. Create a test run to confirm everything works
Your Windows environment should now:
  • ✅ Stay active without RDP connection
  • ✅ Maintain persistent 1024×768 resolution
  • ✅ Handle automation runs reliably

Troubleshooting

Windows keeps locking

If Windows returns to the login screen despite using --keepalive:
  • Verify Cyberdriver is running with the --keepalive flag
  • Check that no Group Policy is forcing screen locks
  • Check Windows power settings to ensure the display doesn’t turn off or the system doesn’t sleep

RustDesk not connecting to Windows VM

If your local RustDesk app (on your laptop/PC) won’t connect to the Windows VM, restart the RustDesk service on the Windows VM:
  1. RDP into the Windows VM
  2. Open the RustDesk application on the Windows VM
  3. Click the three dots (⋮) menu → Settings
  4. Click Stop Service
  5. Close and reopen RustDesk on the Windows VM
  6. Click Start Service at the bottom of the window
  7. Try connecting again from your local RustDesk app
This resets the RustDesk service and often resolves connection issues. If the problem persists, restart the entire Windows VM via RDP, or via your cloud provider’s console, and try connecting again.

RustDesk connected but shows black screen

If RustDesk connects successfully but you only see a black screen, this is often a network/firewall issue. Common cause: Public WiFi networks (coffee shops, libraries, coworking spaces) often have strict firewalls that block video streaming traffic from RustDesk. Solution: Switch your network connection:
  • Use a mobile hotspot from your phone
  • Connect to your home WiFi
  • Use a different network without restrictive firewalls
The Cyberdesk team has encountered this exact issue multiple times, and changing WiFi networks has always resolved it.
If you’re still experiencing issues, reach out to the team at founders@cyberdesk.io - we’re happy to debug with you on a call.

RustDesk connection drops

If RustDesk frequently disconnects:
  • Check internet stability on both machines
  • Verify no firewall is blocking RustDesk traffic
  • Try using a custom RustDesk relay server for better stability

Automation runs fail

If workflows aren’t executing correctly:
  • Confirm Cyberdriver is running (check the Desktops page)
  • Verify the resolution is exactly 1024x768
  • Check that no Windows updates are pending restart

Clicks failing but typing works

If Cyberdriver can type but mouse clicks aren’t registering, this is often a virtual display initialization issue on certain Windows configurations. Fix: Add a second virtual display in RustDesk (even though you won’t use it):
  1. Connect to the Windows VM via RustDesk
  2. Click the Display icon in the toolbar
  3. Click Virtual display
  4. Click the + button to add a second virtual display
  5. Stay on Display 1 (don’t switch to Display 2)
  6. Disconnect from RustDesk
Add RustDesk Virtual Display The presence of a second virtual display appears to properly initialize Windows’ input routing system. You’ll remain on the first display for automation, but having the second display present resolves the click issue.
This is likely related to how Windows handles mouse input when virtual display drivers are first initialized. Having multiple displays forces Windows to properly route input events to the virtual display adapter.

Need Help?

If you encounter issues or need assistance optimizing your setup, reach out to the Cyberdesk team at founders@cyberdesk.io. We’re happy to hop on a call and get you unblocked.

Next Steps

I