I would like to remotely ssh into my Ubuntu box and run applications which require a display (a la
gedit) through my ssh console and have those applications spawn on the Ubuntu desktop (
not on the machine I am ssh'ing from).
I have achieved success in doing this on Redhad and SLED (running
Xvnc) by assigning the DISPLAY environment variable to the appropriate value (:0.0, for example). However, Ubuntu presents other difficulties (it uses
vino/
gnome, not
Xvnc) which seem to be tied to
xauth.
After setting DISPLAY and issuing a command like
gedit, I am returned the following error. (On my Redhat and SLED systems, simply setting DISPLAY to the appropriate value is all I have to do.)
Code:
myuser@myhost:~$ gedit
Invalid MIT-MAGIC-COOKIE-1 keycannot open display:
Run 'gedit --help' to see a full list of available command line options.
If I peek at my desktop's environment - specifically the XAUTHORITY variable - and apply that same value to my shell session, the command runs without errors and the
gedit window spawns on the desktop. But is there a way to figure out the value of XAUTHORITY without looking at my desktop session? Moreover, is there a better approach to this problem than trying to set DISPLAY and XAUTHORITY to the appropriate values?
Any thoughts are greatly appreciated. Thanks!