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 using Cyberdriver’s built-in virtual display driver.

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.
Administrator Privileges RequiredThis setup requires Windows administrator credentials. You may need to request these from your IT department or client before proceeding. The setup process will prompt for UAC elevation.

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 for initial setup)
  • Save your RDP credentials securely
  • 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 use RDP for this initial setup, then disconnect permanently once the virtual display is configured.
You’ll need Windows administrator credentials for this setup. If you don’t have them, request them from your IT department before proceeding.
3

Install and configure Cyberdriver with persistent display

In your Windows VM, open PowerShell and install Cyberdriver:
# Create tool directory
$toolDir = "$env:USERPROFILE\.cyberdriver"
New-Item -ItemType Directory -Force -Path $toolDir

# Download cyberdriver
Invoke-WebRequest -Uri "https://github.com/cyberdesk-hq/cyberdriver/releases/download/v0.0.31/cyberdriver.exe" -OutFile "$toolDir\cyberdriver.exe"

# Add to PATH
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($userPath -notlike "*$toolDir*") {
    [Environment]::SetEnvironmentVariable("Path", $userPath + ";" + $toolDir, "User")
}
Restart PowerShell, then start Cyberdriver with all the necessary flags:
cyberdriver join --secret YOUR_API_KEY --keepalive --black-screen-recovery --add-persistent-display
What happens next:
  1. UAC prompt appears - Click “Yes” to grant administrator privileges (required for driver installation)
  2. Cyberdriver installs the Amyuni virtual display driver
  3. The virtual display is enabled and configured to 1024×768
  4. Windows may prompt for a reboot - Restart if asked
  5. Cyberdriver connects to Cyberdesk Cloud
Verify the driver installed:
  1. Press Windows key and search for “Device Manager”
  2. Expand “Display adapters”
  3. Look for “USB Mobile Monitor Virtual Display”
If you see it, the driver is installed correctly. If not, restart Windows and check again.
The virtual display driver is now permanently installed and will persist across reboots, even when Cyberdriver isn’t running. This is a one-time setup.
4

Disconnect RDP

You can now close the RDP connection permanently.Once disconnected, Cyberdriver will initially see a black screen (the terminated RDP session), but within 30 seconds, the --black-screen-recovery feature will automatically switch to the console session where the virtual display is active.
5

Verify virtual display is working

From your local machine, verify the setup is working:
  1. Navigate to the Desktops page in your Cyberdesk Dashboard
  2. Click on your Windows VM to open the desktop details page
  3. Click the Tools button in the top right
  4. Click Take Screenshot
What you should see:
  • Initially: May show a black screen
  • After 30 seconds: The Windows desktop should appear in the screenshot
This confirms that:
  • ✅ The virtual display is active
  • ✅ Black screen recovery successfully switched to the console session
  • ✅ Cyberdriver can now see and control the desktop without RDP
The 30-second delay is the black screen recovery check interval. The first time it runs, it detects the black screen and switches to the console session automatically.
6

Finish setup

Your Windows VM is now fully configured for automation:
  1. In the Cyberdesk Dashboard, rename your desktop to something descriptive (e.g., “Production Windows Server”)
  2. Verify the screenshot shows the Windows desktop (not a black screen)
  3. Create a test workflow to confirm everything works
Your environment now:
  • ✅ Has a persistent virtual display at 1024×768
  • ✅ Automatically recovers from black screens
  • ✅ Stays active with keepalive mode
  • ✅ Works completely without RDP or RustDesk
If you need to RDP in later:
  • Cyberdriver will switch to viewing the RDP session (you may want to disable Cyberdriver while working manually)
  • When you disconnect RDP, Cyberdriver will automatically switch back to the console session within 30 seconds
  • Everything continues working seamlessly

Fallback: RustDesk-Based Setup

If the virtual display driver doesn’t work well on your system—for example, if the resolution is stuck at 800×600 or you experience display issues—you can use RustDesk as an alternative. This approach trades additional dependencies for easier manual desktop access.
Only use this method if the primary setup (virtual display driver) doesn’t work for your environment. RustDesk adds an additional service dependency and potential security surface.
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

Optional: Stop RustDesk service for security

Once everything is set up and working, you can optionally stop the RustDesk service on the Windows VM for maximum security:
  1. Connect via RustDesk one last time
  2. Open RustDesk on the Windows VM
  3. Click the three dots menu → Settings
  4. Click Stop Service
  5. Close RustDesk
What this means:
  • ✅ Automation will continue working perfectly
  • ✅ One less service running on the VM
  • ✅ No remote desktop access possible (more secure)
  • ⚠️ You’ll need RDP to access the VM if you need to restart RustDesk later
Important: If you stop RustDesk and later use RDP to access the machine, make sure to run Cyberdriver with the --black-screen-recovery flag. Every time you close an RDP connection, Cyberdriver will see a black screen unless it switches to the console session (which --black-screen-recovery handles automatically).
cyberdriver join --secret YOUR_API_KEY --keepalive --black-screen-recovery
Only stop RustDesk if you’re confident in your setup and comfortable using RDP for manual access. Most users prefer to keep RustDesk running for easier troubleshooting.
10

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.
11

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

Cyberdriver sees black screen after opening and closing RDP connection

If Cyberdriver shows a black screen or stops working after you connect and disconnect via RDP, this is because RDP sessions don’t automatically switch to the console session when they close. Solution: Use the --black-screen-recovery flag when running Cyberdriver:
cyberdriver join --secret YOUR_API_KEY --keepalive --black-screen-recovery
What this does:
  • Periodically checks for black screens (default: every 30 seconds)
  • When detected, waits 5 seconds to confirm it’s not a transient black screen
  • Automatically runs tscon to switch the session to console
  • This restores Cyberdriver’s ability to see the RustDesk display
Why this happens:
  • When you RDP into a Windows machine, it creates an RDP session
  • When you disconnect, Windows keeps that RDP session active
  • Cyberdriver gets “stuck” viewing the disconnected RDP session (which is black)
  • The console session (where RustDesk is active) is still running, but Cyberdriver can’t see it
  • Black screen recovery switches Cyberdriver back to the console session
Manual fix (if needed): You can also manually trigger the console switch from the Cyberdesk Dashboard:
  1. Go to your desktop’s details page
  2. Click the Tools button
  3. Click Fix Black Screen
This executes the same recovery command that --black-screen-recovery runs automatically.
Best practice: Always run Cyberdriver with --keepalive --black-screen-recovery on RDP-accessible machines. This combination ensures maximum uptime and automatic recovery from session issues.

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