Xclock error can t open display

I am using Mobaxterm(free version) on a windows 7 desktop to connect to a SUSE 11 Enterprise server on AWS. I am trying to display the xclock program on my xtrem client but I get an error saying 'E...

I am using Mobaxterm(free version) on a windows 7 desktop to connect to a SUSE 11 Enterprise server on AWS. I am trying to display the xclock program on my xtrem client but I get an error saying ‘Error: Can’t open display:’. I have used the following syntax to set the display on the server:

export DISPLAY=<IP_addr>:0.0

SUSE 11 does not come with xclock by default so I had to download it and install it.
The hosts file on my PC has the localhost entry commented out, I am not sure if that would make a difference. Any ideas on how to debug this? Thanks.

asked Sep 3, 2013 at 20:31

sotn's user avatar

Fixed!

Earlier I was just looking at xclock program’s error msg. But when I scanned Mobaxterms client terminal’s output, I found the following msg:

X11 forwarding request failed on channel 0

After some google hunting, found that one of the reasons this happens is when xauth package is not installed on the remote server. So, I checked and found that to be the case. This is the command I ran:

zypper in -name xorg*

This command tells you if the package is installed and if any dependencies exist. The package comes bundled with the xclock program. So zypper uninstalled the other xclock I had installed from another source and replaced it with the right version.

Link to package info:
https://www.suse.com/LinuxPackages/packageRouter.jsp?product=server&version=11&service_pack=&architecture=i386&package_name=xorg-x11-xauth

I also modified a file called /etc/ssh/sshd_config as root. The following lines need to be uncommented:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

And X11UseLocalhost was changed to ‘no’. I also changed my security group on AWS to let inbound traffic on port 6000. I am not sure if that matters.

After this mobaxterm automatically set my display parameter to localhost and I was able to run xclock on the remote server and see it on my local PC desktop.

answered Sep 4, 2013 at 14:26

sotn's user avatar

sotnsotn

1,6834 gold badges33 silver badges61 bronze badges

Dear DBA-Mates,

Hope you all are Good and Safe, also may have taken Covid-19
Vaccination which is very important.

We would like to share Xclock
issue: Error: Can’t open display
xclock display error which we need to
fix for display during Oracle Database/Application software installation as
GUI.

Below are some important points and steps which may
useful to all. This is very easy and simple steps but sometimes it will be headache
to us…

Xclock issue: Error: Can’t open display

XCLOCK Fix:

Below are the Pre-checks/pre settings:

1.  
We need to start Xming software.

2.  
We need to enable X11 in putty as shown below
path:

Open putty à
SSH
à X11 à X11 Forwarding (Tick Mark “Enable X11 forwarding”)

X display location : “:0.0”

3.  
Echo $DISPLAY – should give
output

4.  
Below rpms should be installed:

1.
libXaw-1.0.13-4.el7.x86_64.rpm

2.
xorg-x11-apps-7.7-7.el7.x86_64.rpm

5. If still not working then we can add xauth list
as shown below:

[oracle@linux dbhome_1]$ xclock

Error: Can’t open display:

[oracle@linux dbhome_1]$ echo $DISPLAY

[oracle@linux dbhome_1]$ export DISPLAY=localhost:11.0

[oracle@linux dbhome_1]$ xclock

PuTTY X11 proxy: Authorisation not
recognised

Error: Can’t open display: localhost:11.0

[oracle@linux dbhome_1]$ xauth list

linux.oracle.com/unix:16  MIT-MAGIC-COOKIE-1  ea8443005780edfb76f6930b20d4802c

linux.oracle.com/unix:11  MIT-MAGIC-COOKIE-1  80eab308a9f45535b261e1bf999d475e

linux.oracle.com/unix:13  MIT-MAGIC-COOKIE-1  3bbf11afe24f078bae5f55ae9145ca64

linux.oracle.com/unix:14  MIT-MAGIC-COOKIE-1  abc18e54fd548ccec81649f300a6a1af

linux.oracle.com/unix:15  MIT-MAGIC-COOKIE-1  2a03c3a4cc9c52f41b6fd13878194c0e

linux.oracle.com/unix:12  MIT-MAGIC-COOKIE-1  e7b5657526c2481dbfee1e0599496013

linux.oracle.com/unix:10  MIT-MAGIC-COOKIE-1  1ee8aec7489a11e0cb89a93734ccc19c

[oracle@linux dbhome_1]$ pwd

/u01/DB18C/oracle/product/18.0.0/dbhome_1

[oracle@linux dbhome_1]$

[oracle@linux dbhome_1]$ echo $DISPLAY

localhost:11.0

