Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 

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
share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
How to get the hex_key? How to assign a DISPLAY? – david.perez Jun 28 at 6:32

You must log in to answer this question.

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