Remote desktop and screen casting in Wayland
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.
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.
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.
Enabling at compile time
To include screen cast and remote desktop functionality, pass --enable-remote-desktop to ./configure when building mutter.
Enable experimental setting
This feature is no longer experimental as of GNOME 3.30 so if you're using GNOME 3.30, you can ignore this section.
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:
gsettings get org.gnome.mutter experimental-features
If the output of that command is either empty or , then run:
gsettings set org.gnome.mutter experimental-features "['screen-cast', 'remote-desktop']"
If the output of the first command was for example ['some-other-feature'], then run:
gsettings set org.gnome.mutter experimental-features "['some-other-feature', 'screen-cast', 'remote-desktop']"
Testing that it works
First make sure pipewire is running.
The easiest way to try out is to use this simple python script. Download it, and run
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.
Install GNOME Remote Desktop. If you are running Fedora 27 or higher, 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.
Open Settings, select Sharing, and enable Screen sharing. This should automatically enable the service and you should immediately be able to connect via VNC.
If you encounter unexpected crashes, screen casting or remote desktop access not functioning as expected, please report bug.