Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 27
Hi All, I have below problem and I tried many options but still it doesn't work. 1) I am looging(putty) into Linux(Redhat) box with root user. 2) I am setting ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    17

    GTK warning :can't open display


    Hi All,

    I have below problem and I tried many options but still it doesn't work.

    1) I am looging(putty) into Linux(Redhat) box with root user.
    2) I am setting a display of the same machine to itself ith below comand
    export DISPLAY=localhost:1
    3) try to run firefox
    And it is giving me below error:

    Xlib: connection to "10.58.190.140:2.0" refused by server
    Xlib: No protocol specified


    (firefox-bin:11451): Gtk-WARNING **: cannot open display:

    I checked /etc/ssh/sshd_config file and it has

    AllowTcpForwarding yes
    #GatewayPorts no
    X11Forwarding yes
    #X11DisplayOffset 10
    X11UseLocalhost yes
    PrintMotd yes
    PrintLastLog yes
    TCPKeepAlive yes

    Please help me out in this regard as i am not able o find any way out and it's taking long time.........

    Regards,
    savita

  2. #2
    Just Joined!
    Join Date
    Jan 2010
    Posts
    4
    You shouldn't have to manually set DISPLAY if putty is configured for X11 forwarding. I believe the setting is under "Connection", "SSH", "X11". Make sure the box is checked next to "Enable X11 forwarding". Once this is done, and you connect to your Linux host, DISPLAY should already be set ( test with "echo $DISPLAY" ).

    What X server are you running in Windows? xWin32? Cygwin?

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    17
    HI,

    I am really new to Linux so wht u said like

    "Make sure the box is checked next to "Enable X11 forwarding"

    I didn't understand how to do it?

    echo $DISPLAY gives:

    10.58.190.140:1

  4. #4
    Just Joined!
    Join Date
    Jan 2010
    Posts
    4
    No problem. I assume you are running putty from Windows. In the attached screen shot you will see the section that has "Enable X11 forwarding".

    Having putty ( or any ssh client ) configured for X11 forwarding is only part of the equation. You will need an X11 server running on your Windows machine to render the graphical display ( Firefox in your example ).

    X11 is a client/server protocol. Your X11 client ( Firefox ) needs to be displayed on an X11 server ( software running on your Windows box ). The same thing happens when you start graphical programs on any desktop that uses X11, only the clients and server are the same box.

    Confused? Don't be. It just takes a little getting used to.
    Attached Images Attached Images

  5. #5
    Just Joined!
    Join Date
    Jul 2009
    Posts
    17
    Thanks.However I don't want to setup a display of windows machine to Linux but I want cronjob to run to setup DISplay of same machine to itself.

    I have started VNCSERVER and use same session of vncserver to export display to the same machine.

  6. #6
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,743
    Just my thoughts:
    When you invoke GUI binary say "mygui". From crontab Try and start xterm first then run the command. Something like
    xterm -e "/path/to/mygui"
    EDIT: First I would suggest you to run standard GUI application like firefox then try your own UI.

    xterm -e "firefox"
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  7. #7
    Just Joined!
    Join Date
    Jul 2009
    Posts
    17
    After foollowing I am getting below error :

    Xlib: connection to "10.58.190.140:1.0" refused by server
    Xlib: No protocol specified

    Please help

  8. #8
    Just Joined!
    Join Date
    Jul 2009
    Posts
    17
    Evenif I tried

    $xterm

    It gives below error:
    Xlib: connection to "10.58.190.140:1.0" refused by server
    Xlib: No protocol specified

    xhost: unable to open display "10.58.190.140:1"

  9. #9
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,743
    Check this thread http://www.linuxforums.org/forum/deb...specified.html

    May be login as Non-root user and run your command.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  10. #10
    Just Joined!
    Join Date
    Jul 2009
    Posts
    17
    NOPE THIS ALSO DOESN'T WORK.

    I tried with both root as well as other user bt same problem

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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