Skip to main content
Version: Torizon OS 7.x.y

VNC and RDP on Torizon OS

danger

VNC and RDP are not yet fully released on Torizon 7.

While it may work, it is not guaranteed. You may want to use this feature on Torizon 6 until it becomes available.

Introduction

Being able to remotely access an Embedded System's Graphical User Interface (GUI) is useful for a variety of reasons:

  • During development, to remotely debug the application when using a shared hardware resource with distributed team members
  • During production, to remotely support an end customer; providing remote access of the GUI to an end customer; being able to remotely control a device that has a GUI

This article describes how to enable remote graphical sharing via VNC (Virtual Network Computing) or RDP (Remote Desktop Protocol) on Torizon OS modules. When starting a Weston Container, you can remotely display your Graphical User Interface and transmit keyboard and mouse events.

Secure Remote GUI

Both the VNC and RDP protocols support authentication and encryption, although Weston's implementation of RDP doesn't implement it.

If you look for increased security, consider tunneling the VNC protocol through SSH with the ready-to-use and zero-conf Torizon Remote Access.

VNC or RDP?

VNC is the recommended method for Remote GUI on Torizon OS, whereas RDP is recommended only when VNC can't meet your use case.

Comparison:

  • Both protocols support authentication, but on Weston only VNC implements it
  • Both protocols have data streams encrypted with TLS
  • VNC is slightly less CPU intensive, because it doesn't compress the GUI stream
  • RDP uses less bandwidth than VNC, especially on GUIs that are heavily animated

Performance Considerations

Both protocols may introduce load on the system. On Torizon OS 6 and older, this was a known issue due to the implementation of VNC and RDP on Weston. On Torizon OS 7 onward, the efficiency has been greatly improved.

That said, you are encouraged to benchmark your use case with and without a Remote GUI, especially if your product has intensive graphics or high CPU usage overall. For static GUIs, often these protocols are smart enough so that the load is often low.

This article complies with the Typographic Conventions for Torizon Documentation.

Prerequisites

  • 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
warning

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

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.

tip

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:

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:

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.

Send Feedback!