LinuxQuestions.org
Visit the LQ Articles and Editorials section

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have access to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

Are you new to LinuxQuestions.org? Visit the following links:
Site Howto | Site FAQ | Sitemap | Register Now

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Reply
 
Thread Tools
Old 06-04-2007, 06:51 AM   #1
jcurts71
LQ Newbie
 
Registered: Oct 2005
Location: London
Distribution: Redhat, Centos, Debian
Posts: 3
can't run remote x-windows apps using ssh -X


[Log in to get rid of this advertisement]
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
jcurts71 is offline     Reply With Quote
Old 06-04-2007, 07:02 AM   #2
b0uncer
Senior Member
 
Registered: Aug 2003
Location: fin
Distribution: (B)LFS, Ubuntu, Slackware
Posts: 4,622
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.
b0uncer is offline     Reply With Quote
Old 06-04-2007, 08:06 AM   #3
jcurts71
LQ Newbie
 
Registered: Oct 2005
Location: London
Distribution: Redhat, Centos, Debian
Posts: 3
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 ~]#
jcurts71 is offline     Reply With Quote
Old 06-05-2007, 04:33 AM   #4
jcurts71
LQ Newbie
 
Registered: Oct 2005
Location: London
Distribution: Redhat, Centos, Debian
Posts: 3
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*
jcurts71 is offline     Reply With Quote

Reply

Submit thread to Digg | Submit thread to del.icio.us | Submit to LQ Bookmarks

« Back to Top »

Thread Tools

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

vB 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



Add LQ To Your Yahoo Add LQ To Your Google Add LQ To Your MSN Add LQ To Your Blog
All times are GMT -5. The time now is 07:46 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Open Source Consulting | Domain Registration