This guide covers setting up Windows VMs on your own machine using Hyper-V. Great for development and testing.
Overview
For local testing, you can run multiple Windows 11 VMs using Hyper-V. This gives you full control over your automation environment.Windows Sandbox only allows one instance at a time. For parallel testing, use Hyper-V VMs instead.
Prerequisites
- OS: Windows 11 Pro/Enterprise/Education (Hyper-V not available on Home)
- RAM: 16GB+ recommended (4GB per VM + host overhead)
- CPU: SLAT support (most modern CPUs)
Step 1: Enable Hyper-V
Run in elevated PowerShell:Step 2: Download Windows 11 ISO
1
Get the ISO
Go to: Microsoft Evaluation Center
2
Download
Download the 64-bit ISO (90-day evaluation, free)
3
Save
Save to
C:\ISOs\Win11Enterprise.isoStep 3: Create Virtual Switch
In Hyper-V Manager → Virtual Switch Manager → New virtual network switch:
This gives VMs internet access and makes them reachable from host.
Step 4: Create Base VM
In Hyper-V Manager → Action → New → Virtual Machine:
After creation, configure security:
- Right-click VM → Settings → Security
- Enable “Enable Trusted Platform Module”
- Secure Boot: Microsoft UEFI Certificate Authority
Step 5: Configure Base VM
After Windows installation, configure the VM.Create Local Account
Create a local admin account (e.g.,cua-agent with your password). Avoid Microsoft account for simpler automation.
Enable Remote Desktop
Set Static IP (Recommended)
- VM1:
192.168.1.101 - VM2:
192.168.1.102 - VM3:
192.168.1.103
Disable Windows Update (Optional)
Prevents surprise reboots during testing:Install Python 3.12
Download from python.org and install with “Add to PATH” checked.Install Driver Dependencies
Clone and Setup Driver
Create Checkpoint
In Hyper-V Manager:- Right-click VM → Checkpoint
- Name it
clean-base-with-driver
Step 6: Clone VMs
Export Base VM
- Shut down the base VM
- Right-click → Export
- Save to
C:\Hyper-V\Exports\
Import as Copies
- GUI
- PowerShell
- Action → Import Virtual Machine
- Select the exported folder
- Choose “Copy the virtual machine (create a new unique ID)”
- Select new storage location
Configure Each Clone
For each cloned VM:- Rename in Hyper-V Manager:
cua-local-01,cua-local-02, etc. - Start VM and change computer name
- Assign unique static IP
- Update
client_machine_idin driver config (must be unique)
Step 7: Start VMs and Register Drivers
- Start all VMs in Hyper-V Manager
- In each VM, run the driver application
- Driver will auto-register with backend via WebSocket
- Verify machines appear in Driver Management
Step 8: Add RDP Credentials
For each registered VM, update RDP credentials so the agent can connect:Quick Reference Commands
Resource Planning
Troubleshooting
Architecture Notes
The local Hyper-V setup integrates with the existing backend architecture:- Driver Registration: Driver connects via WebSocket and calls
register_or_update_driver_machine()automatically - RDP Credentials: Stored in MongoDB, retrieved by agent via
get_rdp_credentials() - Job Execution: Backend dispatches jobs to VMs via the same job queue system
- No Backend Changes Required: The architecture is VM-agnostic; local Hyper-V VMs work identically to cloud VMs