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

The API currently exposed is not meant to be used by third party applications, and it's not unlikely it will change with future GNOME version. Work is currently being done to expose screen cast and remote desktop functionality via org.freedesktop.portal.* APIs, managed by xdg-desktop-portal. This way, sandboxed and non-sandboxed applications can use the exact same API.

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:

First run:

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

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.

Reporting bugs

If you encounter unexpected crashes, screen casting or remote desktop access not functioning as expected, please report bug.

Bugs should either be reported to mutter or GNOME Remote Desktop depending on where the bug is found.

Projects/Mutter/RemoteDesktop (last edited 2017-08-29 09:52:42 by JonasAdahl)