Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 4:16 pm

I have to computers, one RasberryPI and one Ubuntu.

In the RasberryPi terminal, I type ssh -X username@ip to connect to the Ubuntu computer. Connection is fine.

I then type gedit and gedit opens on the Ubuntu computer's screen rather than on the RaspberryPi. Isn't it supposed to open on the Raspberry' screen or I haven't understood what this is supposed to do?

Patrice

Andyroo

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 5:58 pm

I do not think you need the ‘-X’ as that is X11 forwarding so you are sending the Pi screen to the Ubuntu X11 service.

Just try

Code: Select all

ssh username@ip
to see the terminal session locally.

User avatar
B.Goode
Posts: 10211
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:00 pm

Andyroo wrote:
Fri Apr 05, 2019 5:58 pm
I do not think you need the ‘-X’ as that is X11 forwarding so you are sending the Pi screen to the Ubuntu X11 service.

Just try

Code: Select all

ssh username@ip
to see the terminal session locally.
@andyroo: I am pretty sure that is not correct.... It will run the terminal session, but not render the output from X-windows GUI client apps.
Last edited by B.Goode on Fri Apr 05, 2019 6:10 pm, edited 1 time in total.

User avatar
B.Goode
Posts: 10211
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:08 pm

Patrice1608 wrote:
Fri Apr 05, 2019 4:16 pm
I have to computers, one RasberryPI and one Ubuntu.

In the RasberryPi terminal, I type ssh -X username@ip to connect to the Ubuntu computer. Connection is fine.

I then type gedit and gedit opens on the Ubuntu computer's screen rather than on the RaspberryPi. Isn't it supposed to open on the Raspberry' screen or I haven't understood what this is supposed to do?

Patrice

Patrice

From your description and my experience your expectation is probably correct. But you will need to be working on the RPi (Raspbian) in a desktop environment, not simply a command-line login.

To check your thinking, can you reverse the test? From the Ubuntu system, use ssh -X to access your RPi. Then run a graphical application such as leafpad on the Raspbian shell prompt.

Does that work as expected, with the display being rendered on your Ubuntu workstation? (I know that isn't your real aim, it is just to help your understanding and troubleshooting.)

Andyroo

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:12 pm

Apologies - swore that was how we used to share with a user. Must go back into training :lol:

Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:23 pm

B.Goode,

Before writing my initial post, I had tried the reverse test : ssh -X user@ip from the Ubuntu to connect to the Raspberry. I type Midori and I can see the Midori graphic user interface on the Ubuntu screen. Which is what I expected. I just don't understand why it doesn't work the other way around.

Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:25 pm

Andyroo

You are right, ssh username@ip makes me the terminal session locally on the Raspberry. If I add the -X, go figure, the GUI opens on the Ubuntu computer.

User avatar
B.Goode
Posts: 10211
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:33 pm

Patrice1608 wrote:
Fri Apr 05, 2019 6:23 pm
B.Goode,

Before writing my initial post, I had tried the reverse test : ssh -X user@ip from the Ubuntu to connect to the Raspberry. I type Midori and I can see the Midori graphic user interface on the Ubuntu screen. Which is what I expected. I just don't understand why it doesn't work the other way around.

I have never been a Ubuntu user. Maybe (possibly for security reasons) Ubuntu doesn't cooperate with setting up the reverse ssh-tunnelling for the X-windows $Display in the way that Raspbian does?

Not meaning to be dismissive, but this looks like a Ubuntu issue...


Afterthought: see man ssh. Does ssh -Y behave differently?

Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:46 pm

B.Goode,

Exact same thing with -Y.

It might be a Ubuntu issue indeed. So far, no useful replies from the Ubuntu-fr forum...

User avatar
croston
Posts: 706
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:51 pm

If memory serves me correctly, there is a X11Forwarding flag in /etc/ssh/sshd_config on your Ubuntu box that might need setting to 'yes'.
Restart your ssh server for it to pick up config changes.

Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 6:59 pm

croston,

You have a good memory. Yes, there is a X11Forwarding flag in /etc/ssh/sshd_config, it was already set to yes.

Other flags in this file :
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

Perhaps setting "PermitTunnel" or "X11UseLocalhost" to yes? I ave no clue about those.

User avatar
B.Goode
Posts: 10211
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 7:00 pm

croston wrote:
Fri Apr 05, 2019 6:51 pm
If memory serves me correctly, there is a X11Forwarding flag in /etc/ssh/sshd_config on your Ubuntu box that might need setting to 'yes'.

(Note I am not near a computer to check I have the correct names above)


Thanks for the heads-up Ben.

On my Raspbian system that is the correct config file location and the relevant entry is X11Forwarding yes

@patrice: how does it look under Ubuntu? (Never mind - overtaken already... )

Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 7:28 pm

From https://doc.ubuntu-fr.org/ssh#configura ... erveur_ssh*, I see that the X11Forwarding flag must be set to yes (in ssh_config) but also that xauth must be installed. I don't know what xauth is exactly, I am looking into this later this afternoon.

(* french is my native langage...)

User avatar
PeterO
Posts: 5832
Joined: Sun Jul 22, 2012 4:14 pm

Re: GUI opening on the server instead of on the client side...

Fri Apr 05, 2019 11:47 pm

FYI on my MINT-19 machine X11Forwarding is set to "yes" and ssh -X works as expected with X applications rendering on the local machine.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Patrice1608
Posts: 7
Joined: Fri Apr 05, 2019 4:08 pm

Re: GUI opening on the server instead of on the client side...

Mon Apr 08, 2019 11:41 am

Now, it works fine. Go figure. I don't have a clue.

I have looked into the configuration file, did some tests, but as far as I know, I did not change a thing nor on the Ubuntu computer nor on the Raspberry.

Return to “Troubleshooting”