If I start Ubuntu 22 with kernel argument `systemd.unit=multi-user.target` (i.e. non-graphical) then start Wayland with `XDG_SESSION_TYPE=wayland dbus-run-session gnome-session` then DBUS_SESSION_BUS_ADDRESS gets set to something like "DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-mcSf5L11K8,guid=b86aac9a59f39dddad072fc86546c3f8" and the Firefox snap errors with "/user.slice/user-1000.slice/session-1.scope is not a snap cgroup".
But Firefox launched with `DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus" firefox` from a Terminal will run.
Note that DBUS_SESSION_BUS_ADDRESS is already set in the non-graphical shell before starting the Wayland session. It is overriden by dbus-run-session (as documented in the man page).
I don't understand these systems, but it would seem to me that the Firefox snap is assuming that it's being run from a top-level session. If a Wayland is started by a user with dbus-run-session then it can't talk to it because it's assuming the top level D-bus.
This might also be a clue as to why things don't work for remote sessions. Perhaps snaps assume (indirectly) that they're only being run in a top-level local session. A "standard session" if you like.
Incidentally, the Firefox is happy if I use `startx` to get a session.
Some clues:
If I start Ubuntu 22 with kernel argument `systemd. unit=multi- user.target` (i.e. non-graphical) then start Wayland with `XDG_SESSION_ TYPE=wayland dbus-run-session gnome-session` then DBUS_SESSION_ BUS_ADDRESS gets set to something like "DBUS_SESSION_ BUS_ADDRESS= unix:abstract= /tmp/dbus- mcSf5L11K8, guid=b86aac9a59 f39dddad072fc86 546c3f8" and the Firefox snap errors with "/user. slice/user- 1000.slice/ session- 1.scope is not a snap cgroup".
But Firefox launched with `DBUS_SESSION_ BUS_ADDRESS= "unix:path= $XDG_RUNTIME_ DIR/bus" firefox` from a Terminal will run.
Note that DBUS_SESSION_ BUS_ADDRESS is already set in the non-graphical shell before starting the Wayland session. It is overriden by dbus-run-session (as documented in the man page).
I don't understand these systems, but it would seem to me that the Firefox snap is assuming that it's being run from a top-level session. If a Wayland is started by a user with dbus-run-session then it can't talk to it because it's assuming the top level D-bus.
This might also be a clue as to why things don't work for remote sessions. Perhaps snaps assume (indirectly) that they're only being run in a top-level local session. A "standard session" if you like.
Incidentally, the Firefox is happy if I use `startx` to get a session.