Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: ferite on November 12, 2013, 06:31:51 PM

Title: X11 Forwarding.
Post by: ferite on November 12, 2013, 06:31:51 PM
Hello.

Before all, I did a search for the topic I am interested on, but could not find a concrete solution.

I am running OpenSSH on TC. Despite I can ssh from my Windows PC (MobaXterm), I could not forward the applications GUI. I am getting the message "Error: no display specified".

I tryed to add -ac option and remove "-nolisten tcp" from .xsession like recommended here http://forum.tinycorelinux.net/index.php?topic=7470.0 (http://forum.tinycorelinux.net/index.php?topic=7470.0). I tryed too, to override the line "X11Forwarding" in sshd_config, but the result is the same.

Thanks for reading and for your help.

Title: Re: X11 Forwarding.
Post by: gerald_clark on November 12, 2013, 07:11:39 PM
You need xauth installed.  So install Xorg-something-bin.tcz or Xlibs.
You also need an X server on your windows machine.
Title: Re: X11 Forwarding.
Post by: beerstein on November 12, 2013, 08:12:24 PM
Hi:
The connection is between a ssh server and a ssh client. After install the server and client config files need to be properly set up. X-Forwarding is "no" as default and these lines in the config files need to be edited.
After that:
$ ssh user@IPofserver
should give you a connection. To have a GUI app from the server running on your client you need:
$ ssh -X user@IPofserver
If this does not work please try:
$ ssh -Y user@IPofserver
in any case, you need the user password from the server user to log in.
Please let me know if it works. It worked for me.
I even wanted to go one step further and start the window manager on the server (TInyCore4.7.7) and run it on the client. But this did not work. I still have to figure that out.

Title: Re: X11 Forwarding.
Post by: ferite on November 13, 2013, 04:13:51 PM
You need xauth installed.  So install Xorg-something-bin.tcz or Xlibs.
You also need an X server on your windows machine.

Hi Herald. I just installed  Xorg-7.7-bin.tcz. So now I have /usr/local/bin/xauth. What should I do next?.


Hi:
The connection is between a ssh server and a ssh client. After install the server and client config files need to be properly set up. X-Forwarding is "no" as default and these lines in the config files need to be edited.
After that:
$ ssh user@IPofserver
should give you a connection. To have a GUI app from the server running on your client you need:
$ ssh -X user@IPofserver
If this does not work please try:
$ ssh -Y user@IPofserver
in any case, you need the user password from the server user to log in.
Please let me know if it works. It worked for me.
I even wanted to go one step further and start the window manager on the server (TInyCore4.7.7) and run it on the client. But this did not work. I still have to figure that out.


Hi beerstein.

Do you managed X11 to work without installing extra packages?. I have edited /usr/local/etc/ssh/sshd_config on the TC PC to enable forwarding. I have set too, a root password and the ssh sessions have not problem by logging in with it.

At the other end I have a Windows PC running MobaXterm that has an emmbedded X server. Moba does not need additional settings. You just start ssh session to the Linux box. When you run a GUI app, it just opens a new window. With Ubuntu for instance you only need to install OpenSSH, and you can start the forwarding.
Title: Re: X11 Forwarding.
Post by: beerstein on November 14, 2013, 12:36:24 AM
Hi:
I used TCL 4.7.7 running the openssh.tcz (client and server) and I accessed from Mint14 where the ssh client is part of the installation. (not the server)
I also was able to connect from another TCL 4.77 system where openssh was installed.
When Windows comes into play it may be different, because windows handles the password encryption different. I did not try Windows so far as a ssh server.
Title: Re: X11 Forwarding.
Post by: ferite on November 14, 2013, 08:47:38 AM
Hi:
I used TCL 4.7.7 running the openssh.tcz (client and server) and I accessed from Mint14 where the ssh client is part of the installation. (not the server)
I also was able to connect from another TCL 4.77 system where openssh was installed.
When Windows comes into play it may be different, because windows handles the password encryption different. I did not try Windows so far as a ssh server.

Hi beerstein:

In a similar way to your's,  I have TC Plus 5.0.2 with Openssh installed. To remove Windows of the equation, I tested the ssh connection from the same PC:

Code: [Select]
ssh -X root@localhost
When I try to launch a GUI app, the same error messages I got on Windows are presented:

Code: [Select]
tc@box:~$ firefox

(process:7878): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Error: no display specified

Code: [Select]
tc@box:~$ editor
Can't open display:

Are you sure that besides openssh, you did not have to install another extension?
Title: Re: X11 Forwarding.
Post by: gerald_clark on November 14, 2013, 09:05:43 AM
As I stated before, you need xauth.
Title: Re: X11 Forwarding.
Post by: ferite on November 14, 2013, 11:00:27 AM
As I stated before, you need xauth.

Yes, after installing Xorg-7.7-bin.tcz I got /usr/local/bin/xauth. What should I do with it?.


By the way, I edited /etc/sysconfig/Xserver, changing Xvesa for Xorg. I got nicer graphics, but nothing change on forwarding

I tried to export DISPLAY before try the forwarding:
Code: [Select]
root@box:~# export DISPLAY=192.168.200.124:0.0
root@box:~# editor

The result is then:

Code: [Select]
Can't open display: 192.168.200.124:0.1
Title: Re: X11 Forwarding.
Post by: beerstein on November 14, 2013, 10:04:23 PM
Hi:
ssh -X root@localhost ( I think root within ssh is a no no?)
Now I remember that I saw this error message before  " Can't open display: 192.168.200.124:0.1" when I started to play around with ssh.
I will try to run TCL 5.02 on another machine and connect from MINT14 into it.

btw did you take a look at the openssh article from one of our members (Firewall Engineer)
http://firewallengineer.wordpress.com/2012/04/01/how-to-install-and-configure-openssh-ssh-server-in-tiny-core-linux/

Title: Re: X11 Forwarding.
Post by: ferite on November 15, 2013, 07:02:45 AM
Hi:
ssh -X root@localhost ( I think root within ssh is a no no?)
Now I remember that I saw this error message before  " Can't open display: 192.168.200.124:0.1" when I started to play around with ssh.
I will try to run TCL 5.02 on another machine and connect from MINT14 into it.

btw did you take a look at the openssh article from one of our members (Firewall Engineer)
http://firewallengineer.wordpress.com/2012/04/01/how-to-install-and-configure-openssh-ssh-server-in-tiny-core-linux/

Hi beerstein. Thanks for taking the time to help me with my forward issue.

Regarding the article, yes, actually it is what I followed to enable ssh in my system.  :)
Title: Re: X11 Forwarding.
Post by: curaga on November 16, 2013, 01:42:53 AM
It works for me. Install openssh, specify "x11forwarding yes" and "xauthlocation /usr/bin/xauth", I can forward X apps from a TinyCore install with no other extensions installed.

Study your logs from both your client and server.  To save the sshd logs enable syslog with the syslog bootcode, and edit the sshd_config Loglevel config entry.
Title: Re: X11 Forwarding.
Post by: beerstein on November 16, 2013, 09:58:05 PM
Hi curaga: Are you also able to run the remote GUI (window manager) on the client?
Title: Re: X11 Forwarding.
Post by: curaga on November 16, 2013, 11:31:39 PM
I don't see why you couldn't, but I can't test it now.
Title: Re: X11 Forwarding.
Post by: beerstein on November 17, 2013, 01:03:19 PM
thank you for that. you do not have to test it now but how should the command look:
after logging in:
$ ssh -X tc@192.168.1.12  (f.i.)
then I see the terminal on the server on my client.
When I typed
$ startx
here it stated the window GUI on the server and not in my terminal window on the client.
Title: Re: X11 Forwarding.
Post by: gerald_clark on November 17, 2013, 01:23:05 PM
You don't run startx.
You have to have an X server running on the machine that made the ssh connection.
From the ssh session you run the X client program like mnttool.
Title: Re: X11 Forwarding.
Post by: curaga on November 18, 2013, 12:23:23 AM
Yep, as Gerald said, starting a WM is no different from starting an app. Just type "flwm" or whatever your desktop is.

Obviously your current X screen shouldn't have a WM running.
Title: Re: X11 Forwarding.
Post by: ferite on November 18, 2013, 08:18:55 AM
It works for me. Install openssh, specify "x11forwarding yes" and "xauthlocation /usr/bin/xauth", I can forward X apps from a TinyCore install with no other extensions installed.

Study your logs from both your client and server.  To save the sshd logs enable syslog with the syslog bootcode, and edit the sshd_config Loglevel config entry.

Hi Curaga. I found  "x11forwarding" on /usr/local/etc/ssh/sshd_config. When should I set xauthlocation?. I added this setting to sshd_config, but seems to take no effect.
Title: Re: X11 Forwarding.
Post by: curaga on November 18, 2013, 08:32:28 AM
In the same file, as you did. It's not commented there like many other rarely used settings.
Title: Re: X11 Forwarding.
Post by: gerald_clark on November 18, 2013, 09:02:14 AM
The only line you need to change in /usr/local/etc/ssh/sshd_config  is
#X11Forwarding no
to
X11Forwarding yes

Then run '/usr/local/etc/init.d/openssh restart'
Title: Re: X11 Forwarding.
Post by: Lee on November 18, 2013, 02:55:46 PM
I changed
    #X11Forwarding no
to
    X11Forwarding yes

and restarted the openssh server and didn't have any luck connecting to it with either PuTTY or openssh on Cygwin from my Windows 7 box.

I had a feeling there might be something lacking or mis-configured in my ssh clients so I did a web search for "X server for windows" and found a reference and link on stackoverflow.com to Mobatek's "MobaXterm 6.6".  I grabbed the free (GPL) version of it to try out.  It worked like a charm, verifying that in fact my sshd config is correct and my other Windows-side ssh programs are in some way not correct.

It is very strange to see my remote linux apps seeming to share a desktop with local Windows apps - and wbar looks kind of stupid in the bottom center, spanning the gap between two monnitors.    :)

I've been pondering the whole remote GUI thing off and on for a while and I hank you experts for making clear how to go about it.

Title: Re: X11 Forwarding.
Post by: ferite on November 22, 2013, 04:32:51 PM
Thanks to all for your help. Finally I could make it work. My misstake, I was exporting the IP of the Host machine as Dsiplay, not client IP where the X server actually runs. By the way, anyone know how can be omited the exportation of the Display?.
Title: Re: X11 Forwarding.
Post by: gerald_clark on November 22, 2013, 06:44:08 PM
ssh -X automatically sets the DISPLAY.  You should not be changing it.
Title: Re: X11 Forwarding.
Post by: denis76 on February 08, 2015, 05:25:08 AM
On my remote machine $DISPLAY was empty because "xauthlocation /usr/bin/xauth" was missing in ssh_config.
(TinyCore V6.0)