28

I would like to ask about running X-applications via SSH as follows.

I have Linux Desktop running SL6.3 with Gnome 2x. On Android tablet running CM9,I have Connectbot and X-Server for Android. I can logged into Linux box with Connectbot via SSH successfully.

I set up the options for X-forwarding in /etc/ssh/sshd_config on Linuxbox.(X11Forwarding yes).

Now when I use the -X option, ssh -X username@hostname:port , Connectbot repeatly asking password even I supplied a correct one,and says- 'Authentication method 'password' failed.

How could I successfully run X-applications over SSH in the tablet ? The environment is home wireless network.

tshepang
  • 12,111
  • 21
  • 91
  • 136
user1733435
  • 281
  • 1
  • 3
  • 4
  • 2
    Thanks Paul,I shall try VNC. I still would like to know how can I acheived since now native X-server for Android is available,so I would just run single X-Application,rather than full VNC desktop,like SystemMonitor,for example. Is it still possible to get such configuration? https://play.google.com/store/apps/details?id=au.com.darkside.XServer&hl=en – user1733435 Oct 10 '12 at 02:43

2 Answers2

20

I know this thread is old... but, I wanted to make sure I clarified something misleading in paulsm4's answer...

X is backwards... You do not connect to an X server. You run the server on your local machine (what he is calling the client is actually the server). When you connect to a remote Nix box that has the X libs installed, and you add the -X switch to your SSH command, ssh will forward X requests back to you. The program running on the other side (Gnome, Chrome, PyCharm, etc) will be your X Client, and it will be upstreamed back to your desktop that contains the X Server. Here it is as a sequence Diagram:

User                                         Remote
-----------------------------------------------------------------------
User Inits SSH -X Session -----------------> SSH Server Auth User
                                                      |
                                                      V
SSH Session is established <---------------- SSH User is Authenticated
             |
             V
User Initiates App on server --------------> App Starts Running
                                                      |
                                                      V
                                             App Writes output to X Server
                                                      |
                                                      V
Xorg receives write commands <-------------- SSH Tunnels that back to User
             |
             V
Writing occurs on desktop
-----------------------------------------------------------------------

Most of the time, the X Server and X Client are the same (as happens on your local Desktop). Therefore, once the client writes to X, the local X server writes to the screen. The display process is actually done on the user's computer, where-ever it is, your computer becomes the server. Crazy ain't it?

Kevin Fries
  • 216
  • 2
  • 5
  • 7
    I noticed that this meme about things being “the wrong way around” has misled people for decades. It is *not* the wrong way around. X is a display server. So the thing that does the rendering (the display) is obviously the server. Even if it is on your ssh client. And even if you connect to a server to run programs there, they are still clients to the display server. There’s nothing misleading or confusing about this. There’s just two servers. The display server and the “server” server. Which happen to be each other’s clients for each other’s uses. – Evi1M4chine Dec 31 '16 at 18:15
  • 1
    You most definitely connect to the X server. X doesn't connect to anything by itself. The X server runs on the machine that you are looking at (the local machine); it does the drawing. – Carlo Wood Dec 19 '17 at 01:54
8

You could install on your android box the following X11Server

https://github.com/nwrkbiz/android-xserver

and follow few next steps:

  1. start android-xserver
  2. start ssh client like ConnectBot (remote machine shoud have ForwardX11 yes)
  3. Run xclock, xterm ... any other X11 utilities

Be aware because the android-xserver, X11 implementation it is not a complete one.

Community
  • 1
  • 1
Cristian Florescu
  • 1,660
  • 20
  • 24
  • 2
    Thank you @myset also for taking time to answering,yes I will have to contempt with until it could run arbitrary applications like vim or chrome. :-) – user1733435 Oct 15 '12 at 02:54
  • 3
    Check the guide at: https://bbs.linuxdistrocommunity.com/discussion/1188/x11-forward-to-your-phone-tablet - This explains a bit better. – Meetai.com Jul 06 '18 at 17:28