SlideShare a Scribd company logo
1 of 27
Download to read offline
Screen Sharing on Raspberry Pi 5 Using VNC in
Weston and Wayland with the Yocto Project and
OpenEmbedded
Leon Anavi
Konsulko Group
leon.anavi@konsulko.com
leon@anavi.org
FOSDEM 2024
FOSDEM 2024, Leon Anavi
In Previous Episode
FOSDEM 2024, Leon Anavi
Agenda
 Wayland and Weston
 VNC
 Weston and the Yocto Project Releases
 core-image-weston with VNC demo on
Raspberry Pi 5
FOSDEM 2024, Leon Anavi
Wayland & Weston
 Wayland is a display protocol that specifies the communication between a display
server and its clients
 Started in 2008 with the aim to replace the X Window System in GNU/Linux and
Unix-based distributions
 Security by design through isolation of the input and output of every window
 Weston is the reference Wayland compositor, there are many other compositors
 Weston 13.0 was released on November 27, 2023
FOSDEM 2024, Leon Anavi
Remote Desktop Options in Weston and Wayland
 Remote Desktop Protocol (RDP)
 Virtual Network Computing (VNC)
FOSDEM 2024, Leon Anavi
Virtual Network Computing (VNC)
 Graphical desktop-sharing system based on Remote Frame Buffer protocol (RFB)
 Initially Olivetti Research Laboratory developed and published RFB in 1998, next
versions of the protocol were published by RealVNC Ltd
 Pixel based
 Works with all windowing systems and applications, including MS Windows, Mac
OS, X11 and Wayland
FOSDEM 2024, Leon Anavi
RDP vs VNC
RDP
(Remote Desktop Protocol)
VNC
(Virtual Network Computing)
Protocol ITU-T T.128 Remote Frame Buffer
protocol (RFB)
Type Semantic (aware of controls, fonts
and other graphical primitives)
Pixel based
Weston version 2.0 and newer 12.0 and newer
Weston support
since
2016 2022
FOSDEM 2024, Leon Anavi
VNC in Weston
FOSDEM 2024, Leon Anavi
 VNC in Weston
FOSDEM 2024, Leon Anavi
VNC in Weston
 VNC backend is available in Weston 12 and newer version
 VNC backend for Weston depends on NeatVNC
 NeatVNC is an open source VNC server library with a clean interface, started by
