Find the answer to your Linux question:
Results 1 to 5 of 5
Hey Gurus, I am using Putty on a windows 7 machine trying to access my server, that part works fine. As soon as I try to access a program installed ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    3

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


    Hey Gurus,

    I am using Putty on a windows 7 machine trying to access my server, that part works fine. As soon as I try to access a program installed that has a GUI I receive the above error (Error: Unable to initialize gtk, is DISPLAY set properly?).

    After lots of google power I learned that the DISPLAY variable needs to be set to my windows machine (I believe, so my IP?), if I print display:
    Code:
    echo $DISPLAY
    It returns an empty line, so blank.

    I learned from this forum when using Putty you need to check of the X11 security enabled, which I have. Even with that checked if I go to the server and echo out DISPLAY it is still blank.

    Any advice on how to possibly debug this more?

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,763
    You have not done two things:

    1) Enable X11 forwarding (setting in Putty)
    2) Run a local X server on your Windows 7 system (in order to "display" the X11 data that will be sent from the Linux system)

    Xming is one example of a Windows X server application.

    * FYI, almost anything that needs to be done can be done via the command line. "Exporting" the GUI is only needed for GUI applications.

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Posts
    3
    Hi HROAdmin26,

    Thank you very much for the reply and information!

    1) I enabled X11 forwarding in the Putty Settings
    2) I installed Xming and started the application, It says its running Server:0.0

    I then logged into the server and echoed out DISPLAY, still bank. I then tried these options:
    Code:
    DISPLAY=Server:0.0
    This still gave me the DISPLAY error.

    Code:
    DISPLAY=127.0.0.1:0.0
    Localhost ip which I found in the log file presented by Xming. Figured I would just try it haha (noob mistake I'm sure).

    Gave me the display error again.

    Sadly, the program I'm trying to access only works within the GUI, its command line does not function to the fullest.

    Thank you again for the advice and direction - am I possibly missing something? Maybe I can send a debug that might give a clue?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,763
    If you have X11 forwarding enabled, then when you login via SSH, you'll see that DISPLAY has been set to some local port:

    Code:
    echo $DISPLAY
    localhost:10.0
    And when you set up Xming to run, you need to add the IP of the Linux system as "allowed" or else select "No Access Control." The Xming documentation has more info. Are you sure X is installed on the Linux system?

    Sorry, that's about all the setup/config there is to it.

  6. #5
    Just Joined!
    Join Date
    Feb 2012
    Posts
    3
    Hello once again,

    First, thank you again for the information!

    Okay, after a lot of trial and error and more research I'm getting to a point were I might have to call in a pro lol.

    If you don't mind, please review my steps / settings one more time:

    1. I checked sshd_config file and made sure X11Forwarding was turned to "yes", which it was.

    2. In PuTTY I checked the box for X11Forwarding and set the path to Server:10.0

    3. I started the putty connection and logged in, echoed out DISPLAY and it was blank.

    4. Started Xming which was running on Server:10.0 (The reason I used this was just what Xming setup, I did not do that myself)

    5. Still nothing, so then I tried to set DISPLAY=Server:10.0, then tried again and still nothing.

    Seeing any issues with my process? Thank you again for the assistance!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •