The wayland interface and auto-connect


#1

I’ve been experimenting with confined Wayland clients on Ubuntu Classic and noticed that they need to be manually connected to the Wayland interface. This seems to be an unnecessary inconvenience when deploying.

The documentation says “Auto-connect: yes” and, looking at the wayland.go code in snapd, it looks as though auto-connect should be enabled.

Can we enable auto-connect for wayland snaps? (And where?)


The simplest snap that exhibits this behaviour is mir-kiosk-apps. On a desktop supporting Wayland (e.g. GNOME Wayland):

snap install mir-kiosk-apps --edge
mir-kiosk-apps # FAILS
snap connect mir-kiosk-apps:wayland
mir-kiosk-apps # WORKS

#2

It seems to auto-connect here:

$ snap install mir-kiosk-apps --edge
mir-kiosk-apps (edge) 0.3.0 from Canonical✓ installed
$ snap connections mir-kiosk-apps
Interface  Plug                    Slot      Notes
network    mir-kiosk-apps:network  :network  -
opengl     mir-kiosk-apps:opengl   :opengl   -
wayland    mir-kiosk-apps:wayland  :wayland  -

Presumably there is something more to your system? Given what you work on, is there another installed snap providing a wayland slot?


#3

Yes, there are several.

Your question implies that if there are several slots (from the system and from snaps), then auto-connect doesn’t choose any? Is that configurable? (What I’d like to happen on Classic is that it connects to “:wayland”.)


#4

That appears to be the current policy. From the look of the code, this should have been logged somewhere:


#5

Thanks. I’ve suggested changing the policy: https://github.com/snapcore/snapd/pull/7417