Question

I have an interesting issue - on Windows using Xming I can forward X11 requests to my client (PC) successfully and can run the applications. However, I have recently installed Ubuntu 13.04 on my PC and somehow I couldn't make it work.

My /etc/ssh/ssh_config has the following lines:

Host *
ForwardAgent yes
ForwardX11 yes

And I try connecting using the command:

ssh -X -v username@xxx.xxx.xxx.xxx 

The verbose output shows me:

X11 forwarding request failed on channel 0

I have also executed xhost + to disable all access control on client, but the weird thing is on my client the DISPLAY variable is set to :0 and I cannot replace it with anything else such as localhost:0 or even $Local_IP:0, X11 won't work when I do that, see sample output below - I suspect this could lead to an answer:

koray@koray-Latitude:~$ export DISPLAY=localhost:0 # $localip:0 doesn't work either
koray@koray-Latitude:~$ emacs
Display localhost:0 unavailable, simulating -nw
koray@koray-Latitude:~$
Was it helpful?

Solution

I solved it - it was an authentication issue. Executing the following line on Server resolved the issue:

$ xauth add ${client_ip}:0 . ${hex_key}
xauth:  creating new authority file /homes/${username}/.Xauthority

where ${client_ip} is the client with X server running, ${hex_key} is the 32-character hex string. Afterwards upon assinging the $DISPLAY env variable I can now connect successfully.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top