Use VNC and RDP
Introduction
This article describes how to enable remote graphical sharing via VNC (Virtual Network Computing) or RDP (Remote Desktop Protocol) on Torizon OS modules. You can use this feature for testing and debugging your GUI application during the development phase. After running a Weston Container, you can remotely display your Graphical User Interface and transmit keyboard and mouse events.
If you look for the official Torizon feature that enables secure maintenance and troubleshooting of remote devices, see Remote Access.
Enabling VNC or RDP on Weston will significantly slow down your application, even when the remote session is inactive. Additionally, due to security reasons, it is not recommended to enable VNC or RDP in production. To troubleshoot applications with built-in security, enable Remote Access on your device before following the steps in this guide.
This article complies with the Typographic Conventions for Torizon Documentation.
Prerequisites
- A device running a graphical application using the Wayland graphic stack.
- Host computer connected to the same network as the remote device.
- Since both technologies use direct peer-to-peer communication, make sure your firewall does not block remote device access.
- Basic understanding of the Debian Containers for Torizon.
Server Setup
Headless Setup
If you plan to access the remote GUI without a connected display, you must force a display connector to enabled
via software.
Learn how to do it on Working with Weston on Torizon OS - Running graphical application without a display connected
Docker Run
When starting a Weston container with docker run, you only need to pass the environment variable of the desired protocol:
- VNC:
ENABLE_VNC=1
- RDP:
ENABLE_RDP=1
Depending on your module specifications, as the presence of a GPU, for example, the performance and required setup for Weston differ.
To enable VNC, run the following command. Make sure to select the correct command for your SoM.
Pull the latest torizon/weston
container image:
# docker pull torizon/weston:$CT_TAG_WESTON
Start the Weston container:
# docker run -d --rm --name=weston --net=host --env ENABLE_VNC=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
torizon/weston:$CT_TAG_WESTON --developer --tty=/dev/tty7
Pull the latest torizon/weston
container image:
# docker pull torizon/weston:$CT_TAG_WESTON
Start the Weston container:
# docker run -d --rm --ipc=host --name=weston --net=host --env ENABLE_VNC=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
torizon/weston:$CT_TAG_WESTON --developer \
--tty=/dev/tty7 -- --use-pixman
Pull the latest torizon/weston-imx8
container image:
# docker pull torizon/weston-imx8:$CT_TAG_WESTON
Start the weston
container:
# docker run -e ACCEPT_FSL_EULA=1 -d --rm --name=weston --net=host --env ENABLE_VNC=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 253:* rmw' \
torizon/weston-imx8:$CT_TAG_WESTON --developer \
--tty=/dev/tty7
VNC is not currently supported on Torizon 7.
To enable RDP, run the following command. Make sure to select the correct command for your SoM.
Pull the latest torizon/weston
container image:
# docker pull torizon/weston:$CT_TAG_WESTON
Start the Weston container:
# docker run -d --rm --name=weston --net=host --env ENABLE_RDP=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
torizon/weston:$CT_TAG_WESTON --developer --tty=/dev/tty7
Pull the latest torizon/weston
container image:
# docker pull torizon/weston:$CT_TAG_WESTON
Start the Weston container:
# docker run -d --rm --ipc=host --name=weston --net=host --env ENABLE_RDP=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
torizon/weston:$CT_TAG_WESTON --developer \
--tty=/dev/tty7 -- --use-pixman
Pull the latest torizon/weston-imx8
container image:
# docker pull torizon/weston-imx8:$CT_TAG_WESTON
Start the Weston container:
# docker run -e ACCEPT_FSL_EULA=1 -d --rm --name=weston --net=host --env ENABLE_RDP=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 253:* rmw' \
torizon/weston-imx8:$CT_TAG_WESTON --developer \
--tty=/dev/tty7
Pull the latest torizon/weston-am62
container image:
# docker pull torizon/weston-am62:$CT_TAG_WESTON
Start the Weston container:
# docker run -d --rm --name=weston --net=host --env ENABLE_RDP=1 --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ \
--device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' \
--device-cgroup-rule='c 226:* rmw' \
torizon/weston-am62:$CT_TAG_WESTON --developer --tty=/dev/tty7
Docker Compose
If you are using a Docker Compose file to manage multiple containers, enable VNC or RDP by passing an environment variable to the Weston container:
- VNC:
ENABLE_VNC=1
- RDP:
ENABLE_RDP=1
The following code snippet enables VNC on Weston (line 12):
version: "2.4"
services:
gui-application:
depends_on:
- weston
# Docker run options
weston:
image: torizon/weston-vivante:${CT_TAG_WESTON_VIVANTE}
network_mode: host
environment:
- ACCEPT_FSL_EULA=1
+ - ENABLE_VNC=1
volumes:
...
Client Setup
On the client-side, install your preferred remote control software and use your module's IP address to establish a connection.
In case you don't know how to find the board's IP address, see Scan your local network to find the board IP and MAC address.
VNC
By default, VNC uses port 5900.
VNC Viewer command:
$ vncviewer <IP_ADDRESS>::<PORT>
In case you are searching for a VNC Client:
- VNC Viewer (available for Windows, Linux and macOS)
- Vinagre (available for Linux)
- TigerVNC (available for Windows)
- VNC Viewer (available for Android)
RDP
By default, RDP uses port 3389.
FreeRDP command:
$ xfreerdp /v:<IP_ADDRESS>:<PORT> /sec:tls
In case you are searching for an RDP Client:
- FreeRDP (available for Windows, Linux and macOS)
- Parallels RDP Client (available for Windows, Linux and macOS)
- Remote Desktop client from Windows (available for Windows, Android, iOS, macOS)
Known Issues
Weston container VNC causes graphics to slow down: Enabling VNC significantly affects the performance of GUI applications. The exact severity of the slowdown depends on the UI framework and the overall graphic intensity.