Results 1 to 7 of 7

Thread: getting "can't open display" when using ssh

  1. #1
    Join Date
    Jul 2011
    Location
    The Great Ocean
    Beans
    Hidden!
    Distro
    Lubuntu

    getting "can't open display" when using ssh

    I'm used to ssh-ing to my other box, and running GUI apps after setting DISPLAY=:0
    The X server is on the box i'm ssh-ing to because i'm not using ssh -X.
    With the upgrade to 12.04.1, this stopped working (coincidence?)

    I'd like to get this working so I can run programs from ssh.

  2. #2
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,485

    Re: getting "can't open display" when using ssh

    Quote Originally Posted by marinara View Post
    I'm used to ssh-ing to my other box, and running GUI apps after setting DISPLAY=:0
    The X server is on the box i'm ssh-ing to because i'm not using ssh -X.
    With the upgrade to 12.04.1, this stopped working (coincidence?)

    I'd like to get this working so I can run programs from ssh.
    FWIW: The X *server* is the computer having a physical display, so normally the computer in front of you.

    DISPLAY=:0 ... ? That points to the same machine. No IP address needed?

    And why don't you use 'ssh -X'? That works for me without difficult DISPLAY stuff.

  3. #3
    Join Date
    Apr 2010
    Beans
    39

    Re: getting "can't open display" when using ssh

    May be a question of permissions. Type:
    Code:
    xhost
    This command will tell you which users has access to that computer's X server.
    If your user is not listed, add it:
    Code:
    xhost +SI:localuser:<user>
    If you want to grant access to anyone you can do so with xhost +, but this is not recomended for security iissues.

    I hope this work for you.

  4. #4
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: getting "can't open display" when using ssh

    To followup on what sanderj wrote, you need to have the x-server on the machine on which you will actually do the viewing. Then connect to the remote machine with the -X option. Setting DISPLAY=:0 on the remote machine will cause the program to be displayed on the remote machine itself, if it has an X-server running.

    Alternately, instead of using the -X option each time, if you're always going to use X forwarding, you could modify ~/.ssh/config and make an entry for that host:

    Code:
    Host otherbox
      HostName otherbox.example.edu
      ForwardX11 yes
    Either way, you want to leave the DISPLAY variable alone.

  5. #5
    Join Date
    Nov 2009
    Beans
    Hidden!

    Re: getting "can't open display" when using ssh

    For me, sometimes

    ssh -Y
    works. (and no, this is not a lame joke )

  6. #6
    Join Date
    Jul 2011
    Location
    The Great Ocean
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: getting "can't open display" when using ssh

    I tried xhost +
    Didn't work.
    ssh -X works fine. That's not my problem. I want the X server to be on the machine I ssh to. Most likely I installed something stupid, and broke it somehow.

  7. #7
    Join Date
    Jul 2011
    Location
    The Great Ocean
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: getting "can't open display" when using ssh

    http://ubuntuforums.org/showpost.php...4&postcount=11

    oops, apparently I was doing
    DISPLAY=:0
    when i needed to do
    export DISPLAY=:0



    marking thread as solved. thanks for pushing the ball foward. I feel much relieved.

Bookmarks

Posting Permissions

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