Seamless remote desktop hosting for Hyprland using Wayland and PipeWire.
Project details
hyprCRD enables native support for Google Chrome Remote Desktop on Hyprland, providing a direct and efficient way to stream your desktop over WebRTC without relying on outdated X11 servers. Featuring integration with PipeWire for optimal video streaming, it offers a smooth experience for remote users, eliminating common limitations of traditional setups.
Project Name: hyprCRD
Overview
hyprCRD serves as a native host solution for Google Chrome Remote Desktop, specifically optimized for the Hyprland Wayland compositor. This project facilitates seamless streaming of the active hardware-accelerated desktop session directly over WebRTC. Unlike traditional methods that rely on virtual X11 framebuffers (Xvfb), hyprCRD allows direct access to the desktop environment, enhancing performance and user experience.
hyprcrd-portal) for effective emulation of input protocols using libei and associated libraries, enhancing the remote user experience.The architecture of hyprCRD integrates multiple services to facilitate a streamlined connection between client devices and the hyprland desktop session. Below is a visual representation of the system architecture:
flowchart TD
Client["Client Device (Android / iOS / Web)"] <-->|"WebRTC / Google FTL Signaling"| CRDHost["Google Remoting Host (chrome-remote-desktop-host)"]
subgraph hyprCRD ["hyprCRD User Session"]
CRDHost <-->|"D-Bus: org.freedesktop.impl.portal.RemoteDesktop"| Portal["hyprcrd-portal (C++20 Bridge)"]
CRDHost -->|"Preload Interceptor"| Shim["pam_shim.so (C99 Hook)"]
Shim -->|"Resolves cursor_mode & stream renegotiations"| PipeWire["PipeWire Media Server"]
Portal -->|"EIS Protocol (libei/libeis)"| InputServer["Virtual Input Controller"]
InputServer -->|"zwlr_virtual_pointer_v1"| HyprlandPointer["Hyprland Virtual Pointer"]
InputServer -->|"zwp_virtual_keyboard_v1 + XKB"| HyprlandKeyboard["Hyprland Virtual Keyboard"]
end
PipeWire <-->|"DMA-BUF / SHM Capture"| XDPH["xdg-desktop-portal-hyprland"]
XDPH <-->|"Wayland Screencopy"| HyprlandCompositor["Hyprland Compositor (Physical Output)"]
The table below highlights the capabilities of hyprCRD compared to legacy systems and upstream Wayland implementations:
| Capability | Legacy CRD (X11 / Xvfb) | Upstream Wayland | hyprCRD (Native Hyprland) |
|---|---|---|---|
| WebRTC Video Codecs | Supported | Supported | Supported (Official Engine) |
| Google FTL & OAuth Signaling | Supported | Supported | Supported (Official Engine) |
| Active Compositor Desktop Access | No (Xvfb fallback) | No (Input unavailable) | Supported (Native Wayland) |
| PipeWire DMA-BUF 60 FPS Capture | No | Intermittent | Supported (Protected via shim) |
| Relative Pointer Motion | Supported | No | Supported (zwlr_virtual_pointer_v1) |
| Absolute Coordinate Mapping | Supported | No | Supported (Physical monitor scale) |
| Multi-Button Pointer Input | Supported | No | Supported (Primary, Secondary, Middle, Extra) |
| Continuous and Discrete Scrolling | Partial | No | Supported (Wheel notches and axis deltas) |
| System XKB Keymap and Modifiers | Basic US | No | Supported (Compositor keymap synthesis) |
| Mobile Client Overlays | Partial | No | Supported (Ctrl, Alt, Super, Function keys) |
| Unprivileged Execution | No | No | Supported |
| Automated Test Coverage | None | None | Comprehensive (95% line coverage) |
Detailed technical information can be found in ARCHITECTURE.md.
To utilize hyprCRD effectively, the following commands can be executed:
hyprcrd doctor
hyprcrd enroll "<COMMAND_STRING>"
hyprcrd start # Start the background daemon
hyprcrd start -f # Run in foreground for debugging
hyprcrd status # Check runtime status
hyprcrd stop # Stop daemon
Example runtime status output:
[hyprCRD Status]
Daemon: ACTIVE (PID: 3715)
Portal Bridge: ONLINE (PID: 1572)
Enrolled Host: workstation (ID: 855a3928-3500-4401-8b45-1a3206d55740)
To ensure functionality and stability of the service, testing can be performed using:
make test
This test suite covers multiple aspects, including PAM preload mechanisms, portal logic, and integration with the Wayland compositor.
hyprCRD operates under an unprivileged security model, ensuring that all operations are conducted within the user's standard session context. For specifics on vulnerability reporting and best security practices, refer to SECURITY.md.
For contributions, development guidelines, and more in-depth information regarding testing, see CONTRIBUTING.md.
This project represents a significant advancement in the seamless usage of Google Chrome Remote Desktop within the rapidly evolving environment of Wayland compositors, specifically catering to the Hyprland ecosystem.
Comments
0Start the conversation
Share the first comment.