Open remote application window over ssh – X11

You left the office but forgot to leave an application running.  An application that requires it’s GUI, you try to open it via ssh but “Error: Can’t open display” prevents you.

Simple fix here, you will kick yourself.

DISPLAY=:0 <command>

for me this translated into

DISPLAY=:0 transmission

What this does is instruct the application to open in display 0, which is the remote machine.

Posted on December 29, 2009 at 8:18 am by Jordan Carter · Permalink
In: Ubuntu Tricks · Tagged with: , , ,

2 Responses

  1. Written by Brian
    on January 3, 2010 at 5:22 pm
    Permalink

    Neat trick, but why not just use VNC ?
    If you’ve got SSH working, the rest is pretty simple.
    Install tigervnc viewer, then tigervnc-server on the remote.
    Then, you can SSH into the remote and launch the server using:
    x0vncserver -SecurityTypes=none -display=:0
    Simply specify the display, and disable password protection.
    Then, in another console, launch the viewer using:
    vncviewer -via [email protected] localhost
    The ‘-via’ option sets up your SSH tunnel.
    It then connects to ‘localhost’ at the remote end.
    Simple, quick and you can see what you’re doing :)

  2. Written by Jakob
    on November 25, 2010 at 8:06 am
    Permalink

    Thanks, man! Just what I was looking for!

Leave a Reply