I have two raspis and connect from one to the other using SSH and X11 forwarding, ssh pi@[pi's IP] -X -v
. Displaying the remote GUI using X11 forwarding works fine for many applications. However, for one application it's not working. It's the demo application of the ADI tof sdk. When I start this in my "SSH -X" session I get an error (after some init steps already passed):
X11 connection rejected because of wrong authentication.
Gtk-WARNING **: 13:11:31.083: cannot open display: localhost:10.0
pi@aditofpi:~/Desktop $ ./aditof-demo.sh
I0604 13:11:28.104044 28301 device_enumerator_raspberry.cpp:16] Looking for devices on the target
I0604 13:11:28.105119 28301 device_enumerator_raspberry.cpp:49] Looking at: /dev/video0 for an eligible TOF camera
I0604 13:11:28.106060 28301 system_impl.cpp:31] System initialized
I0604 13:11:28.106182 28301 camera_96tof1.cpp:47] Initializing camera
I0604 13:11:28.106228 28301 local_device.cpp:118] Opening device
I0604 13:11:28.309844 28301 calibration.cpp:230] EEPROM calibration data size 65044 bytes
I0604 13:11:31.062580 28301 camera_96tof1.cpp:64] Camera initialized
I0604 13:11:31.069535 28301 local_device.cpp:213] Starting device
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from ::1 52008
debug1: channel 1: new [x11]
debug1: confirm x11
X11 connection rejected because of wrong authentication.
debug1: channel 1: free: x11, nchannels 2
Unable to init server: Could not connect: Connection refused
(aditof-demo 1.2.0:28301): Gtk-WARNING **: 13:11:31.083: cannot open display: localhost:10.0
This is no general X11 forwarding issue obviously since it works fine for other applications. Tested it with xclock and geany for example. Could it be related to the fact that the aditof-demo application has several GUI windows? I can see them when I start the application locally. Can X11 forwarding handle this at all (one app with several different windows)? I also tried starting the ssh session trusted with -Y instead of -X, same result. My ssh_config on both systems contain the following block, does this look ok?
Host *
# ForwardAgent no
ForwardX11 yes
ForwardX11Trusted yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
Any idea why X11 forwarding is not working only for this specific application and works fine for others?
UPDATE: I tried to start the aditof application as pi user and also as sudo user. Both did not work and the output is the same. However, when I test with geany there IS actually a difference. It works as user pi, but NOT as sudo. As sudo, geany fails with the same error as the aditif application. Hmmm, that's strange.
pi@aditofpi:~/Desktop $ geany
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from ::1 56062
debug1: channel 1: new [x11]
debug1: confirm x11
debug1: channel 1: FORCE input drain
debug1: channel 1: free: x11, nchannels 2
pi@aditofpi:~/Desktop $ sudo geany
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from ::1 56066
debug1: channel 1: new [x11]
debug1: confirm x11
X11 connection rejected because of wrong authentication.
debug1: channel 1: free: x11, nchannels 2
Unable to init server: Could not connect: Connection refused
Geany: cannot open display
ssh -X
.ssh -X
is actually the only instance. When one instance of the application is launched several different windows will be opended at the same time. One for the user controls, one for a VIS image display, another one for the 3D depth image etc. So it's not several instances of the same window, it's different windows launched by the same application.X11 connection rejected because of wrong authentication.
shows if you don't have the right to access the server, if you are another user for example or runsudo
.