Skip to content

Instantly share code, notes, and snippets.

@Cretezy
Created May 21, 2017 18:38
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cretezy/dc64ed4519c63c3eb636fba354f93a1f to your computer and use it in GitHub Desktop.
Save Cretezy/dc64ed4519c63c3eb636fba354f93a1f to your computer and use it in GitHub Desktop.
systemd user "Failed to connect to bus: No such file or directory"

Simply add this snippet...

export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"

...to .bashrc or .zshrc or any file ran on login.

@subsr97
Copy link

subsr97 commented Jul 25, 2018

It doesn't work for me.
When I try systemctl --user , I get Failed to connect to bus: No such file or directory.
Does XDG have something to do with Gnome and KDE? Because I have KDE.

EDIT:
Wow it works!
Sorry. Previously I was logged in as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment