WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: X11 Forwarding.  (Read 10789 times)

Offline ferite

  • Newbie
  • *
  • Posts: 22
X11 Forwarding.
« 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. I tryed too, to override the line "X11Forwarding" in sshd_config, but the result is the same.

Thanks for reading and for your help.


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: X11 Forwarding.
« Reply #1 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.
« Last Edit: November 12, 2013, 07:18:34 PM by gerald_clark »

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: X11 Forwarding.
« Reply #2 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.

t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: X11 Forwarding.
« Reply #3 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.

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: X11 Forwarding.
« Reply #4 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.
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: X11 Forwarding.
« Reply #5 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?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: X11 Forwarding.
« Reply #6 on: November 14, 2013, 09:05:43 AM »
As I stated before, you need xauth.

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: X11 Forwarding.
« Reply #7 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
« Last Edit: November 14, 2013, 05:56:41 PM by ferite »

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: X11 Forwarding.
« Reply #8 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/

t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: X11 Forwarding.
« Reply #9 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.  :)

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10970
Re: X11 Forwarding.
« Reply #10 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.
The only barriers that can stop you are the ones you create yourself.

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: X11 Forwarding.
« Reply #11 on: November 16, 2013, 09:58:05 PM »
Hi curaga: Are you also able to run the remote GUI (window manager) on the client?
t(w)o be(ers) or not t(w)o be(ers) that is the question

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10970
Re: X11 Forwarding.
« Reply #12 on: November 16, 2013, 11:31:39 PM »
I don't see why you couldn't, but I can't test it now.
The only barriers that can stop you are the ones you create yourself.

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: X11 Forwarding.
« Reply #13 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.
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: X11 Forwarding.
« Reply #14 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.