LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   error: cannot open display (https://www.linuxquestions.org/questions/linux-newbie-8/error-cannot-open-display-4175613856/)

Epic555 09-15-2017 06:00 AM

error: cannot open display
 
Hi, i have the same problem, i can't open gedit.
I connect to CentOS server with Putty with enabled X11 forwarding.
I tried to use Cygwin X or Xming, didn't help.
In Putty i do:
- export DISPLAY='IP of local station:0.0'
- xhost+
But after that - error: cannot open display.
I installed all X packages (xorg-x11-xauth, xorg-x11-fonts-*, xorg-x11-utilsxorg, etc).
X11Forwarding options is 'Yes' in /etc/ssh/sshd_config on CentOS server.
In /etc/hosts:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
IP-address-of-server hostname
What is wrong? Help pls.
I looked in the Internet all advices to solve the issue, but nothing helped.

scasey 09-15-2017 10:09 AM

Have you installed an X server on your Windows machine? Which one?
Disclamer: I've never understood how to connect a remote client to X on a server. (or why one would want to)

Consider: Rather than using gedit, install WinSCP and SciTE on the Windows PC. WinSCP can open remote files into SciTE, which is an excellent text editor for scripting/programming.

Emerson 09-15-2017 10:13 AM

For remote management SSH and a text editor as VIM is all you ever need. Works reliably over thousands of miles, even if there is slow internet connection somewhere in the way.

Epic555 09-15-2017 10:44 AM

gedit it is just example. i can't launch gui apps. Oracle DB doesn't launch too.

Emerson 09-15-2017 11:11 AM

This is how it works. Your local box must accept incoming X connections, local X server must be listening on port 6000. The xhost command has to be run in local box, not remote. How it all works in Windows - I have no clue. I do not run Windows, never will.

Shadow_7 09-17-2017 05:58 PM

On the local box I use multiple users and one X session. And this is my method of sorts.

$ startx -- :0 -dpi 100 -to 10 -nolisten tcp -retro -depth 24 -layout MultiHead

$ xhost local:

$ su - otheruser

$ export DISPLAY=":0"

$ xcalc

I would imagine that the X on the server has something like "-nolisten tcp" which disables remote X services. Various Xephyr and Xdmx ways to get things going. Assuming linux to linux. Otherwise vnc, x2go, and other methods might prove simpler. If I'm fiddling with Xdmx or other things I drop the "-nolisten tcp" option so that ssh -X and stuff works. Not that I've done any remote X stuff in recent history.

Emerson 09-17-2017 07:11 PM

ssh -X works even if X server is not listening.


All times are GMT -5. The time now is 02:12 PM.