ssh – DISPLAY is not set – Failed to allocate internet-domain X11 display socket

A little ssh error I came across while trying to work remotely on an Ubuntu machine. ssh X Display Forwarding wasn’t working, and I was getting an error:

DISPLAY is not set

Digging through /var/log/auth.log, I also noticed this error:

Failed to allocate internet-domain X11 display socket

After much Googling, it seems that IPv6 was causing the problem. It was solved by adding:

AddressFamily inet

to /etc/ssh/sshd_config, and restarting the ssh server.

Tags: ,

Share This


11 Responses to ssh – DISPLAY is not set – Failed to allocate internet-domain X11 display socket

  1. Thank you for that one.

  2. good stuff dude. i recently disabled ipv6 across applications and started getting this error. AddressFamily inet seems to be the solution.

  3. thx!

  4. Worked for me too on Arch Linux

    My exact problem was that I had already disabled IPv6 for performance. And it seems that X11 Forwarding is dependent on that. As per Leho above.

    So I needed to set IPv4 explicitly in sshd_config


    • Great, thanks Robin. I’m seeing more and more people using Arch, I might give it a go…

      • NP. Arch boosts learning tech by its very nature. I recommend it.

        I got my CCIE in ’98 and soon became furious with how tech was being dumbed down. So gave up and went into economics.

        I’m back. Arch has helped immensely here. It forces you to really understand the system. But you have to really mean it. Thee is no fake qualification or degree.

  5. Amazing, worked perfectly on RHEL6 after IPv6 removal.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>