Common issues with local desktop rendering
This article explains how to solve common issues when using the Local mode for Desktop Rendering.
Configure console session resolution
This section explains how to set and verify the default resolution on an ECS instance.
Set default resolution in the registry
This is an optional solution and may not work in all scenarios.
Press
Win+Ror open acommand line tool, and then enterregedit.In the Windows registry, navigate to the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\MSBDD_NOEDID_1234_1111_00000000_00020000_00^E3701873EC28AFCFF631E725354CDC2D\00

The default values for PrimSurfSize.cx and PrimSurfSize.cy are 1024 and 768.
For example, to change the resolution to 1280x1024, set PrimSurfSize.cx to 1280 and PrimSurfSize.cy to 1024. Make sure to select Decimal when you modify the values, as shown in the following figure.

Verify console session resolution and scaling
You cannot directly view settings, such as resolution, for a process running in a Windows console session on a virtual machine. Use an RPA application to retrieve this information.
In code editing mode, use the following project code and publish it as an RPA application (for example, get_current_resolution_dpi).
from rpa.core import * from rpa.utils import * import rpa4 as rpa import win32gui import win32print import subprocess def start(): # Query the current session type r = subprocess.run("query user",capture_output=True,encoding="gbk") rpa.console.logger.info(r.stdout) # Query the current resolution and scaling horzres = win32print.GetDeviceCaps(win32gui.GetDC(0), 8) vertres = win32print.GetDeviceCaps(win32gui.GetDC(0), 10) dpi = win32print.GetDeviceCaps(win32gui.GetDC(0), 88) rpa.console.logger.info("Resolution:{}/{} DPI:{} Scale:{}%".format(horzres,vertres,dpi,round(dpi/96*100)))Install and log in to the client on the virtual machine, and ensure the client is available for scheduling.
In the console, navigate to Client > Robot Monitoring and set Desktop Rendering to Local for the robot. For more information, see Local.
In the console, navigate to Client > Scheduled Task Management > Timed Tasks, create a timed task with the following key settings:
Parameter
Setting
Application to run
Select get_current_resolution_dpi.
Robot
Select the robot and enable "Desktop Rendering", as shown in the figure.

Schedule
Select "Run immediately".
After the task is complete, view the resolution and scaling of the console session in the task's run log.

Set permissions for console session switching
We recommend running the robot as an administrator user. If you do so, you can skip this section.
This section explains how to configure permissions and troubleshoot issues for non-administrator users.
Set Windows user permissions
Check the current Windows user.
Press
Win+Ror open acommand line tool, and then entercompmgmt.msc.In the left navigation pane, expand System Tools > Local Users and Groups > Groups.
Double-click
Administratorsor right-click it and select Properties. In the window that appears, verify that the current Windows user is in the member list.
If the current Windows user is not in the
Administratorsgroup, you must add the user.ImportantAn
administrator usermust perform this step.Press
Win+Ror open acommand line tool, and then entercompmgmt.msc.In the left navigation pane, navigate to System Tools > Local Users and Groups > Groups. Double-click
Administratorsor right-click it and select Properties. In the window that appears, add the intended user.
Set registry information.
ImportantAn
administrator usermust perform this step.Press
Win+Ror open acommand line tool, and then enterregedit.Check the FilterAdministratorToken key at Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System and ensure its value is set to 0.
Disable the confirmation prompt for session switching.
ImportantAn
administrator usermust perform this step.Press
Win+Ror open acommand line tool, and then entercompmgmt.msc.In the left navigation pane, navigate to Local Policies > Security Options. Change the setting for "User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode" to "Elevate without prompting".

If the intended user is already logged in, you must log out and then log back in for the changes to take effect.
Troubleshoot session switching failures
console session switching failures are primarily caused by insufficient Windows user permissions. This section explains how to diagnose and resolve the issue.
Analyze the problem
First, confirm that your automation process requires desktop rendering. Then, verify that the process fails with errors like "control search timeout" when run unattended, for example, through a timed task or an API call.
In the console, on the Client > Robot Monitoring page, verify that the robot is not running in a console session. For more information, see Local.
Analyze the logs of the client. For instructions on how to find the logs, see Obtain all client logs. In the latest Robot.log file, if you find error messages similar to the following, it indicates a permission issue.
[Error] Execute tscon command failed: System.InvalidOperationException: Execute tscon command error: Cannot connect sessionID 2 to sessionname console, error code 5 Error[5]:Access is denied.[Warn] Switch to console failed: Cannot connect sessionID 2 to sessionname console, error code 5 Error[5]:Access is denied.[Info] Current user cannot do switch to console action directly.
Solution
For more information, see Set Windows user permissions.

