Solved Difficulty running remote X11 app with local Windows:Xserver

I have installed pidgin irc client from ports onto remote FreeBSD 13.1 server. I have Xming installed on my local desktop Windows-10 workstation. I am able to connect to a linux server and open xterm using Xming so I think the Xserver/Putty settings are correct.

I am able to ssh to FreeBSD via Putty ( with X11 forwarding enabled and X display location set to :0.0 ). When I start Pidgin on FreeBSD 13.1 I get the following error. I tried setting the $DISPLAY environemental variable but this does not help. I also have xmonad window manager installed but not xserver on the FreeBSD machine. Do I need to install X11-server on the FreeBSD machine?

Code:
> setenv DISPLAY ':0.0'
> echo $DISPLAY
> pidgin

(Pidgin:73703): Gdk-CRITICAL **: 21:11:05.131: IA__gdk_display_get_name: assertion 'GDK_IS_DISPLAY (display)' failed
Pidgin 2.14.10

** (Pidgin:73703): WARNING **: 21:11:05.131: cannot open display: unset
 
You shouldn't set DISPLAY manually if the session has X11 forwarding. It'll be set automatically (usually with a display number starting from 10, not 0).
 
I logged out and then back in using putty with X11 forwarding enabled. Also, BTW, "X11 forwarding yes" is set in sshd_config.

Code:
> pidgin

(Pidgin:78879): Gdk-CRITICAL **: 21:46:38.751: IA__gdk_display_get_name: assertion 'GDK_IS_DISPLAY (display)' failed
Pidgin 2.14.10

** (Pidgin:78879): WARNING **: 21:46:38.751: cannot open display: unset
> echo $DISPLAY
DISPLAY: Undefined variable.
 
Did you restart the ssh daemon after changing the configuration in /etc/ssh/ssh_config with sudo service sshd restart?

When debugging X11 connections, it's usually easier to start with something simple like xeyes(1), and get that working first.
 
What about setting the display in /etc/ssh/sshd_config ??? That is what I do.
Uncomment all three settings.
Code:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
 
What about setting the display in /etc/ssh/sshd_config ??? That is what I do.
Uncomment all three settings.
Code:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
Thanks for the suggestion.
I tried what you recommended.
I restarted sshd.
I tried to open xeyes but still not working.
I checked most recent log files in /var/log/
but not related error messages in auth.log, messages, or daemon.log.
Also, I wonder if X11UseLocalHost should really be set since I am trying to use a remote X11 server.
 
X forwarding will work just fine with the default sshd_config, there's no need to change anything to make it work.

I tried to open xeyes but still not working.
"It doesn't work" tells us exactly nothing. What are the errors you get when you start xeyes in a PuTTY session with X-forwarding turned on?

In PuTTY make sure "Connection" -> "SSH" -> "X11" Enable X11 forwarding is turned on, before making the connection. And make sure your Windows Xserver is running and has a display on 10:0.
 
In putty terminal window:
Code:
avner@myhost > xeyes
Error: Can't open display:

putty.log is empty

is there a specific x11 log?
 
Are you definitely passing -X as an argument along with the SSH command?

i.e

Code:
$ ssh -X myserver

With putty, this can be via the GUI as SirDice mentioned or if you want to try it via the SSH cli client inbuilt into Windows (since 10).
 
I am making progress. I learned that I need to
setenv DISPLAY 192.168.xx.xx:0 after logging in.

Now getting the following error message:
Code:
> xeyes
Authorization required, but no authorization protocol specified

Error: Can't open display: 192.168.xx.xx:0
>

( 192.168.xx.xx being the local ip address on the remote lan after I vpn into it.)

Saw something online about adding location of .Xauthority file in putty but I can't find .Xauthority on my windows pc.
 
This method means that X11 is not tunneled via SSH. Instead you are connecting to the remote machine and instructing it to use the Xserver running on the local machine.

However, if it is working for you and its good enough, then glad to hear :)
 
I am making progress. I learned that I need to
setenv DISPLAY 192.168.xx.xx:0 after logging in.
No, that's not needed. If X-forwarding is correctly enabled, then the DISPLAY variable is automatically set.

Code:
dice@fbsd-test:~ % echo $DISPLAY
localhost:10.0
 
This method means that X11 is not tunneled via SSH. Instead you are connecting to the remote machine and instructing it to use the Xserver running on the local machine.

However, if it is working for you and its good enough, then glad to hear :)
This is my intent, using Xserver on local windows machine to display app running on remote freebsd machine. This setup is using putty with X11 forwarding enabled.
 
This is my intent, using Xserver on local windows machine to display app running on remote freebsd machine. This setup is using putty with X11 forwarding enabled.
It is hard to explain but what you were doing doesn't sound like you were actually tunelling through SSH.

Instead you were instructing the Xclient to do a direct connection (potentially faster but less secure and less flexible across complex networks).

In short, you should never need to set the DISPLAY variable if the SSH X11 tunnel is working correctly. It will populate that for you. It has to because only SSH knows what the X11 socket should even be.
 
Back
Top