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
MountainX
  • 5,969

3 Answers3

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.

Scott Goodgame
  • 2,646
  • 16
  • 20
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
MountainX
  • 5,969
0

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

apt-get install xauth
touch ~/.Xauthority