Description
Remote desktop typically is implemented with X server, but when we switch to Wayland, there is no X server and we cannot easily get screen content to use in remote desktop. Every desktop environments have to create their own remote desktop implementation.
For GNOME, there is already a GNOME Remote Desktop, which is not only support screen sharing (user is already logging into local session), but also remote login (no local session, create virtual session from GDM), however, it has some limitation:
- Screencast is a DBus interface, which means it is per-user session. So the login interface (GDM) and user session are on different DBus session, we have to connect to different DBus session and switch between them.
- To achieve the switch between sessions, RDP protocol's ServerRedirection is used to let client automatically disconnect from a port and then connect to another port. So we lose VNC support because there is no alternative in RFB protocol.
- ServerRedirection is not implemented in all RDP clients, implementation is added to FreeRDP, and Microsoft's remote desktop client on Windows supports it, however, Microsoft's remote desktop client on macOS does not support it, so you cannot use this with a macOS client.
There is another alternative called kmsvnc, it uses a different way to achieve remote desktop: Grab content from DRM framebuffer, and decode it, then pass to VNC server. Which makes it desktop-independent.
After talking with the author of kmsvnc, he said he wants to rewrite it because some mistakes he made when starting this project:
- Using VA-API to decode the buffer get frome DRM framebuffer, VA-API is not supported by NVIDIA, and Intel/AMD has different bugs in their implementation. Using EGL/OpenGL to decode the buffer will be better.
- Probe connector/CRTC/plane only once at launching, however DRM plane is changed when switch TTY. This should be re-probe each loop.
And I add some advice:
- The whole program requires
sudo
to grab DRM framebuffer, we should split it into two parts, a small one run with privilege grab screen content, then pass dma-buf fds via UNIX socket to the server. - The server can support both VNC and RDP.
Goals
So the goals is to create a program that getting framebuffer content via DRM/KMS, and decode the content with EGL/OpenGL, and send it to VNC/RDP server.
Things won't be implemented by this program:
- Audio forwarding: VNC has no support for audio, RDP supports it, but desktop audio is processed via pipewire per-session, we don't want to connect to different DBus sessions and get audio.
- Devices that don't support DRM/KMS, we focus on modern desktop PCs and they should already support DRM/KMS.
Resources
-
Looking for hackers with the skills:
Nothing? Add some keywords!
This project is part of:
Hack Week 24
Activity
Comments
Be the first to comment!
Similar Projects
This project is one of its kind!