DESK-MX9-L-TN-0003: Weston-rdp screen share

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box


200px-Emblem-important.svg.png

This application note has been validated using the kit version in the History table.


History
Issue Date Notes
2024/09/26 DESK-MX9-L 5.x.x


Introduction[edit | edit source]

Weston-RDP is an RDP backend allowing to run a Weston environment without needing specific graphic hardware, or input devices. Users can interact with weston only by connecting using the RDP protocol.

A useful FOSDEM presentation illustrates the main topics about the RDP protocol integration and Yocto guidelines for enabling weston to remotely share the screen

Yocto recipes[edit | edit source]

To enable the RDP protocol on Weston, a simple way is to add a bbappend to the the Weston recipe, i.e. meta-desk-mx/recipes-graphics/wayland/weston_%.bbappend:

EXTRA_OEMESON:append = " -Dbackend-rdp=true"

DEPENDS:append = " freerdp"

PACKAGECONFIG:append = "rdp"

and add the freerdp package to the dave-image-devel target image:

diff --git a/recipes-core/images/dave-image-devel.bbappend b/recipes-core/images/dave-image-devel.bbappend
index 03b74b6..9e87565 100644
--- a/recipes-core/images/dave-image-devel.bbappend
+++ b/recipes-core/images/dave-image-devel.bbappend
@@ -16,6 +16,12 @@ IMAGE_FEATURES += " \
        hwcodecs \
 "
 
+# add freerdp
+
+IMAGE_INSTALL += " \
+       freerdp \
+"
+
 # add meta-desk packages
 
 IMAGE_INSTALL += " \

Weston in the target[edit | edit source]

Weston has to be aware of the screen share enabling during the service activation: both systems service file and the configuration file have to be properly modified using the following description.

weston.service[edit | edit source]

The systems weston service (i.e. /lib/systemd/system/weston.service) should be modified adding the screen-share.so module loading at the service activation:

[Service]
# Requires systemd-notify.so Weston plugin.
Type=notify
EnvironmentFile=/etc/default/weston
ExecStart=/usr/bin/weston --log=${XDG_RUNTIME_DIR}/weston.log --modules=systemd-notify.so,screen-share.so

weston.ini[edit | edit source]

In the same way, the configuration file (i.e. /etc/xdg/weston/weston.ini) should be modified for enabling the rdp-backend.so backend module with the proper TLS certificate and key:

[screen-share]
command=/usr/bin/weston --backend=rdp-backend.so --rdp-tls-cert=/etc/freerdp/keys/desk-mx93-rev1.crt --rdp-tls-key=/etc/freerdp/keys/desk-mx93-rev1.key --shell=fullscreen-shell.so --no-clients-resize --socket=wayland-1 --width=800 --height=480

The --width=800 --height=480 lets the client to properly configure the receiving window.

In the same [screen-share] section, adding the following line:

start-on-startup=true

will enable the backend to be started properly at the weston activation.

Before start the RDP protocol, the keys have to be created in the configured directory:

root@desk-mx93-rev1:~# mkdir -p /etc/freerdp/keys
root@desk-mx93-rev1:~# winpr-makecert -rdp -path /etc/freerdp/keys/

Usage example[edit | edit source]

On a Windows PC it is possible to start the Remote Desktop connections application: it is enough to set the AURA Evaluation Kit IP address to start the remote screen share:

Windows 11 Remote Desktop connection