Products › lamco-dsi-tools › Interfaces › RemoteDesktop portal and libei

libei and ConnectToEIS: Remote input through the RemoteDesktop portal

libei through the RemoteDesktop portal (ConnectToEIS) is how remote input reaches GNOME and KDE on Wayland: How it works, who offers it, and how to check it.

D-Bus portal, libei org.freedesktop.portal.RemoteDesktop, ConnectToEIS

libei is the library a program uses to send emulated keyboard, pointer and touch input to a Wayland compositor, and the RemoteDesktop portal, org.freedesktop.portal.RemoteDesktop, is how a program gets a libei connection: After a permission dialog, its ConnectToEIS method hands out the socket. Remote desktop servers, remote support tools and test automation use it, and on GNOME and KDE it's the route for input from a program of the session's user. lamco-dsi-tools (DSI: Desktop session interfaces) records whether the portal exports RemoteDesktop, opens a libei connection and reports its life, and sends input through it with dsido.

What it is

The portal half is a session on D-Bus. CreateSession makes it. SelectDevices takes a types bitmask (keyboard, pointer, touchscreen), and from version 2 a persist_mode and a restore_token. Start normally shows the dialog and answers with the devices granted. The AvailableDeviceTypes property says which kinds the backend offers. A program can also call ScreenCast's SelectSources and the Clipboard portal's RequestClipboard on the same session before Start, which is how a remote desktop server gets the screen, the input and the clipboard behind one dialog.

After Start there are two ways to send input. The older one is the Notify* methods on D-Bus, such as NotifyPointerMotion. The portal's documentation recommends the other: ConnectToEIS, added in version 2 of the interface, returns a file descriptor for a libei sender context, and once that's established the Notify* methods mustn't be used.

On that connection the compositor, through its libeis side, announces a seat and devices, each with the interfaces it has: Keyboard, pointer, absolute pointer, button, scroll and touchscreen. A device has to be resumed before the client may send through it, and the client sends events in frames. The keyboard's keymap is the compositor's, announced as a file descriptor. An absolute pointer and a touchscreen take positions inside the device's regions, and a touch that goes down outside every region is discarded.

When remote input doesn't work on Wayland, it can stop at any of these steps: A portal with no RemoteDesktop interface, as with the wlroots portal backend; a RemoteDesktop older than version 2, which has no ConnectToEIS; a declined dialog; devices that were never resumed; or keys sent while the window you watch doesn't have the keyboard focus. Each is recorded apart in a capture.

Which desktops offered it

DesktopState
GNOME Shell 48.7 (Debian 13)present
GNOME Shell 51.0 (Fedora 45)present
KDE Plasma, KWin 6.5.6 (NixOS)present
KDE Plasma, KWin 6.8.2 (KDE neon)present
Sway 1.9not examined
Hyprland 0.56.2absent
COSMIC, cosmic-comp 1.0.0present
labwc 0.20.3 (Budgie session, CachyOS)absent
Cinnamon Wayland session (Linux Mint)absent

These are one capture each of one version of each desktop on one virtual machine, taken on 2026-11-27 or 2026-11-28 with dsisee observe and no permission dialog answered, so present means the portal offered RemoteDesktop and no connection was opened. Sway's portal wasn't running, so its cell is not examined. The portals of Hyprland 0.56.2, labwc 0.20.3 and the Cinnamon session exported no RemoteDesktop interface and raised PORTAL-002.

The README's run record: On GNOME Shell 48.7, eis probe with the dialog allowed and declined, where the connection held with three devices, and the libei inject loop with the witness, 10 of 10 steps paired. On KDE Plasma 6.5.6, eis probe with the dialog allowed. On KDE Plasma 6.8.2, the libei inject loop, 10 of 10. A touch through libei on GNOME Shell 48.7, on 2026-11-28, was sent and not delivered.

