Remote desktop and screen casting in Wayland

Introduction

Remote desktop and screen sharing in libmutter is split into two separate, but optionally combined parts: screen casting, and remote control. Both are exposed via their own D-Bus APIs. The data transfer and format negotiation of the screen casting is done by PipeWire.

API

Applications that want to implement features related to screen casting and/or desktop sharing should use corresponding APIs provided by xdg-desktop-portal. Two related APIs are provided; org.freedesktop.portal.ScreenCast for managing screen casting sessions, and org.freedesktop.portal.RemoteDesktop for managing remote desktop (i.e. remote control) sessions. They can also be combined to create a remote desktop session with screen casting functionality.

You can find the screen cast API here and the remote desktop API here.

How to test

In GNOME 3.26, screen casting and remote desktop functionality is not enabled by default. To enable, it needs to be enabled both on compile time and run time.

Dependencies

To be able to build with the screen cast feature enabled, PipeWire with at least the version 0.1.4 needs to be installed. PipeWire is a fairly new project, so you might need to build it from source.

Enabling at compile time

To include screen cast and remote desktop functionality, pass --enable-remote-desktop to ./configure when building mutter.

./configure --enable-remote-desktop

Enable experimental setting

Besides enabling the feature at compile time, you also need to enable it at runtime. This is done by editing a gsetting key org.gnome.mutter.experimental-features. To do so, do as follows:

Testing that it works

The easiest way to try out is to use this simple python script. Download it, and run

python3 gnome-screen-cast.py

and it should pop up a window with the content of the compositor in real time, streamed via PipeWire into a GStreamer pipeline.

Remote Desktop

Remote desktop functionality is not implemented in mutter but in GNOME Remote Desktop. Currently only remote passwordless unencrypted VNC access to an existing session is supported. VNC support is provided via LibVNCServer.

To enable said VNC access, apart from instructions above, also follow the instructions below.

Installing

Install GNOME Remote Desktop. If you are running Fedora 27 or Fedara Rawhide, do so by running sudo dnf install gnome-remote-desktop (available soon). If not, if it is not available in your distribution of choice, you can compile it from source.

Enabling

Open Settings, select Sharing, and enable Screen sharing. This should automatically enable the service and you should immediately be able to connect via VNC.