Wayland Integration Technology
How Lamco RDP Server delivers native Wayland remote desktop through XDG Portals, PipeWire, libei, and intelligent capability discovery
The Wayland Transition
Linux desktops are transitioning from X11 to Wayland. Major distributions now default to Wayland:
Ubuntu 24.04+
Wayland default
Fedora
Wayland default since Fedora 25
GNOME
Wayland default since 3.22
KDE Plasma
Wayland default on many distributions
This transition brings significant benefits—better security, improved performance, proper HiDPI support—but it also breaks traditional remote desktop approaches that relied on X11's open architecture.
Why X11 Remote Desktop Doesn't Work on Wayland
The X11 Approach
X11 was designed with network transparency. Any application could:
- ✗ Read the contents of any window
- ✗ Inject keyboard and mouse events
- ✗ Access the clipboard globally
Remote desktop servers like xrdp exploited this openness.
The Wayland Security Model
Wayland applications are isolated by design:
- ✓ Applications cannot see other windows
- ✓ Input injection requires explicit permission
- ✓ Clipboard access is mediated
This is good for security but means the X11 remote desktop approach simply doesn't work.
The Xwayland Workaround
Some solutions run an Xwayland server (X11 compatibility layer) to capture. This works but has serious drawbacks:
Extra layer
Added latency and complexity
Partial capture
Native Wayland windows may not appear
Security bypass
Defeats Wayland's isolation
Resource overhead
Running two display servers
The Portal-Based Solution
XDG Desktop Portals
The XDG Desktop Portal specification provides a sanctioned way for applications to request privileged operations with user consent.
Application Portal Compositor
│ │ │
│ "I want to capture │ │
│ the screen" │ │
│ ───────────────────────► │
│ │ │
│ │ "User, allow this?" │
│ │ ──────────────────────────►
│ │ │
│ │ "Yes, user clicked │
│ │ allow" │
│ │ ◄──────────────────────────
│ │ │
│ "Here's your │ │
│ PipeWire stream" │ │
│ ◄─────────────────────── │
│ │ │
The Right Way:
The user explicitly grants permission. The compositor provides the screen content. The security model is maintained.
Lamco RDP Server Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Lamco RDP Server │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ lamco-portal│ │lamco-pipewire│ │ lamco-video │ │
│ │ │ │ │ │ │ │
│ │ Portal │ │ PipeWire │ │ Frame │ │
│ │ Negotiation │───►│ Capture │───►│ Processing │ │
│ │ │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ H.264 Encoding Pipeline │ │
│ │ (OpenH264 / NVENC / VA-API) │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ RDP Protocol │ │
│ │ (IronRDP) │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
└────────────────────────────┼───────────────────────────────────┘
│
▼
RDP Client
Portal Components
ScreenCast Portal
Provides screen capture via PipeWire streams
org.freedesktop.portal.ScreenCast
- ✓ Single monitor capture
- ✓ Multi-monitor capture
- ✓ Window capture
- ✓ Cursor metadata
RemoteDesktop Portal
Provides input injection via libei
org.freedesktop.portal.RemoteDesktop
- ✓ Keyboard events
- ✓ Mouse movement
- ✓ Mouse buttons & scroll
- ✓ Multi-touch
Clipboard Access
Two approaches for clipboard sync
Portal clipboard
Sandboxed, permission-based (newer)
D-Bus clipboard
GNOME-specific fallback
Lamco RDP Server detects which is available and uses the appropriate method.
PipeWire Integration
What Is PipeWire?
PipeWire is the modern Linux multimedia framework, replacing both PulseAudio (audio) and much of GStreamer's role. For screen capture, it provides efficient zero-copy frame delivery.
DMA-BUF Zero-Copy
When both GPU and PipeWire support it, frames never leave GPU memory:
Compositor GPU Buffer
│
│ (DMA-BUF file descriptor)
▼
PipeWire Stream ──────────► lamco-pipewire
│ │
│ │ (same GPU buffer)
▼ ▼
No CPU copy H.264 Encoder
(NVENC/VA-API)
Benefit:
Minimal latency, zero CPU memory bandwidth used.
lamco-pipewire Crate
Our open-source PipeWire integration provides:
Service Advertisement Registry
One of Lamco RDP Server's distinguishing features is its Service Advertisement Registry—an integrated system for discovering Wayland capabilities and translating them to RDP features.
The Problem
Wayland is not a single specification. It's a protocol plus dozens of extensions, and support varies by:
Compositor
GNOME, KDE, Sway, Hyprland
Portal implementation
Different versions and capabilities
System configuration
Hardware and drivers
Installed packages
Libraries and dependencies
Runtime Capability Discovery
At startup, Lamco RDP Server probes the system to build a complete picture of available capabilities:
┌─────────────────────────────────────────────────────────────────────┐
│ Service Advertisement Registry │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Compositor │ │ Portal │ │ System │ │
│ │ Probing │ │ Probing │ │ Probing │ │
│ └────────┬────────┘ └────────┬────────┘ └────────┬────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Capability Registry │ │
│ │ │ │
│ │ screen_capture: Available (PipeWire + ScreenCast) │ │
│ │ input_injection: Available (libei + RemoteDesktop) │ │
│ │ clipboard: Available (D-Bus fallback) │ │
│ │ multi_monitor: Available (2 outputs detected) │ │
│ │ dma_buf: Available (GPU: Intel UHD) │ │
│ │ hardware_encode: Available (VA-API: iHD driver) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ RDP Capability Advertisement │ │
│ │ │ │
│ │ → Advertise RDPGFX (video encoding available) │ │
│ │ → Advertise CLIPRDR (clipboard available) │ │
│ │ → Advertise RDPINPUT (input available) │ │
│ │ → Advertise multi-monitor layout │ │
│ │ → Select optimal encoder backend │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
Graceful Degradation
Instead of crashing when a feature is unavailable, Lamco RDP Server advertises only what it can actually deliver.
Optimal Paths
The registry chooses the best available implementation: NVENC over VA-API over software, DMA-BUF over memory-mapped.
Clear Diagnostics
When something doesn't work, you know exactly what's missing instead of getting cryptic errors.
Compositor Compatibility
Tested Compositors
| Compositor | ScreenCast | RemoteDesktop | DMA-BUF | Notes |
|---|---|---|---|---|
| GNOME (Mutter) | ✓ | ✓ | ✓ | Best tested |
| KDE (KWin) | ✓ | ✓ | ✓ | Full support |
| Sway | ✓ | ✓ | ✓ | wlroots-based |
| Hyprland | ✓ | ✓ | ✓ | wlroots-based |
| weston | Partial | Partial | ✓ | Reference compositor |
Portal Implementations
Each compositor (or family) has its own portal implementation:
GNOME
xdg-desktop-portal-gnome
KDE
xdg-desktop-portal-kde
wlroots (Sway)
xdg-desktop-portal-wlr
Hyprland
xdg-desktop-portal-hyprland
Important:
Ensure the correct portal implementation is installed for your compositor.