Access and control the graphical desktop environment through VNC (Virtual Network Computing). VNC provides remote desktop access to your sandbox, allowing you to see and interact with GUI applications.Documentation Index
Fetch the complete documentation index at: https://docs.hopx.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have:- Desktop template - A sandbox created from a template with desktop support (e.g.,
desktoptemplate) - Active sandbox - A running sandbox (see Creating Sandboxes)
- VNC client - A VNC viewer application (optional, for manual access)
Overview
VNC server enables:- Remote desktop access to sandbox GUI
- Visual debugging of GUI applications
- Interactive testing of desktop software
- Screen sharing and collaboration
Desktop automation requires a template with desktop support. Templates like
desktop or custom templates with X11/VNC dependencies are required.Starting VNC Server
Start a VNC server to enable remote desktop access:- Python
- JavaScript
VNC Server with Password
Start VNC server with a password for security:- Python
- JavaScript
Getting VNC Status
Check if VNC server is running and get connection details:- Python
- JavaScript
Getting VNC URL
Get just the VNC URL string (convenience method):- Python
- JavaScript
Stopping VNC Server
Stop the VNC server:- Python
- JavaScript
Connecting to VNC
Once VNC is started, connect using a VNC client:-
Get the VNC URL from
vnc_info.urlorget_vnc_url() -
Use a VNC client such as:
- TigerVNC Viewer (Windows, macOS, Linux)
- RealVNC Viewer (Windows, macOS, Linux)
- Remmina (Linux)
- Built-in Screen Sharing (macOS)
-
Connect using the URL (e.g.,
vnc://sandbox-id.region.hopx.dev:5901)
VNC Display Numbers
VNC servers use display numbers (e.g.,:1, :2). The default is display 1:
- Python
- JavaScript
Complete Example
Complete workflow for VNC access:- Python
- JavaScript
Troubleshooting
VNC Not Available
If VNC methods raiseDesktopNotAvailableError, your template may be missing required dependencies:
Connection Issues
- Check VNC status: Verify server is running with
get_vnc_status() - Verify URL: Ensure you’re using the correct VNC URL
- Firewall: Check if ports are accessible
- Password: If using password, ensure it’s correct
Display Issues
- Multiple displays: Use different display numbers for multiple VNC sessions
- Resolution: Set display resolution before starting VNC (see Display Management)
Related
- Mouse Control - Control mouse input
- CLI Reference - Command-line interface for HopX
- Keyboard Control - Control keyboard input
- Screenshots - Capture screenshots
- Display Management - Configure display settings
- SDK: sandbox.desktop.start_vnc() - Python SDK method
Next Steps
- Learn about Mouse Control to interact with GUI
- Explore Keyboard Control for text input
- Review Screenshots for visual verification

