Bugzilla – Bug 1031501
system:snappy/snapd: Snaps can't access X11 screen on KDE Tumbleweed
Last modified: 2017-06-07 12:43:29 UTC
When trying to launch a graphical snap it fails to access the X11 screen and thus fails to launch. For example: > keepassxc No protocol specified QXcbConnection: Could not connect to display :0 Avbruten (SIGABRT) > dwarf-fortress Gtk-Message: Failed to load module "canberra-gtk-module" No protocol specified Display not found and PRINT_MODE not set to TEXT, aborting. This is on openSUSE Tumbleweed with KDE Plasma 5.9.2 snap interfaces give this: https://pastebin.com/vqLxV0zd
I can reproduce this also on 42.2 with latest snapd packages from http://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_42.2/ simon@linux-82h5:~> keepassxc No protocol specified QXcbConnection: Could not connect to display :0 Aborted Looking into possible reasons for this.
I took one more step and installed Gnome Shell in my 42.2 virtualbox and there those applications work as they should. Wondering if there is something different in the gtk/qt libs we ship in Ubuntu KDE can't deal with. Those get included by default on those snaps.
Ok, I've found the reason or the not starting application. $ snap run --shell krita krita$ export XAUTHORITY=/home/$USER/.Xauthority krita$ $SNAP/command-krita.wrapper .. With this krita starts up fine. So the reason is that the XAUTHORITY environment variable is not setup properly.
After some more research the real problem comes down to XAUTHORITY being set to /tmp/xauth-1000-_0 which can't be passed into the snap environment as each snap gets its private /tmp. The environment variable is correctly set in the snap environment but no application can access the referenced xauth file as it is not available. This needs a change in snap-confine to correctly pass the current xauth file into the snap environment. Filed an upstream bug for this at https://bugs.launchpad.net/snapd/+bug/1677513
A fix for this was merged upstream. See https://github.com/snapcore/snapd/pull/3177 for more details. Will be released with 2.25
I'm still getting this issue with 2.25 on Tumbleweed.
Resolved in the latest 2.25 packages for snapd.