X forwarding doesn't work

Joshua Judson Rosen rozzin at geekspace.com
Sat Aug 15 16:42:12 CEST 2009


Michael Tansella <michael-tansella at gmx.de> writes:
>
> I want to start midori in the freerunner and forward the GUI tt my Linux Host  
> (Kubuntu)
> 
> I tried it the following way, but it starts on the freerunner instead of the 
> host, any idea?:
> 
> 
> simarillion at simarillion-laptop:~$ ssh -l root -X -v 192.168.5.202
[...]
> root at om-gta02 ~ $midori

My guess is that /etc/profile on the FreeRunner is overriding the
$DISPLAY environment-variable that sshd sets up, or something along
those lines. You didn't mention which distribution you're using
(OM2008.x? OM2009? SHR?), so I can't be sure, but...:

In SHR (which is what I run), this is what happens: ssh request X11
forwarding, sshd sets up forwarding and sets $DISPLAY to
"localhost:10" (for the first connection--other simultaneous
connections get higher numbers), my shell starts and sources
/etc/profile, /etc/profile contains a line that does
"export DISPLAY=localhost:0".

It wasn't always like this; I imagine that this was added to
/etc/profile as a bugfix because people didn't like having to do
"export DISPLAY=:0" to launch apps (and have them display locally on
the FreeRunner) from SSH logins.

Perhaps a better option would be to change /etc/profile so that it
instead does:

    if [ "$DISPLAY" = "" ]
    then
        export DISPLAY=localhost:0
    fi

... or something equivalent. Something like this would also work:

    logger -t login "Login with DISPLAY on ${DISPLAY:=localhost:0}"

That posts a note about the login, and which DISPLAY value it used, to
syslog. The ":=" means `if the variable already has a value, use that
value; otherwise assign the following value to it'.

-- 
Don't be afraid to ask (Lf.((Lx.xx) (Lr.f(rr)))).




More information about the community mailing list