?
Solved

Error: Unable to initialize gtk, is DISPLAY set properly?

Posted on 2011-02-25
13
Medium Priority
?
4,705 Views
Last Modified: 2012-05-11
when i run a program from root through ssh , i get above error?

any help ?
0
Comment
Question by:aashee
  • 6
  • 6
13 Comments
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 34978548
What program are you trying to run?
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
ID: 34978577
Sounds like you are trying to run a program which pops up a window and it doesn't know where to display it because it's being run remotely.
0
 

Author Comment

by:aashee
ID: 34978641


hype from below website

http://www.visualappliance.com/products/hype/

i have sshed into sys18

below is output

[root@sys18 hype]# cd /usr/local
[root@sys18 local]# cd hype
[root@sys18 hype]# ./hype
11:33:28: Error: Unable to initialize gtk, is DISPLAY set properly?
[root@sys18 hype]#


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:aashee
ID: 34978659
Hi Martin,

yes looks like this. how can  i ask it to display it on my computer.
i have ssh  into this sys18. my machine name is different. ?

how can i fisx it please?
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
ID: 34978722
If you want to display onto your machine you will need to have an "X" server running on your computer.  You also need to set the DISPLAY environment variable to point to your machine with a command like this:
  export DISPLAY=mymachinename:0.0

If your own machine is also running Linux then you should be able to do that by typing "xhost +" on your local machine and then in the ssh command do something like
  ssh user@sys18 'export DISPLAY=mymachinename:0.0 ; my-ssh-command'

If your own machine is running Windows then you will need to install an X-Windows server on your PC.  I use Hummingbird's eXceed but that's not cheap.  You could try Cygwin but I've heard that's not as easy to set up.


Note - for some newer versions of Linux, like Redhat 5 and 6, the "xhost +" command may not be enough to allow remote display onto your desktop.  If you are running Redhat 5 on your local machine, you will also need to run:
   gdmsetup
Select Security tab and notice that the following setting is "checked":
"Always disallow TCP connections to X server (disables all remote connections)"
Take the 'tick' off, restart the GUI (CTRL-ALT-Backspace), and all is well - the "Xhost +" method should now work!
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
ID: 34978750
By the way, it would help to know if your own computer is running Windoze or Linux and if it is Linux, what version of Linux you are running.
0
 

Author Comment

by:aashee
ID: 34978762
linux and fedora 13 and also computer in which i have ssh it is also running fedora 13
0
 

Author Comment

by:aashee
ID: 34978771
Hi,

when i run this command, i get below error message .


[pflsml@vfx-lap-1][~] - xhost +
access control disabled, clients can connect from any host
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
ID: 34978788
That's not an error message - that is the X server telling you in a cryptic way that you have relaxed the security so that you can display things from other hosts on your machine!

If your local machine is called vfx-lap-1 then on the server you should now be able to type:
export DISPLAY=vfx-lap-1:0.0

and then re-run the command which is giving the gtk error.

If that still doesn't work, on your PC try the gdmsetup command that I outlined in an earlier post.
0
 

Author Comment

by:aashee
ID: 34978811
Hi Martin
Million thanks for all the help and support offered by you.

would exporting the display effect on the actual computer(sys18) and its user. ?

not that he would not be able to see anything ?

its a stupid question, i know.

if it doesn't effect anything on local user, then i'll run it
please update ?
0
 
LVL 10

Accepted Solution

by:
Martin_J_Parker earned 2000 total points
ID: 34978852
No - the "export DISPLAY" command is only active for the shell that you are typing it in - so it won't affect any other - user unless you do something daft like putting the export command into the user's .bash_profile file.  It won't even affect a different ssh session.  You would need that for every ssh session.

Note - the xhost command will only be active while you are logged in to your machine.  When you log out or restart your machine C that xhost access change will be removed and you will need to re-enter that "xhost +" command when you next log back in.

It looks like there may be a way of passing through the DISPLAY environment variables with the ssh command on your version of Linux.  Take a look at this: http://www.rootninja.com/get-x11-to-forward-in-gnome-on-fedora-12-or-13/

Cheers,
M.
0
 

Author Comment

by:aashee
ID: 34978871
hi Martin,

looks like that main issue is sorted now. but it gives me another error. below is output
should i post another question and you'll answer there. i really need to get it sorted soon. please
please help me.


./hype

(hype:2387): GLib-WARNING **: getpwuid_r(): failed due to unknown user id (1005)

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",

(hype:2387): Gtk-WARNING **: Unable to locate theme engine in module_path: "clearlooks",
Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory
Xlib:  extension "GLX" missing on display "vfx-lap-1:0.0".
Xlib:  extension "GLX" missing on display "vfx-lap-1:0.0".
*** glibc detected *** ./hype: free(): invalid pointer: 0x09f4bed0 ***
======= Backtrace: =========
/lib/libc.so.6[0x9a1b41]
/usr/lib/nvidia/tls/libnvidia-tls.so.260.19.29(+0xa20)[0xf742fa20]
./hype[0x83ce2fc]
./hype(_ZN8wxButton10SetDefaultEv+0x53)[0x83ce6fb]
./hype(_ZN17HypeMessageDialogC1EP8wxWindowRK8wxStringS4_S4_S4_S4_lb+0x66c)[0x81c6ee0]
./hype(_ZN9MainFrame11checkOpenGLEv+0x365)[0x81b41f9]
./hype(_ZN9MainFrameC1EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizel+0x87)[0x81aac83]
./hype(_ZN7HypeApp6OnInitEv+0x220)[0x8195d60]
./hype(_ZN12wxAppConsole10CallOnInitEv+0xf)[0x8197c83]
./hype(_Z7wxEntryRiPPc+0x3e)[0x837cb02]
./hype(main+0x18)[0x8195a6c]
/lib/libc.so.6(__libc_start_main+0xe6)[0x949cc6]
./hype(gtk_widget_grab_focus+0x31)[0x8195961]
======= Memory map: ========
00101000-00235000 r-xp 00000000 08:01 1621766                            /usr/lib/libX11.so.6.3.0
00235000-00239000 rwxp 00133000 08:01 1621766                            /usr/lib/libX11.so.6.3.0
0023b000-00264000 r-xp 00000000 08:01 1621788                            /usr/lib/libpangoft2-1.0.so.0.2800.0
00264000-00265000 rwxp 00028000 08:01 1621788                            /usr/lib/libpangoft2-1.0.so.0.2800.0
00267000-00284000 r-xp 00000000 08:01 1621722                            /usr/lib/libxcb.so.1.1.0
00284000-00285000 rwxp 0001c000 08:01 1621722                            /usr/lib/libxcb.so.1.1.0
00540000-0055e000 r-xp 00000000 08:01 1622681                            /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1
0055e000-0055f000 rwxp 0001d000 08:01 1622681                            /usr/lib/libgdk_pixbuf-2.0.so.0.2000.1
00561000-00588000 r-xp 00000000 08:01 1594151                            /usr/lib/libpng12.so.0.44.0
00588000-00589000 rwxp 00027000 08:01 1594151                            /usr/lib/libpng12.so.0.44.0
0058b000-00643000 r-xp 00000000 08:01 2101451                            /lib/libgio-2.0.so.0.2400.1
00643000-00645000 rwxp 000b8000 08:01 2101451                            /lib/libgio-2.0.so.0.2400.1
00647000-00659000 r-xp 00000000 08:01 2113707                            /lib/libz.so.1.2.3
00659000-0065a000 rwxp 00011000 08:01 2113707                            /lib/libz.so.1.2.3
0065c000-00671000 r-xp 00000000 08:01 2112292                            /lib/libresolv-2.12.2.so
00671000-00672000 r-xp 00014000 08:01 2112292                            /lib/libresolv-2.12.2.so
00672000-00673000 rwxp 00015000 08:01 2112292                            /lib/libresolv-2.12.2.so
00673000-00675000 rwxp 00000000 00:00 0
00677000-00694000 r-xp 00000000 08:01 2098877                            /lib/libselinux.so.1
00694000-00695000 r-xp 0001c000 08:01 2098877                            /lib/libselinux.so.1
00695000-00696000 rwxp 0001d000 08:01 2098877                            /lib/libselinux.so.1
00698000-00716000 r-xp 00000000 08:01 1622720                            /usr/lib/libcairo.so.2.10800.10
00716000-00718000 rwxp 0007e000 08:01 1622720                            /usr/lib/libcairo.so.2.10800.10
0071a000-0071c000 r-xp 00000000 08:01 1621780                            /usr/lib/libXcomposite.so.1.0.0
0071c000-0071d000 rwxp 00001000 08:01 1621780                            /usr/lib/libXcomposite.so.1.0.0
0071f000-0072d000 r-xp 00000000 08:01 1621786                            /usr/lib/libXi.so.6.1.0
0072d000-0072e000 rwxp 0000d000 08:01 1621786                            /usr/lib/libXi.so.6.1.0
00730000-007e3000 r-xp 00000000 08:01 1622488                            /usr/lib/libgdk-x11-2.0.so.0.2000.1
007e3000-007e6000 rwxp 000b2000 08:01 1622488                            /usr/lib/libgdk-x11-2.0.so.0.2000.1
007e8000-007ea000 r-xp 00000000 08:01 1621772                            /usr/lib/libXinerama.so.1.0.0
007ea000-007eb000 rwxp 00001000 08:01 1621772                            /usr/lib/libXinerama.so.1.0.0
007ed000-007f1000 r-xp 00000000 08:01 1622683                            /usr/lib/libXfixes.so.3.1.0
007f1000-007f2000 rwxp 00003000 08:01 1622683                            /usr/lib/libXfixes.so.3.1.0
007f4000-0085a000 r-xp 00000000 08:01 1580368                            /usr/lib/libpixman-1.so.0.18.0
0085a000-0085d000 rwxp 00066000 08:01 1580368                            /usr/lib/libpixman-1.so.0.18.0
0085f000-0086f000 r-xp 00000000 08:01 1622781                            /usr/lib/libXext.so.6.4.0
0086f000-00870000 rwxp 00010000 08:01 1622781                            /usr/lib/libXext.so.6.4.0
00872000-00879000 r-xp 00000000 08:01 1621782                            /usr/lib/libXrandr.so.2.2.0
00879000-0087a000 rwxp 00006000 08:01 1621782                            /usr/lib/libXrandr.so.2.2.0
0087c000-00887000 r-xp 00000000 08:01 1578712                            /usr/lib/libpangocairo-1.0.so.0.2800.0
00887000-00888000 rwxp 0000a000 08:01 1578712                            /usr/lib/libpangocairo-1.0.so.0.2800.0
0088a000-008a7000 r-xp 00000000 08:01 1622414                            /usr/lib/libatk-1.0.so.0.3009.1
008a7000-008a9000 rwxp 0001d000 08:01 1622414                            /usr/lib/libatk-1.0.so.0.3009.1
008ab000-008ad000 r-xp 00000000 08:01 1612501                            /usr/lib/libXdamage.so.1.1.0
008ad000-008ae000 rwxp 00001000 08:01 1612501                            /usr/lib/libXdamage.so.1.1.0
008b0000-008b9000 r-xp 00000000 08:01 1621776                            /usr/lib/libXcursor.so.1.0.2
008b9000-008ba000 rwxp 00008000 08:01 1621776                            /usr/lib/libXcursor.so.1.0.2
00911000-00920000 r-xp 00000000 08:01 2097233                            /lib/ld-2.12.2.so
00920000-00921000 -wxp 0000f000 08:01 2097233                            /lib/ld-2.12.2.so
00921000-0092f000 r-xp 00010000 08:01 2097233                            /lib/ld-2.12.2.so
0092f000-00930000 r-xp 0001d000 08:01 2097233                            /lib/ld-2.12.2.so
00930000-00931000 rwxp 0001e000 08:01 2097233                            /lib/ld-2.12.2.so
00933000-00ab7000 r-xp 00000000 08:01 2115011                            /lib/libc-2.12.2.so
00ab7000-00ab8000 ---p 00184000 08:01 2115011                            /lib/libc-2.12.2.so
00ab8000-00aba000 r-xp 00184000 08:01 2115011                            /lib/libc-2.12.2.so
00aba000-00abb000 rwxp 00186000 08:01 2115011                            /lib/libc-2.12.2.so
00abb000-00abe000 rwxp 00000000 00:00 0
00ac0000-00ac3000 r-xp 00000000 08:01 2101462                            /lib/libdl-2.12.2.so
00ac3000-00ac4000 r-xp 00002000 08:01 2101462                            /lib/libdl-2.12.2.so
00ac4000-00ac5000 rwxp 00003000 08:01 2101462                            /lib/libdl-2.12.2.so
00ac7000-00ade000 r-xp 00000000 08:01 2115012                            /lib/libpthread-2.12.2.so
00ade000-00adf000 r-xp 00016000 08:01 2115012                            /lib/libpthread-2.12.2.soAborted (core dumped)
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
ID: 34978943
Do you perchance have nvidia graphics on your PC?  And if so, are you still using the graphics drivers which came with your version of Linux?

If that is the case, download some new drivers from www.nvidia.com and install them on your local machine.  The redhat supplied ones are bloody useless for 3D work!

The errors to be worried about to start with are:
Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory
and:
Xlib:  extension "GLX" missing on display "vfx-lap-1:0.0".
Xlib:  extension "GLX" missing on display "vfx-lap-1:0.0".

Do you get that missing shared object file if you run the program directly on the server's screen?
It could be that something is missing from your PATH if it can't find the libcanberra-gtk-module.so object.

If the new NVidia drivers do not fix the GLX problems, then you will need to look into configuring the /etc/X11/xorg.conf file - but replace the NVIDIA driver first before trying anything else!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question