Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It seems every version of Ubuntu has a different way to enable remote connections to the local X server.

I'm asking this question, while I do my own research: how can I enable the X server listening to TCP port 6000 on my machine, thus allowing remote X clients to connect to said port and use my display?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

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

# /etc/gdm/custom.conf




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.

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
share|improve this answer
add comment

if found it in /etc/gdm/gdm.schemas

converted true to false, now it works



share|improve this answer
I tried this and and the other /etc/gdm/custom.conf tweak, restarted gdm. ps shows X is no longer running with -nolisten tcp ... and yet tcp X connections are still denied even after using xhost + . I'm running Ubuntu 10.10. (Like others, I have a couple use cases where ssh X forwarding is insufficient such using Emacs to open frames on multiple displays). Anything else I can try? –  djb Apr 6 '11 at 12:16
add comment

In later versions of ubuntu the procedure above no longer works due to a new display manager LightDM. To check this execute the shell command:

    ps aux | grep `cat /tmp/.X0-lock'

and check for lightdm and the notcp switch. If found update your system by adding to /etc/lightdm.conf the following entry in the [SeatDefaults] section:


Finally restart your computer and check it works with

   netstat -an | grep -F 6000

as shown above.

share|improve this answer
add comment

Of course, it's more convenient and secure to use ssh's X forwarding, so I assume there's some pressing reason not to do that...

ssh -X destination

share|improve this answer
Yes: a 500 MHz Geode LX processor in the other side of the secure local network doing already too much for the 5 watts it requires, whose hardware AES module is not being used by OpenSSL on linux; no way to open an SSH connection with no encryption at all; no reason to spare a couple megabytes of the non-upgradeable 256 MiB of said server for an otherwise unneeded SSH process. Your intentions were good, but I really meant my question as-is; your answer is currently not helpful, and should probably be a comment to my question. –  ΤΖΩΤΖΙΟΥ Jan 5 '10 at 0:16
add comment

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.