Andri Yngvason with code available at GitHub under ISC license
 NeatVNC has build dependencies on libdrm, meson and pkg-config
 NeatVNC has a runtime dependency on aml (Andri's Main Loop)
FOSDEM 2024, Leon Anavi
The Yocto Project
 Open source collaborative project of the Linux foundation for creating custom
Linux-based distributions for embedded devices using the OpenEmbedded Build
System
 OpenEmbedded Build System includes BitBake and OpenEmbedded Core
 Poky is a reference distribution of the Yocto Project provided as metadata, without
binary files, to bootstrap your own distribution for embedded devices
 Bi-annual release cycle
 Long term support (LTS) release covering two-year period
FOSDEM 2024, Leon Anavi
The Yocto Project Releases
Codename Version Release Date Support Level
Scarthgap 5.0 April 2024
Future – LTS (until
April 2028)
Nanbield 4.3 November 2023 Until May 2024
Kirkstone 4.0 May 2022 LTS (until Apr. 2026)
Dunfell 3.1 April 2020 LTS (until Apr. 2024)
FOSDEM 2024, Leon Anavi
Wayland and Weston in Yocto and OpenEmbedded
 OpenEmbedded-Core is a layer containing the core metadata for current versions
of OpenEmbedded
 OpenEmbedded-Core provides recipes for Wayland and Weston
FOSDEM 2024, Leon Anavi
The Yocto Project, Wayland and Weston Versions
Codename Version Wayland Weston
Scarthgap 5.0 1.22 (?) 13.0.0 (?)
Nanbield 4.3 1.22 12.0.2
Kirkstone 4.0 1.20 10.0.2
Dunfell 3.1 1.18 8.0.0
FOSDEM 2024, Leon Anavi
Bitbaking Weston with VNC
Extend the recipe for building Weston:
 Enable VNC backend:
PACKAGECONFIG:append = " vnc"
This will enable -Dbackend-vnc=true and add neatvnc (from layer meta-oe) as a
build dependency
 Place a PAM configuration file in the package:
FILES:${PN}:append = " ${sysconfdir}/pam.d/weston-remote-access"
 For example, weston_%.bbappend:
https://github.com/leon-anavi/meta-weston-remote-desktop/blob/main/meta-weston-vnc/recipes-graphics/
wayland/weston_%25.bbappend
FOSDEM 2024, Leon Anavi
aml and neatvnc in meta-oe
FOSDEM 2024, Leon Anavi
Bitbaking NeatVNC for Weston with VNC
 Enable TLS:
PACKAGECONFIG:append = " tls"
 libweston/backend-vnc/meson.build from Weston 12 and 13:
dep_neatvnc = dependency('neatvnc', version: ['>= 0.6.0', '< 0.7.0'], required: false, fallback: ['neatvnc', 'neatvnc_dep'])
 libweston/backend-vnc/meson.build from Weston branch main:
dep_neatvnc = dependency('neatvnc', version: ['>= 0.7.0', '< 0.8.0'], required: false, fallback: ['neatvnc', 'neatvnc_dep'])
 Select NeatVNC matching Weston requirements, for example:
PREFERRED_VERSION_neatvnc = "git"
FOSDEM 2024, Leon Anavi
weston-init.bbappend
 Set password weston (from mkpasswd -m sha256crypt) for user weston:
WESTONPASSWD = "$5$409x651F5vyY1.4o$Iuplll7/qNSEcflYNjH..0zwylmyLsbZdZGS6hBcro5"
USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G
video,input,render,wayland -p '${WESTONPASSWD}' weston"
 Create a directory on the target device to store TLS key and certificate:
do_install:append(){
install -m 0755 -d ${D}${sysconfdir}/vnc/keys/
chown weston:weston ${D}${sysconfdir}/vnc/keys/
}
FILES:${PN} += "
${sysconfdir}/vnc/keys 
"
FOSDEM 2024, Leon Anavi
TLS security
 Generate a key and certificate files to use with TLS security:
mkdir -p ~/.pki/CA/private/
cd ~/.pki/CA
openssl genrsa -out private/cakey.pem 2048
openssl req -new -x509 -nodes -days 365000 -key private/cakey.pem -out
cacert.pem
openssl genrsa -out tls.key 2048
openssl req -new -key tls.key -out tls.csr
openssl req -new -key tls.key -out tls.csr -subj "/CN=raspberrypi5"
openssl x509 -req -days 365 -in tls.csr -out tls.crt -CA cacert.pem -CAkey
private/cakey.pem
FOSDEM 2024, Leon Anavi
Using VNC on Weston
 Copy tls.crt and tls.key to /etc/vnc/keys on the target device, e.g. Raspberry Pi 5
 Enable VNC screen sharing in /etc/xdg/weston/weston.ini:
[screen-share]
command=/usr/bin/weston --backend=vnc-backend.so
--vnc-tls-cert=/etc/vnc/keys/tls.crt --vnc-tls-key=/etc/vnc/keys/tls.key --
shell=fullscreen-shell.so
 After loading Weston, press ctrl+alt+s to launch screen sharing
FOSDEM 2024, Leon Anavi
VNC Automatic Startup
 Launch Weston with screen-share.so, for example in Weston systemd service:
ExecStart=/usr/bin/weston --modules=systemd-notify.so,screen-share.so
 Add start-on-startup=true to section [screen-share] in weston.ini:
[screen-share]
command=/usr/bin/weston --backend=vnc-backend.so
--vnc-tls-cert=/etc/vnc/keys/tls.crt --vnc-tls-key=/etc/vnc/keys/tls.key --
shell=fullscreen-shell.so
start-on-startup=true
FOSDEM 2024, Leon Anavi
Remote Connection
 From another computer in the same network connect to the embedded device
using a VNC client, for example with vinagre, an open source remote desktop
viewer for Linux and the GNOME Desktop:
vinagre --gtk-vnc-debug
FOSDEM 2024, Leon Anavi
VNC Demo
 Vinagre on Ubuntu
22.04.3 LTS with X11 and
GNOME 42.9
 core-image-weston with
Weston version 12.0.2 on
Raspberry Pi 5 (using BSP
layer meta-raspberrypi)
FOSDEM 2024, Leon Anavi
VNC Frames per Second on Raspberry Pi 5
 With VNC enabled
weston-simple-egl
runs with up to 20fps
on Raspberry Pi 5
FOSDEM 2024, Leon Anavi
QA
 Raspberry Pi 5
 Raspberry Pi 4
 ROCK Pi 4
 Toradex Verdin i.MX8M Plus SoM
 Notes:
As of the moment Weston 12 (or newer) with etnaviv open source driver should
be used on NXP i.MX6, i.MX7, i.MX8, etc.
The fork weston-imx for Vivante proprietary GPU driver hasn’t been upgraded to
Weston 12 yet. Therefore VNC backend is still not available in weston-imx.
FOSDEM 2024, Leon Anavi
Conclusions
 VNC is a pixel based graphical desktop-sharing system
 VNC backend was added in Weston version 12
 VNC backend in Weston depends on NeatVNC and aml
 Generate appropriate key and certificate files for TLS encryption
 The latest versions of the Yocto Project and OpenEmbedded provide the
necessary tools and dependencies to build core-image-weston and to enable VNC
 Layer meta-weston-remote-desktop provides example integrations of both VNC
and RDP in Weston
FOSDEM 2024, Leon Anavi
Thank You!
Useful links
 Wayland
https://wayland.freedesktop.org/
 Weston source code
https://gitlab.freedesktop.org/wayland/weston
 The Yocto Project
https://www.yoctoproject.org/
 The Yocto Project releases
https://wiki.yoctoproject.org/wiki/Releases
 Simple example Yocto/OE layer for VNC and RDP on Weston:
https://github.com/leon-anavi/meta-weston-remote-desktop/tree/main

More Related Content

Similar to Screen Sharing on Raspberry Pi 5 Using VNC in Weston and Wayland with the Yocto Project and OpenEmbedded

Hyper-V support for OpenStack Grizzly
Hyper-V support for OpenStack GrizzlyHyper-V support for OpenStack Grizzly
Hyper-V support for OpenStack GrizzlyKamesh Pemmaraju
 
Surfing on an Interactive Kiosk
Surfing on an Interactive KioskSurfing on an Interactive Kiosk
Surfing on an Interactive KioskLeon Anavi
 
Proxmox 4.2 usage in the Standards Interoperability PLM Project
Proxmox 4.2 usage in the Standards Interoperability PLM Project Proxmox 4.2 usage in the Standards Interoperability PLM Project
Proxmox 4.2 usage in the Standards Interoperability PLM Project Dr Nicolas Figay
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeStefano Stabellini
 
"One network to rule them all" - OpenStack Summit Austin 2016
"One network to rule them all" - OpenStack Summit Austin 2016"One network to rule them all" - OpenStack Summit Austin 2016
"One network to rule them all" - OpenStack Summit Austin 2016Phil Estes
 
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)DynamicInfraDays
 