Note: If xclock is working with root but not working
with oracle user then also we can take xauth list from root user and export the
display as per root user and add the xauth list in oracle user from root user.

Below is the step to add the xauth list:

[oracle@linux dbhome_1]$ xauth add
localhost.localdomain/unix:10 
MIT-MAGIC-COOKIE-1 
15779b706bb1daf925ad02323df4fda3

[oracle@linux dbhome_1]$ xauth add
localhost.localdomain/unix:11 
MIT-MAGIC-COOKIE-1 
542175afd02f0cc7d5f9fe27c43321d4

[oracle@linux dbhome_1]$ xauth add
linux.oracle.com/unix:10 
MIT-MAGIC-COOKIE-1 
94eb4e7f6c702d2e962a3e2cbf727dc8

[oracle@linux dbhome_1]$ xauth add
linux.oracle.com/unix:11 
MIT-MAGIC-COOKIE-1 
21ad871e3931d34b963988874a232d0d

[oracle@linux dbhome_1]$ xclock

Warning: Missing charsets in String to FontSet
conversion

^C

[oracle@linux dbhome_1]$

Hope above steps are easy and helpful. Kindly let us
know for any concerns and will try to give some more inputs.

How to improve
oracle database performance tuning

SQL Tuning Advisor steps and details

What is PDB and CDB in oracle 12c

Stuck Thread in WebLogic Error and
solution

Concurrent Manager Performance Tuning Tips in Oracle EBS R12

I have got two servers apssvrX and apssvrZ on OEL. Both were built by the same team using their standard build scripts.

Having received the servers I had installed Oracle (ODI) product on it successfully.

Then as a part of requirement and as per Oracle support’s advise, I had upgraded the ssh version on apssvrX server from OpenSSH_4.3p2 To OpenSSH_5.2p1, so that, I can implement the chroot jailing.

As per Oracle advise, I had downloaded the 3 RPMs from «_http://layer1.rack911.com/openssh/rhel5/x86_64/» to run them on my first server i.e., apssvrX and then configured the sshd services following the below steps:
****************************
****************************
a) Modify /etc/ssh/sshd_config to comment the below line:
# ————
#Subsystem sftp /usr/libexec/openssh/sftp-server
# ————
b) Add below lines:
# —————————-
Subsystem sftp internal-sftp
Match Group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
# ——————————
Then lastly, Restart sshd services complete the configuration
# /etc/init.d/sshd restart
****************************
****************************
apssvrX server current details are as below:
apssvrX$ uname -a
Linux apssvrX 2.6.18-128.el5 #1 SMP Wed Jan 21 08:45:05 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

apssvrX$ ssh -V
OpenSSH_5.2p1, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

My problems started from this point onwards. I want to install another Oracle product using OUI, but when I try to execute xclock using the Exceed HummingBird tool on apssvrX server then it fails with the error — (xclock) Error: Can’t open display:

I tried the DISPLAY variable setup as well but to no use.

Whereas I can successfully execute the xclock on apssvrZ and OUI as well. Its config details are as below:
apssvrZ$ uname -a
Linux apssvrZ 2.6.18-128.el5 #1 SMP Wed Jan 21 08:45:05 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

apssvrZ$ ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

Please advise the way forward.

Что не так с запуском графического приложения (xclock) на удаленной машине по SSH с выводом графики на клиентскую машину?

В книге проекта LDP «Introduction to Linux» в разделе «10.4.4.2. X11 and TCP forwarding» сказано (насколько я понял), что достаточно (после соединения с удаленной машиной) дать команду:
$ xclock &
У меня получилось следующее:
$ xclock &
[1] 2911
$ Error: Can’t open display:

В этом состоянии никакой графики на клиентской машине нет, она висит пока не нажмешь Ctrl+D. В примере из книги перед командой $ xclock & показано следующее:
$ echo $DISPLAY
localhost:10.0

У меня эта команда ничего не выдает. По поводу DISPLAY приведу цитату из книги:

If the X11Forwarding entry is set to yes on the target machine and the user is using X applications, the
DISPLAY environment variable is set, the connection to the X11 display is automatically forwarded to the
remote side in such a way that any X11 programs started from the shell will go through the encrypted channel,
and the connection to the real X server will be made from the local machine. The user should not manually set
DISPLAY. Forwarding of X11 connections can be configured on the command line or in the sshd
configuration file.

sshd_config на удаленной (target) машине:

Развернуть/свернуть скрытый текст.

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don’t read the user’s ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don’t trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to ‘yes’ to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of «PermitRootLogin without-password».
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to ‘no’.
UsePAM yes

Здесь в теме «Нужна помощь с SSH [РЕШЕНО]» salt писал (14 Июль, 2009 — 22:57):

Графические приложения на удаленной машине по ssh запускать можно. Код:
DISPLAY=:0 soft
где DISPLAY=:0 — номер первого графического экрана
soft — имя запускаемого приложения

Но когда я на клиентской машине дал:
DISPLAY=:0 xclock
окно с часами открылось на удаленной машине.

P.S. На удаленной машине (сервер) OS Mint KDE 14, на клиентской — OS Kubuntu 12.04.

  • Печать

Страницы: 1 2 3 [4]  Все   Вниз

Тема: Не удалось открыть дисплей (Could not open X display)  (Прочитано 34065 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
victor00000

не хочу рута, уже бросил. )))


Пользователь добавил сообщение 08 Апреля 2016, 13:38:17:


начало

xclock
sudo xclock
кто выдаёт?

« Последнее редактирование: 08 Апреля 2016, 13:38:17 от victor00000 »


Оффлайн
Natalia15

~$ sudo xclock
sudo: option `env_reset’ does not take a value
Error: Can’t open display: :99


Оффлайн
ARTGALGANO


Оффлайн
victor00000

bash -c 'echo $DISPLAY'
sudo bash -c 'echo $DISPLAY'
?


Оффлайн
Natalia15

~$ sudo bash -c ‘echo $DISPLAY’
sudo: option `env_reset’ does not take a value
:99


Пользователь добавил сообщение 08 Апреля 2016, 14:43:58:


~$ sudo cat /etc/sudoers
sudo: option `env_reset’ does not take a value
#
# This file MUST be edited with the ‘visudo’ command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults   env_reset=»HOME USER PATH http_proxy https_proxy»
Defaults   mail_badpass
Defaults   secure_path=»/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin»

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root   ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on «#include» directives:

#includedir /etc/sudoers.d

« Последнее редактирование: 08 Апреля 2016, 14:43:58 от Natalia15 »


Оффлайн
victor00000

env_reset

найти эту строк в /etc/sudoers
должно

1:L~$ sudo cat /etc/sudoers | grep env_reset -A1 -B1
#
Defaults env_reset
Defaults mail_badpass
1:L~$


Оффлайн
Natalia15

~$ sudo cat /etc/sudoers | grep env_reset -A1 -B1
sudo: option `env_reset’ does not take a value
#
Defaults   env_reset=»HOME USER PATH http_proxy https_proxy»
Defaults   mail_badpass


Оффлайн
victor00000

Natalia15,
как изменить строки?


Оффлайн
Natalia15


Оффлайн
victor00000


Оффлайн
Natalia15

давай
должно
http://paste.ubuntu.com/15686806/

Спасибо Виктор! Оно-таки заработало. Правда тесты запускаются в фоновом режиме, но это уже отдельная тема для исследования(:


Оффлайн
lcgrunger

Не удалось открыть дисплей (Could not open X display). В Dash board пусто. Даже терминал никак не запустить, только через ссх. Запущен VPS сервер, сижу на нем через ссх и внс.


Пользователь добавил сообщение 07 Июля 2016, 15:58:25:


victor00000, Пожалуйста помогите!!!

« Последнее редактирование: 07 Июля 2016, 15:58:25 от lcgrunger »


Оффлайн
yavol007

Проблема такая:root@fp-anykey:/home/salvador# gedit /etc/apt/sources.list
No protocol specified

** (gedit:15651): WARNING **: Could not open X display
Не удалось открыть дисплей:
Запустите «gedit --help» для получения полного списка поддерживаемых ключей.


если запускать не от рута все граффические приложения через консоль, отлично работают( только вот если, что-то нужно изменить, все файлы конечно же будут только для чтения)root@fp-anykey:/home/salvador# firefox
Error: no display specified

root@fp-anykey:/home/salvador# abiword /etc/apt/sources.list
No protocol specified

** (abiword:16292): WARNING **: Could not open X display
No DISPLAY: this may not be what you want.


Пользователь добавил сообщение 08 Августа 2016, 11:20:12:


коротко:
— открыл nautilus (alt F2)
— запустил MC
— на командной строке набрал gksu gedit /etc/default/apport
— в конце текста после enable заменил «1» на «0»
ошибка ушла, унося плохие слова.

« Последнее редактирование: 08 Августа 2016, 11:20:12 от yavol007 »


  • Печать

Страницы: 1 2 3 [4]  Все   Вверх

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Xbox ошибка подключения к live xbox
  • Xbox ошибка mtu
  • Xbox ошибка 0xa3e80004
  • Xbox ошибка 0x87e0000f
  • Xbox ошибка 0x803f900a как исправить

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии