XDG_RUNTIME_DIR, IntelliJ, and Podman

As I understand from this earlier thread (and from inspecting the value of XDG_RUNTIME_DIR myself), snappy sets the value for XDG_RUNTIME_DIR to /run/user/id -u/snap.$SNAP_NAME. When I open up a terminal in Intellij and echo the value of XDG_RUNTIME_DIR, it shows that: /run/user/1000/snap.intellij-idea-ultimate. However, when I do podman run ... from within the IntelliJ terminal, I get an error:

Error: sd-bus call: Permission denied: OCI runtime permission denied error

I presume this is because podman is not able to access the userspace dbus socket located in XDG_RUNTIME_DIR and is instead instantiating XDG_RUNTIME_DIR to something else to try to connect to dbus, but it is finding the root dbus socket?

If I run podman run inside a normal terminal, it works fine, without any issues, so I presume this has to do with how XDG_RUNTIME_DIR is set.

This should be fixed in snapd 2.48 for classic snaps. What is the output of snap version?

snap    2.47.1-1.fc32
snapd   2.47.1-1.fc32
series  16
fedora  32
kernel  5.9.11-100.fc32.x86_64

Is 2.48 release?

you can check with

snap info snapd

I’m planning to wok a bit on updating the packages on Friday. So, sometime next week there should be a 2.48 snapd in updates-testing.

The fix was available for a while, but hidden behind an experimental flag. Please run the following command:

snap set core experimental.classic-preserves-xdg-runtime-dir=true

Since 2.48, this is the default setting and one no longer will need to set the flag explicitly.