How to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux DevicesHow to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux DevicesLeon Anavi
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Issues of OpenStack multi-region mode
Issues of OpenStack multi-region modeIssues of OpenStack multi-region mode
Issues of OpenStack multi-region modeJoe Huang
 
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...Gonéri Le Bouder
 
DockerCon17 - Beyond the backslash
DockerCon17 - Beyond the backslashDockerCon17 - Beyond the backslash
DockerCon17 - Beyond the backslashTaylor Brown
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
Kubernetes networking-made-easy-with-open-v switch
Kubernetes networking-made-easy-with-open-v switchKubernetes networking-made-easy-with-open-v switch
Kubernetes networking-made-easy-with-open-v switchInfraEngineer
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)Ruoshi Ling
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Patrick Chanezon
 
DockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐるDockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐるKohei Tokunaga
 

Similar to Screen Sharing on Raspberry Pi 5 Using VNC in Weston and Wayland with the Yocto Project and OpenEmbedded (20)

Hyper-V support for OpenStack Grizzly
Hyper-V support for OpenStack GrizzlyHyper-V support for OpenStack Grizzly
Hyper-V support for OpenStack Grizzly
 
Surfing on an Interactive Kiosk
Surfing on an Interactive KioskSurfing on an Interactive Kiosk
Surfing on an Interactive Kiosk
 
