1

I can log into the remote Ubuntu (Kubuntu 12.04) machine. Using the info from (How to start a GUI software on a remote Linux PC via SSH) I tried the following after logging in:

user@Kub:~$ export DISPLAY=:0
user@Kub:~$ firefox
No protocol specified
No protocol specified
No protocol specified
No protocol specified
Error: cannot open display: :0

I expected the same success as stated at the question referenced. Unfortunately, as you see it didn't work for me. The machine has 3 displays. Could that be the issue?

Is there a simple solution? I also read (https://unix.stackexchange.com/questions/10121/open-a-window-on-a-remote-x-display-why-cannot-open-display) but I didn't understand how to use or apply that advice. It was too complicated. I appreciate any relatively simple solutions.

I looked at a running GUI process (Kate) with this:

# cat /proc/2857/environ | tr \\0 \\n | grep -E '^(DISPLAY|AUTHORITY)=' 
DISPLAY=:0

That further confuses me as to why this didn't work.

Using Scott Goodgame's suggestion (below), I tried this:

  1. login with -X and -C options on SSH.
  2. export DISPLAY=:0
  3. firefox &

The result was:

$ No protocol specified
No protocol specified
No protocol specified
No protocol specified
Error: cannot open display: :0
3
  • I'm still looking for a solution.
    – MountainX
    Jul 8, 2013 at 22:58
  • After login (with : ssh -X -C user@MyIp) please DON'T redefine the variable DISPLAY! You do have already defined one - with -X May 20, 2015 at 12:30
  • @ user2018368 Note that this is not what the OP asked. He wants the application to display on the remote machine (not on the local display). The only solution that actually worked for me was MountainX's answer.
    – arielf
    Jun 24, 2016 at 1:31

3 Answers 3

2

A simple way to be able to start graphical programs is to start ssh like so... ssh -X -C user@MyIp it will then start your ssh session like normal, but you can then start an X program like so.. firefox & this will start firefox on the remote machine, display it local to you, and return you to the ssh prompt.

4
  • This gives me: $ Error: no display specified
    – MountainX
    Jun 24, 2013 at 4:48
  • Odd, just tested on my network and works fine... I'll poke around and get back. Jun 24, 2013 at 6:35
  • My SSH connection is via a reverse tunnel. Maybe that's the reason?
    – MountainX
    Jun 24, 2013 at 18:38
  • I'm still looking for a solution
    – MountainX
    Jul 8, 2013 at 22:56
1

I'm on Kubuntu 12.04. Here is what worked for me with an example of how to start x11vnc remotely.

First run the command ps wwwwaux | grep auth to find the xauth cookie. The result will look similar to this:

root      1592  3.6  6.2 665544 1023456 tty7   Ss+  Jul14 288:35 /usr/bin/X :0 vt7 -br -nolisten tcp -auth /var/run/xauth/A:0-ABCDEF

The part of interest is at the end of that line: /var/run/xauth/A:0-ABCDEF
(where ABCDEF is a unique random(?) string)

Next insert the result from that into this command:

sudo x11vnc -rfbport 5901 -rfbauth ~/.vnc/passwd -display :0 -shared -xauth /var/run/xauth/A\:0-ABCDEF
0

You need xauth to allow exporting of the display and create an empty Xauthority file.

apt-get install xauth
touch ~/.Xauthority

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .