Cannot open display - gedit - from SSH login

Issues related to applications and software problems
Post Reply
Narain
Posts: 4
Joined: 2015/09/24 16:51:59

Cannot open display - gedit - from SSH login

Post by Narain » 2015/09/24 17:04:19

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!

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot open display - gedit - from SSH login

Post by TrevorH » 2015/09/24 18:11:38

Do you have X running on the machine that you are ssh'ing from?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
toracat
Site Admin
Posts: 7518
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Cannot open display - gedit - from SSH login

Post by toracat » 2015/09/24 18:40:14

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.
CentOS Forum FAQ

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot open display - gedit - from SSH login

Post by TrevorH » 2015/09/24 23:15:54

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?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Narain
Posts: 4
Joined: 2015/09/24 16:51:59

Re: Cannot open display - gedit - from SSH login

Post by Narain » 2015/09/25 08:34:02

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

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot open display - gedit - from SSH login

Post by TrevorH » 2015/09/25 09:26:48

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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Narain
Posts: 4
Joined: 2015/09/24 16:51:59

Re: Cannot open display - gedit - from SSH login

Post by Narain » 2015/09/25 11:09:04

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".

Narain
Posts: 4
Joined: 2015/09/24 16:51:59

Re: Cannot open display - gedit - from SSH login

Post by Narain » 2015/10/01 11:44:08

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.

Walkin.Blue
Posts: 41
Joined: 2015/10/21 01:09:22
Location: West Java, Indonesia

Re: Cannot open display - gedit - from SSH login

Post by Walkin.Blue » 2015/10/22 07:47:06

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
-- Documentation is part of science

Post Reply