Proxmox 4.2 usage in the Standards Interoperability PLM Project
Proxmox 4.2 usage in the Standards Interoperability PLM Project Proxmox 4.2 usage in the Standards Interoperability PLM Project
Proxmox 4.2 usage in the Standards Interoperability PLM Project
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edge
 
BSDcon Asia 2015: Xen on FreeBSD
BSDcon Asia 2015: Xen on FreeBSDBSDcon Asia 2015: Xen on FreeBSD
BSDcon Asia 2015: Xen on FreeBSD
 
OVS-NFV Tutorial
OVS-NFV TutorialOVS-NFV Tutorial
OVS-NFV Tutorial
 
"One network to rule them all" - OpenStack Summit Austin 2016
"One network to rule them all" - OpenStack Summit Austin 2016"One network to rule them all" - OpenStack Summit Austin 2016
"One network to rule them all" - OpenStack Summit Austin 2016
 
Docker from scratch
Docker from scratchDocker from scratch
Docker from scratch
 
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
 
How to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux DevicesHow to Choose a Software Update Mechanism for Embedded Linux Devices
How to Choose a Software Update Mechanism for Embedded Linux Devices
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Issues of OpenStack multi-region mode
Issues of OpenStack multi-region modeIssues of OpenStack multi-region mode
Issues of OpenStack multi-region mode
 
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...High Performance Computing and Open Source & Linux Technical Excellence Sympo...
High Performance Computing and Open Source & Linux Technical Excellence Sympo...
 
DockerCon17 - Beyond the backslash
DockerCon17 - Beyond the backslashDockerCon17 - Beyond the backslash
DockerCon17 - Beyond the backslash
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Docker con osdk_ver1.0
Docker con osdk_ver1.0Docker con osdk_ver1.0
Docker con osdk_ver1.0
 
Kubernetes networking-made-easy-with-open-v switch
Kubernetes networking-made-easy-with-open-v switchKubernetes networking-made-easy-with-open-v switch
Kubernetes networking-made-easy-with-open-v switch
 
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017
 
DockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐるDockerとKubernetesをかけめぐる
DockerとKubernetesをかけめぐる
 

More from Leon Anavi

Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...Leon Anavi
 
Как да убием и последната дискета с Open Source технологии?
Как да убием и последната дискета с Open Source технологии?Как да убием и последната дискета с Open Source технологии?
Как да убием и последната дискета с Open Source технологии?Leon Anavi
 
Linux обновления с RAUC и Docker
Linux обновления с RAUC и DockerLinux обновления с RAUC и Docker
Linux обновления с RAUC и DockerLeon Anavi
 
Open Hardware Makers
Open Hardware MakersOpen Hardware Makers
Open Hardware MakersLeon Anavi
 
Open Source Tools for Making Open Source Hardware
Open Source Tools for Making Open Source HardwareOpen Source Tools for Making Open Source Hardware
Open Source Tools for Making Open Source HardwareLeon Anavi
 
Linux дистрибуции и софтуерни обновления за вградени устройства
Linux дистрибуции и софтуерни обновления за вградени устройства Linux дистрибуции и софтуерни обновления за вградени устройства
Linux дистрибуции и софтуерни обновления за вградени устройства Leon Anavi
 
Getting started with AGL using a Raspberry Pi
Getting started with AGL using a Raspberry PiGetting started with AGL using a Raspberry Pi
Getting started with AGL using a Raspberry PiLeon Anavi
 
Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?Leon Anavi
 
Comparison of Open Source Software Home Automation Tools
Comparison of Open Source Software Home Automation ToolsComparison of Open Source Software Home Automation Tools
Comparison of Open Source Software Home Automation ToolsLeon Anavi
 
