I was playing with my phone (that runs a Linux/X stack) last night and I managed to ssh into my desktop and run an application and have it show up on my phone. It was awesome.

Today I'd like to sort of do the opposite. I want to view an application running on my phone on my PC. I could install a SSH server on my phone but I frankly don't fancy that purely for security reasons. I want this to be initiated from my phone.

Is there a way to connect from my phone and tunnel the PC's X connection back to the phone and then run an application on the phone that show on the PC?

But I need this tunnelled over SSH. And to the PC the connection would look like it was coming from a localhost (where the ssh server is) so I'm not sure it needs xhost. My understanding of this gets a bit blurry because I don't know what TCP port X runs on. I don't know what I'm supposed to forward and I don't know how to construct the DISPLAY=... statement on the phone to use the forwarded port.
–
Oli♦Nov 4 '10 at 10:12

Actually I should notice that with GDM X is started with "-nolisten", you can check that with: ps -ef | grep nolisten. You will need to change that to start with. I am not sure how to change it. Once X is listening I believe the TCP port is 6000 + display nr
–
João PintoNov 4 '10 at 10:30

Urgh. At that rate it might just be easier to run a SSH server on my phone that only binds to localhost. From there I could SSH to my desktop and run another SSH connection back (tunnelled over the first) with X forwarding and in that run the program. Sounds nasty.
–
Oli♦Nov 4 '10 at 11:02