X11 and "Cannot Open Display" errors

Greetings Forumers!

I'm posting a solution to an Issue I ran into this week: Getting applications to display on another through X11 and SSH. I have run into this issue many years ago and finally found my notes. Some of you may already know the answer to this issue but it took me a while to resolve it for myself.

Scenerio: both systems running Solaris 10u4 or greater, remote system=SPARC(M5000) and my workstation running x86(Ultra24).

I was merely trying to get xclock to display on my workstation from a remote system to test that x11 was working. I ran "xhost +remotehost" on my system before I started an ssh session to the remote system. I set the DISPLAY var and ran xclock. This failed repeatedly with "Cannot Open Display" errors. I tried changing the DISPLAY var with variations of "mysystem:0" and "mysystem:0.0" and "mysystem:1", etc., etc. Long story short: nothing worked.

The resolution that worked was to modify the "tcplisten" option in the "application/x11/x11-server" service on my system to "true":

mysystem# svccfg -s application/x11/x11-server
svc:/application/x11/x11-server> listprop options/*
options/default_depth        integer  24
options/server               astring  /usr/X11/bin/Xorg
options/server_args          astring
options/stability            astring  Evolving
options/value_authorization  astring  solaris.smf.manage.x11
options/tcp_listen           boolean  false
svc:/application/x11/x11-server> setprop options/tcp_listen=true
svc:/application/x11/x11-server> listprop options/*
options/default_depth        integer  24
options/server               astring  /usr/X11/bin/Xorg
options/server_args          astring
options/stability            astring  Evolving
options/value_authorization  astring  solaris.smf.manage.x11
options/tcp_listen           boolean  true
svc:/application/x11/x11-server> exit
mysystem# 

After setting this I was able to get xclock to display on my system.

HTH

As you wrote you are using ssh, a simpler and safer solution would be to simply tunnel X11 through ssh:

$ ssh -X servername
...
$ xclock &