Практични примери за device tree overlays на Raspberry Pi
Практични примери за device tree overlays на Raspberry PiПрактични примери за device tree overlays на Raspberry Pi
Практични примери за device tree overlays на Raspberry PiLeon Anavi
 
The Software Developer’s Guide to Open Source Hardware
The Software Developer’s Guide to Open Source HardwareThe Software Developer’s Guide to Open Source Hardware
The Software Developer’s Guide to Open Source HardwareLeon Anavi
 
Making Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry PiMaking Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry PiLeon Anavi
 
Вграждане на умни гласови асистенти в устройства с Linux
Вграждане на умни гласови асистенти в устройства с LinuxВграждане на умни гласови асистенти в устройства с Linux
Вграждане на умни гласови асистенти в устройства с LinuxLeon Anavi
 
Comparison of Voice Assistant SDKs for Embedded Linux Devices
 Comparison of Voice Assistant SDKs for Embedded Linux Devices Comparison of Voice Assistant SDKs for Embedded Linux Devices
Comparison of Voice Assistant SDKs for Embedded Linux DevicesLeon Anavi
 
Open Source MQTT Brokers
Open Source MQTT BrokersOpen Source MQTT Brokers
Open Source MQTT BrokersLeon Anavi
 
Въведение в RetroPie за Raspberry Pi
Въведение в RetroPie за Raspberry PiВъведение в RetroPie за Raspberry Pi
Въведение в RetroPie за Raspberry PiLeon Anavi
 
Free and Open Source Software Tools for Making Open Source Hardware
 Free and Open Source Software Tools for Making Open Source Hardware Free and Open Source Software Tools for Making Open Source Hardware
Free and Open Source Software Tools for Making Open Source HardwareLeon Anavi
 
Building a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade LinuxBuilding a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade LinuxLeon Anavi
 
Връщане към живота на ретро електроника с Raspberry Pi
Връщане към живота на ретро електроника с Raspberry PiВръщане към живота на ретро електроника с Raspberry Pi
Връщане към живота на ретро електроника с Raspberry PiLeon Anavi
 
Open Source Hardware with KiCAD and OSHPark
Open Source Hardware with KiCAD and OSHParkOpen Source Hardware with KiCAD and OSHPark
Open Source Hardware with KiCAD and OSHParkLeon Anavi
 

More from Leon Anavi (20)

Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
Как да играем компютърни игри с Nintendo Wii Nunchuk чрез Raspberry Pi RP2040...
 
Как да убием и последната дискета с Open Source технологии?
Как да убием и последната дискета с Open Source технологии?Как да убием и последната дискета с Open Source технологии?
Как да убием и последната дискета с Open Source технологии?
 
Linux обновления с RAUC и Docker
Linux обновления с RAUC и DockerLinux обновления с RAUC и Docker
Linux обновления с RAUC и Docker
 
Open Hardware Makers
Open Hardware MakersOpen Hardware Makers
Open Hardware Makers
 
Open Source Tools for Making Open Source Hardware
Open Source Tools for Making Open Source HardwareOpen Source Tools for Making Open Source Hardware
Open Source Tools for Making Open Source Hardware
 
Linux дистрибуции и софтуерни обновления за вградени устройства
Linux дистрибуции и софтуерни обновления за вградени устройства Linux дистрибуции и софтуерни обновления за вградени устройства
Linux дистрибуции и софтуерни обновления за вградени устройства
 
Getting started with AGL using a Raspberry Pi
Getting started with AGL using a Raspberry PiGetting started with AGL using a Raspberry Pi
Getting started with AGL using a Raspberry Pi
 
Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?Automotive Grade Linux on Raspberry Pi: How Does It Work?
Automotive Grade Linux on Raspberry Pi: How Does It Work?
 
Comparison of Open Source Software Home Automation Tools
Comparison of Open Source Software Home Automation ToolsComparison of Open Source Software Home Automation Tools
Comparison of Open Source Software Home Automation Tools
 
Практични примери за device tree overlays на Raspberry Pi
Практични примери за device tree overlays на Raspberry PiПрактични примери за device tree overlays на Raspberry Pi
Практични примери за device tree overlays на Raspberry Pi
 
