I know -X -Y options in ssh for X11 forwarding.But these options open the gui apps on my pc.But I want to open a gui application "exactly" on target machine. So please help me with this. I tried this but ended up with the following error.

No protocol specified
No protocol specified
No protocol specified
Error: cannot open display: :0

You need to run xhost to allow connections from that user. The following will allow anybody to open windows on that machine:

xhost +

Note that this needs to be run in a terminal that is running on the X server. See the xhost manpage for more information.


If you want to see the screen of the machine you're connecting to, use VNC. This will make everything you do appear as if you did it on the target machine's desktop. sudo apt-get install x11vnc and then start x11vnc from the command line.

If you want to start applications on an invisible screen that you can connect to and display from any location, use xpra. You can even show the "virtual screen" on one machine, then disconnect, and connect from another machine (over SSH) and show the same screen, all without terminating the session.

  • I don't think either of these is what he was asking for. It sounds like he wants to open an application on the local display while logged in remotely over ssh. You don't need any extra applications to accomplish this (see my answer below). – pestilence May 11 '12 at 16:47
  • 1
    he should make sure the question is clear. :P maybe this is what he wants, maybe he wants what you said. xpra will work for him even if X forwarding over SSH would have been enough. – Janus Troelsen May 11 '12 at 21:04

I assume that the x-server is already running on the machine you connect to. Before you execute the command on the remote machine run the following command:

export DISPLAY=:0

Now you can start your x-application, should pop up on the display 0.


Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.