maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Newbie (https://talk.maemo.org/forumdisplay.php?f=26)
-   -   forwarding X apps from N800 to desktop (https://talk.maemo.org/showthread.php?t=6015)

gsagers 2007-04-26 16:19

forwarding X apps from N800 to desktop
 
Let me preface this post by saying that I know about vncserver on the n800, vncserver on the desktop and RDP. All work fine to and from n800 and desktop, but I'd like a single app to be remotely displayed

I'd like to forward an X11 app on the n800 to my local X server on my desktop. I've set up OpenSSH, made sure that X forwarding is on in /etc/ssh/sshd_config, and that an XDisplayOffset of 10 is set, and restarted the ssh server. I then ssh -X user@n800, but my $DISPLAY variable on the n800 is still 0.0, rather than 10.0, as it should be. Manually doing an export DISPLAY=':10.0' doesn't work either, nothing displays on my local X server.

The other way around (ssh -X from n800 to desktop) and then running an app works fine. The DISPLAY variable (on desktop at that point) is properly set to 10.0, and I've compared the sshd_config files from n800 and desktop line-by-line, and they're identical for everything that should affect TCP and X forwarding.

Is this a limitation with Matchbox and Hildon, or am I doing something stupid here? As I say, I know how to forward X connections over SSH normally, but this isn't working.

benny1967 2007-04-27 17:04

Re: forwarding X apps from N800 to desktop
 
I can't even do "normal" (=non-SSH'ed) forwarding from the 770 to my desktop. It seems the applications on the 770 just ignore $DISPLAY

gsagers 2007-04-27 21:28

Re: forwarding X apps from N800 to desktop
 
Yeah, that's my take on it, too. Even if $DISPLAY is set, nothing happens - the app never loads, and I never get a prompt back w/o Ctrl+C

benny1967 2007-04-28 11:39

Re: forwarding X apps from N800 to desktop
 
mhm.... here the application does load/run, only it shows up on the 770 and not on the PC specified via DISPLAY. strange thing is I dont even get errors about not being able to connect to the display etc. ...

gsagers 2007-04-28 13:24

Re: forwarding X apps from N800 to desktop
 
Little more testing.... It seems to depend which app it is. If I run vncviewer, gpe-calendar, pwsafe, fmradio, and most others, they launch and display on the n800 (this is with ssh -X, and DISPLAY still as 0.0).

browser and mediaplayer-ui, on the other hand, don't launch, and just drop back to a shell.

Now, after manually setting $DISPLAY to 10.0 (export DISPLAY=':10.0') during the same SSH session, fmradio fails with Gtk - cannot open display:, as do pwsafe and gpe-calendar.

Vncviewer just returns to a prompt, no error. The browser and mediaplayer-ui just return to a prompt also, no error.

So, it appears that $DISPLAY is honored, at least by most apps, but something else is going on to prevent them from using it.

Edit: This is all as user, no "sudo su" or ssh -X root@n800 that could be confounding.

benny1967 2007-04-29 15:44

Re: forwarding X apps from N800 to desktop
 
I'm not sure... Try the following:

On your GNU/Linux desktop PC, type
DISPLAY=10.0.0.126:0; xterm; echo $DISPLAY
(with 10.0.0.126 being a non-existent IP-address)

The output will be something like:
xterm Xt error: Can't open display: 10.0.0.126:0
10.0.0.126:0

Which tells me that xterm tries to open the display.

Now, on a N800 or 770, do the same (do it on the device itself, dont ssh into the tablet):
DISPLAY=10.0.0.126:0; /usr/bin/osso-xterm; echo $DISPLAY

Again, 10.0.0.126 doesn't exist. What happens is that the application starts, without any error. After you close it again, you'll find that "echo" still prints the expected line
10.0.0.126:0
so we know $DISPLAY contains what we said it should and didn't magically return to :0.0

I don't have the applications installed you tried, but I used xchat, the calculator etc., and they all never throw an error. they just start up as if nothing had happened - as if they wouldn't read $DISPLAY at all.

gsagers 2007-04-29 19:32

Re: forwarding X apps from N800 to desktop
 
OK, testing as you said above:

xterm launches, echoes DISPLAY
browser (opera) launches, echoes the DISPLAY I set
fmradio - doesn't launch, w/GTK+ can't open display <IPADDR>
vncviewer - doesn't launch, no GTK error, echoes DISPLAY
gpe-calendar - doesn't launch w/GTK+ can't open display <IPADDR>
pwsafe - doesn't launch w/GTK+ can't open display <IPADDR>

So, some apps do honor $DISPLAY and some don't? Am I interpreting that right? But, even if they honor it, they won't export over SSH.

benny1967 2007-04-30 09:14

Re: forwarding X apps from N800 to desktop
 
This is getting too technical for me now; I always thought that this X feature is handled be the X framework itself and not by each single application.

Maybe Xomap simply doesn't support this feature at all? I tried to search google for further information about Xomap and remote X displays, but didn't find anything useful except:

Quote:

> Not everything runs smooth, it looks like the maemo's X-server lacks
> some features/extensions of other X-server.

These include the direct TCP connection support AFAIK, which is why
just exporting the display doesn't work.
on the mailing list here. (The thread is about the reverse situation, forwarding from the desktop to the 770, but nonetheless it's about X and TCP-connections.)

Maybe one of the developers could tell us more.

gsagers 2007-04-30 13:35

Re: forwarding X apps from N800 to desktop
 
Thanks for the thread pointer. I'll put this on the back burner for now I guess!

gammer 2007-07-03 12:23

Re: forwarding X apps from N800 to desktop
 
I just installed winaxep (http://www.labf.com/winaxeplus/index.html) on a MS Windows XP machine, then used their "telnet_ssh" to ssh to my N800 (with openssh installed). After "export DISPLAY=192.168.xxx.yyy:0" (the windows machine's IP address) and then "leafpad", the leafpad main window opened up on the XP desktop! Same for mirage (picture viewer from garage) and claws-mail. I was really surprised after all those failed trials to forward X-apps from the n800 to my linux desktop!! However, there where no window borders and menus were accessible via alt-f4 only. Nevertheless it's a starting point...

gsagers 2007-07-03 22:17

Re: forwarding X apps from N800 to desktop
 
Don't have a windows box available at the moment, but I tried the "export DISPLAY=10.x.x.x:0" on my linux box, and still no joy. $DISPLAY shows that the variable is set right, but it still won't show up.

febb 2007-07-04 00:31

Re: forwarding X apps from N800 to desktop
 
> The output will be something like:
> xterm Xt error: Can't open display: 10.0.0.126:0
> 10.0.0.126:0

This is easy: Your X client (i.e. the application, like xterm for example) does not have permissions to open the screen on the X server.

On the X server, do a "xhost +" (no quotes)

This will allow permissions for ANY client to open the display. Still, the DISPLAY variable has to be correctly set like this on the X client side:

export DISPLAY=192.168.192.1:0.0

(As a side not, when talking X windows....everything seems "reversed" (aparently), the server is the display and the client are the actual applications, like xterm, xeyes, and others.)

Hope this helps.

gammer 2007-07-04 08:11

Re: forwarding X apps from N800 to desktop
 
With openSuSE 10.2 I also did "xhost +". No problem from another linux box to the target linux box, but no luck with n800. But with the windows X server it works! There is some deeper problem, but I have neither further ideas nor enough time...

benny1967 2007-07-04 09:33

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by febb (Post 56007)
> The output will be something like:
> xterm Xt error: Can't open display: 10.0.0.126:0
> 10.0.0.126:0

This is easy: Your X client (i.e. the application, like xterm for example) does not have permissions to open the screen on the X server.

On the X server, do a "xhost +" (no quotes)

Misunderstanding:

The error is expected because 10.0.0.126 doesn't exist on the network. ("xhost +" was done before, also x was started without any xauth-magic that could add additional trouble.)


The unexpected and interesting part of the game is that you don't see this error on the 770. Mind you, even if xhost/xauth/... setting were all correct, the IP-address doesnt exist, there's no way to open a display on the remote machine. Still, there's no error and the application runs locally.

gammer 2007-07-04 10:14

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by benny1967 (Post 56097)
Misunderstanding:

The error is expected because 10.0.0.126 doesn't exist on the network. ("xhost +" was done before, also x was started without any xauth-magic that could add additional trouble.)


The unexpected and interesting part of the game is that you don't see this error on the 770. Mind you, even if xhost/xauth/... setting were all correct, the IP-address doesnt exist, there's no way to open a display on the remote machine. Still, there's no error and the application runs locally.

In my case, the IP address and all other parameters ARE valid/correct. For the X server as provided by winaxep on windows xp everything works as expected. For the X server as provided by my linux box it does not (if the client is my n800, but it works if the client is another linux box)! I did all experiments in a fixed environment to avoid trivial errors. So what is the relevant difference between both X servers???

benny1967 2007-07-04 11:02

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by gammer (Post 56103)
In my case, the IP address and all other parameters ARE valid/correct. For the X server as provided by winaxep on windows xp everything works as expected. For the X server as provided by my linux box it does not (if the client is my n800, but it works if the client is another linux box)! I did all experiments in a fixed environment to avoid trivial errors. So what is the relevant difference between both X servers???

Really strange. I'm not an expert when it comes to X and I don't have Windows to try your setup, but what you could do is:

Do not log into the N800 via telnet/ssh/whatever from the windows machine but run the "DISPLAY=192.168...." stuff locally in the N800s xterm. From a pure X point of view, this should be the most straightforward way of using a different display. It also corresponds to the setup I tried.

The thing when you log in to your N800 remotely is that the remote connection may provide a fake 2nd 'local' display to the N800. "Fake local" means that it looks like a 2nd local display to the N800 but is secretly forwarded to the PC your connection originates via ssh. In this case we're making things more complex which doesn't help finding the cause of the problem.

I have reason to believe that the N800 actually ignores whatever IP-address is set in the DISPLAY-variable and only honors the part after the ":". It would be interesting to check this. (It can also be that theres a difference between my 770 and your N800 in this respect after all...)

gammer 2007-07-04 11:38

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by benny1967 (Post 56110)
Really strange. I'm not an expert when it comes to X and I don't have Windows to try your setup, but what you could do is:

Do not log into the N800 via telnet/ssh/whatever from the windows machine but run the "DISPLAY=192.168...." stuff locally in the N800s xterm. From a pure X point of view, this should be the most straightforward way of using a different display. It also corresponds to the setup I tried.

The thing when you log in to your N800 remotely is that the remote connection may provide a fake 2nd 'local' display to the N800. "Fake local" means that it looks like a 2nd local display to the N800 but is secretly forwarded to the PC your connection originates via ssh. In this case we're making things more complex which doesn't help finding the cause of the problem.

I have reason to believe that the N800 actually ignores whatever IP-address is set in the DISPLAY-variable and only honors the part after the ":". It would be interesting to check this. (It can also be that theres a difference between my 770 and your N800 in this respect after all...)

Ok, that's a good idea! Unfortunately, yesterday I sent my n800 to Nokia because there are weakly responsive touch screen areas and warranty ends in a few days :-( Now I have to wait, alone as I am...

gsagers 2007-07-05 21:08

Re: forwarding X apps from N800 to desktop
 
Hmmm... I'll try to set $DISPLAY on the n800 xterm, rather than SSH.


But! Remember that xhost+ is a bad idea, except in a controlled environment! Xauth is the way to go, but is a little more complex.

The beauty of SSH forwarding is that it is supposed to handle the $DISPLAY variables and "faking" xauth, but in this case it's not working under Xorg's X server, but is working under a Windows X server. Very strange.

gammer 2007-08-19 16:45

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by benny1967 (Post 56110)
Really strange. I'm not an expert when it comes to X and I don't have Windows to try your setup, but what you could do is:

Do not log into the N800 via telnet/ssh/whatever from the windows machine but run the "DISPLAY=192.168...." stuff locally in the N800s xterm. From a pure X point of view, this should be the most straightforward way of using a different display. It also corresponds to the setup I tried.

The thing when you log in to your N800 remotely is that the remote connection may provide a fake 2nd 'local' display to the N800. "Fake local" means that it looks like a 2nd local display to the N800 but is secretly forwarded to the PC your connection originates via ssh. In this case we're making things more complex which doesn't help finding the cause of the problem.

I have reason to believe that the N800 actually ignores whatever IP-address is set in the DISPLAY-variable and only honors the part after the ":". It would be interesting to check this. (It can also be that theres a difference between my 770 and your N800 in this respect after all...)

A few weeks ago I got back my N800 - new screen, all is wonderful. And now I did the test you have proposed: this time I did not log in via ssh, but the result is the same! All apps appear on my desktop (but without borders) when I set DISPLAY in osso-xterm. Do you have any progress?

benny1967 2007-08-19 18:52

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by gammer (Post 69671)
Do you have any progress?

No, I've pretty much given up on this.

BTW: when running suse, did you try to eliminate all sorts of X security stuff such as xauth? it could well be that the two X environments (windows and GNU/linux) are not configured equally...

paai 2009-12-15 19:58

Re: forwarding X apps from N800 to desktop
 
Same problem here. Would't it be beautiful if there was a NXserver for the N900?

paai 2009-12-15 20:51

Re: forwarding X apps from N800 to desktop
 
forget about X forwarding for the moment. I got it working (on KDE systems you have to edit ServerArgsLocal= in /etc/kde/kdm/kdmrc), but half of the apps don't work and the other half is not very interesting.

YMMV.

PMaff 2011-09-15 23:55

Re: forwarding X apps from N800 to desktop
 
Quote:

Originally Posted by paai (Post 429458)
Same problem here. Would't it be beautiful if there was a NXserver for the N900?

Did anybody succeed in forwarding X output from N900 to a desktop Linux machine via WLAN?

xhost+ on the desktop machine and export of DISPLAY on N900
does not help.


All times are GMT. The time now is 15:44.

vBulletin® Version 3.8.8