The Software Developer’s Guide to Open Source Hardware
The Software Developer’s Guide to Open Source HardwareThe Software Developer’s Guide to Open Source Hardware
The Software Developer’s Guide to Open Source Hardware
 
Making Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry PiMaking Open Source Hardware for Retrogaming on Raspberry Pi
Making Open Source Hardware for Retrogaming on Raspberry Pi
 
Вграждане на умни гласови асистенти в устройства с Linux
Вграждане на умни гласови асистенти в устройства с LinuxВграждане на умни гласови асистенти в устройства с Linux
Вграждане на умни гласови асистенти в устройства с Linux
 
Comparison of Voice Assistant SDKs for Embedded Linux Devices
 Comparison of Voice Assistant SDKs for Embedded Linux Devices Comparison of Voice Assistant SDKs for Embedded Linux Devices
Comparison of Voice Assistant SDKs for Embedded Linux Devices
 
Open Source MQTT Brokers
Open Source MQTT BrokersOpen Source MQTT Brokers
Open Source MQTT Brokers
 
Въведение в RetroPie за Raspberry Pi
Въведение в RetroPie за Raspberry PiВъведение в RetroPie за Raspberry Pi
Въведение в RetroPie за Raspberry Pi
 
Free and Open Source Software Tools for Making Open Source Hardware
 Free and Open Source Software Tools for Making Open Source Hardware Free and Open Source Software Tools for Making Open Source Hardware
Free and Open Source Software Tools for Making Open Source Hardware
 
Building a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade LinuxBuilding a Remote Control Robot with Automotive Grade Linux
Building a Remote Control Robot with Automotive Grade Linux
 
Връщане към живота на ретро електроника с Raspberry Pi
Връщане към живота на ретро електроника с Raspberry PiВръщане към живота на ретро електроника с Raspberry Pi
Връщане към живота на ретро електроника с Raspberry Pi
 
Open Source Hardware with KiCAD and OSHPark
Open Source Hardware with KiCAD and OSHParkOpen Source Hardware with KiCAD and OSHPark
Open Source Hardware with KiCAD and OSHPark
 

Recently uploaded

costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 

