Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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'm struggling to set up X-forwarding between 2 different machines on my local network and my ubuntu desktop. I'm able to connect using ssh x-forwarding one one machine, but the other machine (a Qnap TS-219P II) seems to have a less functional build of SSH on it, and I'd rather use a simpler approach.

I've set $DISPLAY, and done 'xauth list $DISPLAY' on the desktop, then 'xauth add ' on the remote machine.

From the remote machine, I just get

xterm Xt error: Can't open display:

Now, oddly, if I connect via ssh -X, there is a different magic cookie for the tunnelled port (but neither seems to work). I'm wondering if there is a port which needs to be enabled to permit X connections from the LAN? If so, how?

The proper solution might be to re-build all the packages which are preventing X-forwarding from working on my QNAP machine, but lets assume for the purposes of this question that I've tried building enough packages on that architecture already and want to run X without the overhead of encryption.

share|improve this question

Make sure the X server on is not being started with the -nolisten tcp flag that disables opening the TCP ports, and that port 6000 + display number (in your case, 6000 for display :0) is not blocked in a firewall along the network path.

Also, for ssh, check the X11Forwarding settings in /etc/ssh/ssh_config, /etc/ssh/sshd_config, and $HOME/.ssh/config.

share|improve this answer

I found the definitive place to make the change in /etc/gdm/custom.conf


which should cause GDM to start the Xserver without the -nolisten tcp flag in Ubuntu.

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.