Page 1 of 1

Cannot open display - gedit - from SSH login

Posted: 2015/09/24 17:04:19
by Narain
Hi all,

We have installed the 7.1.1503_core version of CentOS. When logging in remotely through SSH (ssh -y narain@192.168.x.x), and typing in gedit, throws the following error:

** (gedit:2290): WARNING **: Could not open X display

(gedit:2290): Gtk-WARNING **: cannot open display: 192.168.x.x:17.0 //the x.x is intentionally replaced

I have verified the installation of xorg-x11-xauth, and the server SSH config file /etc/ssh/sshd_config includes the following:

#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
#PermitTTY yes

I have no clue on the next step to try to resolve this issue and would greatly appreciate your help!

Many thanks!

Re: Cannot open display - gedit - from SSH login

Posted: 2015/09/24 18:11:38
by TrevorH
Do you have X running on the machine that you are ssh'ing from?

Re: Cannot open display - gedit - from SSH login

Posted: 2015/09/24 18:40:14
by toracat
Narain wrote:Hi all,

We have installed the 7.1.1503_core version of CentOS. When logging in remotely through SSH (ssh -y narain@192.168.x.x), and typing in gedit, throws the following error:
It's supposed to be ssh -Y (or ssh -X). Note the uppercase letter.

Re: Cannot open display - gedit - from SSH login

Posted: 2015/09/24 23:15:54
by TrevorH
Also, ssh X11 forwarding DISPLAY variables are invariably of the format localhost:10.0 (the numbers may vary) and do not use ip addresses. Are you attempting to override the automatic setting?

Re: Cannot open display - gedit - from SSH login

Posted: 2015/09/25 08:34:02
by Narain
Hi Trevor and toracat,

Thanks much for your prompt responses.
TrevorH wrote:Do you have X running on the machine that you are ssh'ing from?
I use MobaXterm on Windows 7, have also tried SSH through Putty - the same issue. (Just for information; I am able to connect to other machines running CentOS 6, through MobaXterm).
toracat wrote:It's supposed to be ssh -Y (or ssh -X). Note the uppercase letter.
Sorry for the typo in my question, I use ssh -Y narain@192.168.x.x, also tried with ssh -XC narain@192.168.x.x - the same issue persists.
TrevorH wrote:Also, ssh X11 forwarding DISPLAY variables are invariably of the format localhost:10.0 (the numbers may vary) and do not use ip addresses. Are you attempting to override the automatic setting?
No, I am not attempting to override the setting; I just exported $DISPLAY with the IP address for one session to test, based on a troubleshooting step I read on the web. It did not work.
When I start a new session, I get the DISPLAY format 10.0., please see below:

Code: Select all

[narain@192.168.x.x ~]$ gedit

** (gedit:22417): WARNING **: Could not open X display

(gedit:22417): Gtk-WARNING **: cannot open display: localhost:10.0

Re: Cannot open display - gedit - from SSH login

Posted: 2015/09/25 09:26:48
by TrevorH
I've never heard of mobaxterm but putty is not an X server, it's just a terminal emulator. With putty you need a separate X server like xming or the cygwin X server both installed and running.

Re: Cannot open display - gedit - from SSH login

Posted: 2015/09/25 11:09:04
by Narain
TrevorH wrote:I've never heard of mobaxterm but putty is not an X server, it's just a terminal emulator. With putty you need a separate X server like xming or the cygwin X server both installed and running.
Thanks. Without using MobaXterm or Putty, if I login from another machine running CentOS 6, to the machine in question, I get the same error - "cannot open the X display".

Re: Cannot open display - gedit - from SSH login

Posted: 2015/10/01 11:44:08
by Narain
Hi all,

I still have no success on resolving this issue, and am blocked - do I have to re-install some packages to make this work?

Many thanks in advance for your time.

Re: Cannot open display - gedit - from SSH login

Posted: 2015/10/22 07:47:06
by Walkin.Blue
Narain wrote:Hi all,

I still have no success on resolving this issue, and am blocked - do I have to re-install some packages to make this work?

Many thanks in advance for your time.
What do you mean blocked ?
make sure ssd run or not in server using nmap ( port 22 )

Code: Select all

$ nmap serverhostname
if localhost not works, may be you could try

Code: Select all

$ xhost +
$ export DISPLAY="192.168.x.x:0.0"     # your own ip
$ ssh -X yourserver 
$ gedit