Screen Sharing on Raspberry Pi 5 Using VNC in Weston and Wayland with the Yocto Project and OpenEmbedded

  • 1. Screen Sharing on Raspberry Pi 5 Using VNC in Weston and Wayland with the Yocto Project and OpenEmbedded Leon Anavi Konsulko Group leon.anavi@konsulko.com leon@anavi.org FOSDEM 2024
  • 2. FOSDEM 2024, Leon Anavi In Previous Episode
  • 3. FOSDEM 2024, Leon Anavi Agenda  Wayland and Weston  VNC  Weston and the Yocto Project Releases  core-image-weston with VNC demo on Raspberry Pi 5
  • 4. FOSDEM 2024, Leon Anavi Wayland & Weston  Wayland is a display protocol that specifies the communication between a display server and its clients  Started in 2008 with the aim to replace the X Window System in GNU/Linux and Unix-based distributions  Security by design through isolation of the input and output of every window  Weston is the reference Wayland compositor, there are many other compositors  Weston 13.0 was released on November 27, 2023
  • 5. FOSDEM 2024, Leon Anavi Remote Desktop Options in Weston and Wayland  Remote Desktop Protocol (RDP)  Virtual Network Computing (VNC)
  • 6. FOSDEM 2024, Leon Anavi Virtual Network Computing (VNC)  Graphical desktop-sharing system based on Remote Frame Buffer protocol (RFB)  Initially Olivetti Research Laboratory developed and published RFB in 1998, next versions of the protocol were published by RealVNC Ltd  Pixel based  Works with all windowing systems and applications, including MS Windows, Mac OS, X11 and Wayland
  • 7. FOSDEM 2024, Leon Anavi RDP vs VNC RDP (Remote Desktop Protocol) VNC (Virtual Network Computing) Protocol ITU-T T.128 Remote Frame Buffer protocol (RFB) Type Semantic (aware of controls, fonts and other graphical primitives) Pixel based Weston version 2.0 and newer 12.0 and newer Weston support since 2016 2022
  • 8. FOSDEM 2024, Leon Anavi VNC in Weston
  • 9. FOSDEM 2024, Leon Anavi  VNC in Weston
  • 10. FOSDEM 2024, Leon Anavi VNC in Weston  VNC backend is available in Weston 12 and newer version  VNC backend for Weston depends on NeatVNC  NeatVNC is an open source VNC server library with a clean interface, started by Andri Yngvason with code available at GitHub under ISC license  NeatVNC has build dependencies on libdrm, meson and pkg-config  NeatVNC has a runtime dependency on aml (Andri's Main Loop)
  • 11. FOSDEM 2024, Leon Anavi The Yocto Project  Open source collaborative project of the Linux foundation for creating custom Linux-based distributions for embedded devices using the OpenEmbedded Build System  OpenEmbedded Build System includes BitBake and OpenEmbedded Core  Poky is a reference distribution of the Yocto Project provided as metadata, without binary files, to bootstrap your own distribution for embedded devices  Bi-annual release cycle  Long term support (LTS) release covering two-year period
  • 12. FOSDEM 2024, Leon Anavi The Yocto Project Releases Codename Version Release Date Support Level Scarthgap 5.0 April 2024 Future – LTS (until April 2028) Nanbield 4.3 November 2023 Until May 2024 Kirkstone 4.0 May 2022 LTS (until Apr. 2026) Dunfell 3.1 April 2020 LTS (until Apr. 2024)
  • 13. FOSDEM 2024, Leon Anavi Wayland and Weston in Yocto and OpenEmbedded  OpenEmbedded-Core is a layer containing the core metadata for current versions of OpenEmbedded  OpenEmbedded-Core provides recipes for Wayland and Weston
  • 14. FOSDEM 2024, Leon Anavi The Yocto Project, Wayland and Weston Versions Codename Version Wayland Weston Scarthgap 5.0 1.22 (?) 13.0.0 (?) Nanbield 4.3 1.22 12.0.2 Kirkstone 4.0 1.20 10.0.2 Dunfell 3.1 1.18 8.0.0
  • 15. FOSDEM 2024, Leon Anavi Bitbaking Weston with VNC Extend the recipe for building Weston:  Enable VNC backend: PACKAGECONFIG:append = " vnc" This will enable -Dbackend-vnc=true and add neatvnc (from layer meta-oe) as a build dependency  Place a PAM configuration file in the package: FILES:${PN}:append = " ${sysconfdir}/pam.d/weston-remote-access"  For example, weston_%.bbappend: https://github.com/leon-anavi/meta-weston-remote-desktop/blob/main/meta-weston-vnc/recipes-graphics/ wayland/weston_%25.bbappend
  • 16. FOSDEM 2024, Leon Anavi aml and neatvnc in meta-oe
  • 17. FOSDEM 2024, Leon Anavi Bitbaking NeatVNC for Weston with VNC  Enable TLS: PACKAGECONFIG:append = " tls"  libweston/backend-vnc/meson.build from Weston 12 and 13: dep_neatvnc = dependency('neatvnc', version: ['>= 0.6.0', '< 0.7.0'], required: false, fallback: ['neatvnc', 'neatvnc_dep'])  libweston/backend-vnc/meson.build from Weston branch main: dep_neatvnc = dependency('neatvnc', version: ['>= 0.7.0', '< 0.8.0'], required: false, fallback: ['neatvnc', 'neatvnc_dep'])  Select NeatVNC matching Weston requirements, for example: PREFERRED_VERSION_neatvnc = "git"
  • 18. FOSDEM 2024, Leon Anavi weston-init.bbappend  Set password weston (from mkpasswd -m sha256crypt) for user weston: WESTONPASSWD = "$5$409x651F5vyY1.4o$Iuplll7/qNSEcflYNjH..0zwylmyLsbZdZGS6hBcro5" USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,render,wayland -p '${WESTONPASSWD}' weston"  Create a directory on the target device to store TLS key and certificate: do_install:append(){ install -m 0755 -d ${D}${sysconfdir}/vnc/keys/ chown weston:weston ${D}${sysconfdir}/vnc/keys/ } FILES:${PN} += " ${sysconfdir}/vnc/keys "
  • 19. FOSDEM 2024, Leon Anavi TLS security  Generate a key and certificate files to use with TLS security: mkdir -p ~/.pki/CA/private/ cd ~/.pki/CA openssl genrsa -out private/cakey.pem 2048 openssl req -new -x509 -nodes -days 365000 -key private/cakey.pem -out cacert.pem openssl genrsa -out tls.key 2048 openssl req -new -key tls.key -out tls.csr openssl req -new -key tls.key -out tls.csr -subj "/CN=raspberrypi5" openssl x509 -req -days 365 -in tls.csr -out tls.crt -CA cacert.pem -CAkey private/cakey.pem
  • 20. FOSDEM 2024, Leon Anavi Using VNC on Weston  Copy tls.crt and tls.key to /etc/vnc/keys on the target device, e.g. Raspberry Pi 5  Enable VNC screen sharing in /etc/xdg/weston/weston.ini: [screen-share] command=/usr/bin/weston --backend=vnc-backend.so --vnc-tls-cert=/etc/vnc/keys/tls.crt --vnc-tls-key=/etc/vnc/keys/tls.key -- shell=fullscreen-shell.so  After loading Weston, press ctrl+alt+s to launch screen sharing
  • 21. FOSDEM 2024, Leon Anavi VNC Automatic Startup  Launch Weston with screen-share.so, for example in Weston systemd service: ExecStart=/usr/bin/weston --modules=systemd-notify.so,screen-share.so  Add start-on-startup=true to section [screen-share] in weston.ini: [screen-share] command=/usr/bin/weston --backend=vnc-backend.so --vnc-tls-cert=/etc/vnc/keys/tls.crt --vnc-tls-key=/etc/vnc/keys/tls.key -- shell=fullscreen-shell.so start-on-startup=true
  • 22. FOSDEM 2024, Leon Anavi Remote Connection  From another computer in the same network connect to the embedded device using a VNC client, for example with vinagre, an open source remote desktop viewer for Linux and the GNOME Desktop: vinagre --gtk-vnc-debug
  • 23. FOSDEM 2024, Leon Anavi VNC Demo  Vinagre on Ubuntu 22.04.3 LTS with X11 and GNOME 42.9  core-image-weston with Weston version 12.0.2 on Raspberry Pi 5 (using BSP layer meta-raspberrypi)
  • 24. FOSDEM 2024, Leon Anavi VNC Frames per Second on Raspberry Pi 5  With VNC enabled weston-simple-egl runs with up to 20fps on Raspberry Pi 5
  • 25. FOSDEM 2024, Leon Anavi QA  Raspberry Pi 5  Raspberry Pi 4  ROCK Pi 4  Toradex Verdin i.MX8M Plus SoM  Notes: As of the moment Weston 12 (or newer) with etnaviv open source driver should be used on NXP i.MX6, i.MX7, i.MX8, etc. The fork weston-imx for Vivante proprietary GPU driver hasn’t been upgraded to Weston 12 yet. Therefore VNC backend is still not available in weston-imx.
  • 26. FOSDEM 2024, Leon Anavi Conclusions  VNC is a pixel based graphical desktop-sharing system  VNC backend was added in Weston version 12  VNC backend in Weston depends on NeatVNC and aml  Generate appropriate key and certificate files for TLS encryption  The latest versions of the Yocto Project and OpenEmbedded provide the necessary tools and dependencies to build core-image-weston and to enable VNC  Layer meta-weston-remote-desktop provides example integrations of both VNC and RDP in Weston
  • 27. FOSDEM 2024, Leon Anavi Thank You! Useful links  Wayland https://wayland.freedesktop.org/  Weston source code https://gitlab.freedesktop.org/wayland/weston  The Yocto Project https://www.yoctoproject.org/  The Yocto Project releases https://wiki.yoctoproject.org/wiki/Releases  Simple example Yocto/OE layer for VNC and RDP on Weston: https://github.com/leon-anavi/meta-weston-remote-desktop/tree/main