VNC configuration
VNC is set up using the Dev Containers desktop-lite feature.Default settings
From.devcontainer/devcontainer.json:33-37:
- noVNC web port: 6080 (browser access)
- VNC port: 5901 (VNC client access)
- Password:
ros - Display:
:1
Port forwarding
Ports are automatically forwarded from.devcontainer/devcontainer.json:40-47:
http://localhost:6080 when the container starts.
Accessing the desktop
Method 1: Browser (noVNC) - Recommended
- Open your browser
- Navigate to:
http://localhost:6080 - Click Connect
- Enter password:
ros - You’ll see the Ubuntu desktop with any running GUI applications
noVNC works on any device with a web browser - no VNC client installation required. This includes tablets and phones.
Method 2: VNC client
For better performance, use a native VNC client:- Install a VNC client:
-
Connect to:
localhost:5901 -
Enter password:
ros
Changing VNC ports
If the default ports conflict with other services on your system.Changing the noVNC web port
Edit.devcontainer/devcontainer.json:
- Press
F1 - Select Dev Containers: Rebuild Container
http://localhost:6081
Changing the VNC port
Similarly, edit thevncPort value:
forwardPorts accordingly:
Changing the VNC password
Method 1: Rebuild with new password
Edit.devcontainer/devcontainer.json:
F1 → Dev Containers: Rebuild Container
Method 2: Change in running container
Inside the container:Display settings
The display variable is set indevcontainer.json:50:
Changing display resolution
The default resolution is determined by your browser window size with noVNC, or can be set manually with a VNC client. To change the default resolution, you can modify VNC server startup parameters:1920x1080- Full HD1280x720- HD1600x900- Laptop-friendly2560x1440- 2K
Troubleshooting
Cannot access noVNC at localhost:6080
Symptom: Browser shows “connection refused” or “can’t connect” Solution 1 - Check port forwarding:- In VS Code, open the Ports panel (View → Ports)
- Verify port 6080 is listed and forwarded
- If not, click Forward a Port and enter
6080
VNC shows black screen
Symptom: noVNC connects but shows only a black screen Solution:- Wait 30-90 seconds - the desktop can take time to initialize on first start
- Refresh your browser page
- Restart the VNC server:
Wrong password
Symptom: VNC rejects the password Solution: The default password isros (all lowercase). If changed, refer to the “Changing the VNC password” section above.
Port already in use
Symptom: “Port 6080 is already allocated” or “address already in use” Solution 1 - Find conflicting process: Windows (PowerShell):Display variable not set
Symptom: GUI apps show “cannot open display” error Solution:VNC performance is slow
Symptom: Laggy mouse, slow screen updates in browser Solutions:- Use native VNC client instead of noVNC - Browser-based VNC has more overhead
-
Lower display quality in noVNC:
- Click the settings icon in noVNC sidebar
- Adjust Quality slider (lower = faster)
- Enable “Compression level”
- Reduce display resolution - See “Changing display resolution” above
- Allocate more resources - See Container resources
GUI apps don’t appear in VNC
Symptom: Launch Gazebo but it doesn’t show in VNC desktop Solution:- Verify
DISPLAYis set: - Check if the process is running:
- Check for errors in the terminal where you launched the app
- Try launching from within the VNC desktop terminal instead
Advanced configuration
Disable auto-opening browser
Edit.devcontainer/devcontainer.json:42-47: