Red Hat Bugzilla – Bug 1303359
[Zenity] DBUS_SESSION_BUS_ADDRESS not set for ssh, systemd service or cronjob
Last modified: 2016-12-20 14:02:47 EST
Description of problem: By logging in from remote computer over ssh and setting DISPLAY variable to :0 in order to use local X applications, zenity is unable to work entirely. For example "zenity --question" works and displays a dialog, while "zenity --notification --text 'Text'" throws an error and nothing happens.
$ zenity --question
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
$ zenity --notification --text "Test"
** (zenity:4035): WARNING **: Error showing notification: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files
Version-Release number of selected component (if applicable):
How reproducible: Always
Steps to Reproduce:
1. Login To computer A from remote computer B using ssh
2. Set DISPLAY variable to :0
3. Try to use zenity
The cause for this issue is that environment variable DBUS_SESSION_BUS_ADDRESS is not set for user ssh session, cronjob or systemd service file. None of these works with zenity --notification or notify-send.
By user I mean I have used this services as the same user that owns the Desktop.
There is nothing zenity can do about this. This is just the way ssh sessions work - they don't forward the session bus. Changing that would require changes in openssh.
I personally could live without ssh session support, but the most useful thing for zenity is background scripts and user notification. Right now it doesn't work from user cron jobs or user system service if DBUS_SESSION_BUS_ADDRESS is not provided for which I found methods to set it only in some hackish ways ?
I have noticed systemd --user already sets variables for DISPLAY and XAUTHORITY , could it also set variable for DBUS_SESSION_BUS_ADDRESS?
Or why zenity dialogs works fine with just DISPLAY variable set while --notification requires also DBUS_SESSION_BUS_ADDRESS. Could it be done in some other way to make it more simple and not require additional environment variable which is not available by default?
I don't think this is anything we would be implementing in openssh. As far as I understand it it would require D-bus tunneling (over secure channel) between remote (where zenity is running) and your desktop (where notification is shown). It is something different than only X11 forwarding.
It might be possible, if you forward the port using SSH RemotePortForwarding, but I was unable to make it work. There is nice information guide about RemoteDBus . You might be more lucky if you try to check with systemd guys.
openssh-7.2p2-11.fc24 selinux-policy-3.13.1-191.8.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-99191c4aab
Reverting to NEW state. BZ was switched to MODIFIED due to wrong bodhi update.
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 23 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.
Not sure if it was fixed by someone intentionally, it seems it is working without having to set DBUS_SESSION_BUS_ADDRESS.