The project's record of runs, reconciled on 2026-12-04, adds:

  • Input to pixels with the focus wait, on KWin 6.8.2 on 2026-11-28: 22 of 22 keys.
  • Touch through libei, again, on GNOME Shell 48.7 and KWin 6.8.2 on 2026-11-29: A tap delivered on each. The record names no drag on this route.
  • Markers read from the DMA-BUFs of a graphics driver, and input to pixels on them, on KWin 6.7.4 on a GPU function on 2026-11-29: dsido eis inject with the witness and --markers, and dsitell glass: 22 of 22 steps were seen by the window and shown by a captured buffer.

The record, through 2026-12-04, has no run on a desktop that sent the ready request that version 3 of ei_device asks of a client.

A real libei connection, from two desktops

On 2026-12-04, dsisee eis probe --out eis.json from the released 0.4.0 build opened a RemoteDesktop portal session (which always shows its dialog), connected to libei, and recorded the connection on two virtual machines.

GNOME Shell 50.1, libei 1.5.0KWin 6.8.2, libei 1.6.0
RemoteDesktop portal version22
Seats announced11
Devices announced33
Devices resumed33
ei_device version of each device22
ConnectionStill open when the window endedStill open when the window ended

Each desktop announced a pointer with buttons and scroll, a keyboard, and an absolute pointer with buttons and scroll. The health summary on GNOME read:

  route: libei through the RemoteDesktop portal             working
      a libei connection was opened and stayed open; a seat was announced 0.9 ms after the handshake; 3 device(s) were announced, the first 1.5 ms after the handshake; 3 resumed, the first 1.5 ms after the handshake  [records 7, 9, 11-14, 16-17]

Those times are from a virtual machine. The ready request wasn't exercised: Release 0.4.0 answers a device's done with ei_device.ready where the device is at ei_device version 3, and both desktops announced their devices at version 2. The tool said so: "ei_device.ready: Not sent, since the devices were announced at ei_device version 2, which has no such request". These runs show libei through the portal working with 0.4.0 on GNOME Shell 50.1 and KWin 6.8.2, and they say nothing about the ready request.

How to check it with lamco-dsi-tools

dsisee input routes                               # which input routes the desktop advertises; sends nothing
dsisee portal diagnose --wake-portal              # RemoteDesktop's version and AvailableDeviceTypes
dsisee eis probe --duration 15 --out probe.json   # open a libei connection (dialog) and report its life
dsisee eis observe --duration 10 --out eis.json   # every libei event of a connection
dsitell health probe.json                         # the input function and its routes, with findings

eis probe reports each step of opening the connection, how long the dialog took to be answered (kept apart from the stack's own time), the devices, and, if the connection closed, when, measured from the handshake and from the last device event. It names no cause and sends no input. In dsitell health the libei route is read from the portal's RemoteDesktop interface and its version, and from the connection when the libei dissector ran.

Driving it with dsido

dsisee input witness --duration 60 --out witness.json &   # a window that records what reaches it
dsido eis inject text "hello" --out inject.json           # type through libei; shows the dialog
dsitell loop inject.json witness.json                     # pair each step with the event the window saw
dsido eis replay sway-inject.json --out gnome-inject.json # an action recorded on another route, sent through libei

Give the witness window the keyboard focus before the keys are sent: The dialog may leave the focus elsewhere. dsitell loop says when a key step wasn't seen for that reason, and --wait-witness 20s holds the injection until the witness has the focus.

Findings

  • PORTAL-002: The portal has no RemoteDesktop interface.
  • PORTAL-003: The RemoteDesktop interface is older than version 2.
  • INPUT-001: No input route was found.
  • INPUT-002: The libei connection closed while it was being watched.
  • INPUT-003: No libei device was resumed.
  • INPUT-004: Opening the libei connection failed.
  • INPUT-005: Input couldn't be injected through a route.
  • INPUT-011: An injector sent nothing, since no witness window had the keyboard focus.
  • INPUT-012: A touch was asked for where there's no touchscreen to send it through.
  • INPUT-013: A touch was sent to a position in no region of its device.

Related