I have a reverse ssh tunnel through a middleman server set up and working. I'm running Kubuntu 12.04 here and on the remote machine.
I want to open a remote desktop session. Until now I've been using Team Viewer to log in to the remote desktop. I'd like to achieve similar results without Team Viewer. I understand X over SSH will achieve this. If I need vnc, that's fine too.
Here's my issue at the moment. When I am connected to the remote machine via the tunnel I get this error:
$ startkde &
$ $DISPLAY is not set or cannot connect to the X server.
I'm connecting with the -Y SSH option and using keys (not passwords). Everything related to SSH seems to be working fine. The only problem I see is with X. Here's another example:
$ xeyes &
$ Error: Can't open display:
And
$ echo $DISPLAY
$
(returns nothing)
These answers seem relevant but I haven't been able to understand them in enough detail to work out a solution in my case:
Can I launch a graphical program on another user's desktop as root?
-L
option or in a live connection - see theESCAPE CHARACTERS
section ofman ssh
. – peterph Jul 09 '13 at 14:38