Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

This is on Ubuntu 10.10 (Maverick Meerkat) 64-bit desktop.

I want to make my X server listen to remote connections from clients in other machines on the local network. I know about ssh -X and that is not what I want. I vaguely remember changing something like TCPListen from no to yes, but I don't remember where this change should be applied.

I'm interested in either a GUI method or a CLI one.

PS editing /etc/X11/xinit/xserverrc to remove the -nolisten tcp option and rebooting does not work.

share|improve this question
Hint It is probably worth disabling the firewall (iptables) while you are trying to get things going. – user243114 Feb 3 '14 at 12:55
@user243114 hint returned unused, but thanks anyway :) – ΤΖΩΤΖΙΟΥ Feb 4 '14 at 19:17
up vote 9 down vote accepted

(Here follows an almost verbatim copy of a self-answer from an identical question on serverfault which I'd forgotten about; askubuntu wasn't yet created).

Based on information found in this page about enabling XDCMP and the file /etc/gdm/gdm.schemas, I managed to create a /etc/gdm/custom.conf file:

# /etc/gdm/custom.conf




Take care with letter case: it won't work, if you write "disallowTCP=false"... I also changed the /etc/X11/xinit/xserverrc file to:

exec /usr/bin/X11/X

i.e. I removed the -nolisten tcp options to the X executable. I don't know if I needed to. You might want to try avoiding this edit.

If you only change the xserverrc file, X will nevertheless start with "-nolisten TCP".

After that, all that is needed is a restart of the gdm process:

sudo service gdm restart

You can verify the success as:

$ netstat -an | grep -F 6000
tcp        0      0  *               LISTEN
tcp6       0      0 :::6000                 :::*                    LISTEN


After an upgrade to 12.04, I had the same issue. This time, the culprit is the lightdm that the system uses. The file that needs to be updated is /etc/lightdm/lightdm.conf and the required addition is a xserver-allow-tcp=true in the [SeatDefaults] section.

And afterwards, I also found that answer. :)


So, in 10.10 this still works: create /etc/gdm/custom.conf with contents as specified above and restart gdm.

share|improve this answer
For Ubuntu 14.04, the only thing needed is having a file like /usr/share/lightdm/lightdm.conf.d/100-custom.conf containing ` [SeatDefaults] server-allow-tcp=true ` – Nitz Mar 2 '15 at 19:18
@Nitz, note that's xserver-allow-tcp=true you are missing the 'x' in your comment. You could delete your existing comment and rewrite it. Although the answer includes that solution now. – Alexis Wilke May 17 at 22:12

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.