Server Fault is a question and answer site for system and network administrators. 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 try connect over ssh with

 ssh -X user@host

but I get

$ xterm
xterm Xt error: Can't open display: xterm:  DISPLAY is not set

$ echo $DISPLAY
# ... nothing

In my sshd_config I have

X11Forwarding yes
X11DisplayOffset 10


In /var/log/auth.log I get

 sshd[7396]: error: Failed to allocate internet-domain X11 display socket.
share|improve this question
What is the output of $ echo $DISPLAY – AndresSM Jun 20 '12 at 16:37
Is an X server running on your source? Before you ssh anywhere else, echo $DISPLAY – Sirch Jun 20 '12 at 16:42
@Andres with echo $DISPLAY I get nothing – JuanPablo Jun 20 '12 at 16:55
up vote 2 down vote accepted

I found the problem, I dont have lo, I fix the problem added to file /etc/network/interfaces the lines

auto lo
iface lo inet loopback
share|improve this answer
After all the suggestions of "AddressFamily inet" or "install xauth" etc, this was the actual fix for me. Thanks – Coops Jan 14 at 5:34

If ipv6 is causing an issue, add this to /etc/ssh/sshd_config and restart ssh.

AddressFamily inet
share|improve this answer
I try add AddressFamily inet and restart sshd but get the same, and try ssh -4 to force ipv4, but nothing – JuanPablo Jun 20 '12 at 16:30
This worked for me. – sirhc Apr 28 '15 at 22:18

make sure that the xauth package is installed on BOTH machines

share|improve this answer
yes, xauth is installed in both machines – JuanPablo Jun 20 '12 at 14:47

Try exporting the display value prior to logging in, like:

export DISPLAY=localhost:0.0

Then ssh in:

ssh -Y user@host

if it's not working using

ssh -X user@host
share|improve this answer

Run xhost + and then, the ssh command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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