I’ve used multiple operating systems; Fedora, Debian and Ubuntu and with them all I have installed and worked with SSH. I recently started to look into openSuSE just to get a flavour of using it day to day. My problem is the following with SSH:
I have a computer and a server (in my tests there is someone logged onto the Server). I SSH into the server (as the user that is logged into the Server) and try to get Zenity to display a dialog on the server. In the other flavours I have used I just use:
export DISPLAY :0
Then called Zenity, but I get Gtk-WARNING **: cannot open display: :0.
Running ‘who’ shows that the user logged onto the server is running under display :0 so I am not too sure what the problem is. Any tips or hints would be greatly appreciated.
-----BEGIN PGP SIGNED MESSAGE-----
I have no idea why that would ever work… that’s not a valid export
Your statement would only export an existing DISPLAY variable (if set)
and would probably just fail on the last :0 parameter.
Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
To use X requires that the X authentication works.
If you are using gdm as display manager, then it does not use $HOME/.Xauthority. Instead, it has a file elsewhere and sets XAUTHORITY to be the path to that file. Your SSH session probably does not have that definition for XAUTHORITY. You either need to export the xauth information to your “$HOME/.Xauthority” file, or define the needed value of XAUTHORITY in the environment.
I have found that in some circumstances, I also need to define XAUTHLOCALHOSTNAME in the environment.
Thanks for the replies.
@ab - sorry in my haste to type (rather than copy and paste which I should have done) I did indeed mean export DISPLAY=:0.0
@nrickert - thanks. do you have any links that I could read to increase my knowledge of ssh and xauthority so that I can understand what I need to do and then how?
If you switch display manager from “gdm” (which you are probably using) to “kdm”, that might already solve your problem. However, that might interfere with opening the default gnome keyring when you login (mostly a problem for WiFi, I think).
“man xauth” - lol, should have thought of that
Anyway thanks for the help its working now. I had to modify my script to find the xauthority file of the user logged in and then as you said: export XAUTHORITY=<path to xauthority file>/database and voila the dialog appears on the other machine.