LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
 
Search this Thread
Old 06-04-2007, 06:51 AM   #1
jcurts71
LQ Newbie
 
Registered: Oct 2005
Location: London
Distribution: Redhat, Centos, Debian
Posts: 3

Rep: Reputation: 0
can't run remote x-windows apps using ssh -X


Hi

I have two servers using Centos (Red Hat ES rebranded) 5.0 and a desktop using Centos 4.4.

From my desktop I can access both machines by typing "ssh -X user@192.168.X" but only one of the machines will allow me to run it's X windows apps.

For example, if I type "yumex" to get the graphical configuration app for yum, on the failing machine I get the message:

"ERROR: Unable to initialize graphical environment. Most likely cause of failureis that the tool was not run using a graphical environment. Please either start your graphical user interface or set your DISPLAY variable."

I didn't install gnome, kde or X windows when I built either of the machines so I don't get what the difference is.

I've got reasonable command line knowledge but know nothing about X - can someone direct me to which files I should install / configure to resolve this?

Many thanks

James
 
Old 06-04-2007, 07:02 AM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
1) make sure sshd allows X11 forwarding
2) try to launch the app and define the DISPLAY variable, for example
Code:
DISPLAY=:0 someprog
if that was a good format in your case. The above (setting DISPLAY to :0) worked for me when I ran some apps with Wine over ssh; other programs worked just fine with X11 forwarding but Wine didn't do anything before setting DISPLAY.
 
Old 06-04-2007, 08:06 AM   #3
jcurts71
LQ Newbie
 
Registered: Oct 2005
Location: London
Distribution: Redhat, Centos, Debian
Posts: 3

Original Poster
Rep: Reputation: 0
Hi

Thanks for coming back to me so quickly. Much appreciated.


Quote:
Originally Posted by b0uncer
1) make sure sshd allows X11 forwarding
Forgot to say in the original post that sshd is configured to allow forwarding


Quote:
Originally Posted by b0uncer
2) try to launch the app and define the DISPLAY variable, for example
Code:
DISPLAY=:0 someprog
if that was a good format in your case. The above (setting DISPLAY to :0) worked for me when I ran some apps with Wine over ssh; other programs worked just fine with X11 forwarding but Wine didn't do anything before setting DISPLAY.
Just tried to do this with one of the redhat configs:

Code:
DISPLAY=:0 system-config-users
and get
Code:
system-config-users requires a currently running X server.
when I try yumex, I'm now getting a different error:

Code:
[root@xxxxxx ~]# DISPLAY=:0 yumex
Traceback (most recent call last):
  File "/usr/share/yumex/yumexmain.py", line 24, in ?
    import gtk
  File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 76, in ?
    _init()
  File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 64, in _init
    _gtk.init_check()
RuntimeError: could not open display
[root@xxxxxx ~]#
 
Old 06-05-2007, 04:33 AM   #4
jcurts71
LQ Newbie
 
Registered: Oct 2005
Location: London
Distribution: Redhat, Centos, Debian
Posts: 3

Original Poster
Rep: Reputation: 0
After more reading, I resolved this one:

The problem was that I needed need to have xorg-x11-xauth file installed. In centos this can be done by typing:

Code:
yum install xorg-x11-xau*
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
run X apps in ssh jaymoney Linux - General 4 06-01-2007 01:09 PM
Run application on *monitor* of remote machine via SSH? DiBosco Linux - Networking 5 04-09-2007 08:57 AM
Run remote X apps on remote Xserver trollman Linux - Desktop 5 10-08-2006 09:01 PM
problems with X-apps when executed on remote host via ssh numerous Linux - Software 1 01-17-2005 07:08 PM
How to run remote WinManager over ssh? aleet2600 Linux - Software 0 04-14-2004 06:05 PM


All times are GMT -5. The time now is 08:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration