Since I upgraded from Ubuntu 18.04 to 19.10 my remote TCP-XWindows broke, and I need it for work.

I'm working on a really old currently-in-production system which uses old-style X11 TCP connections. It cannot use SSH X-forwarding. I need to make Ubuntu accept remote TCP connections (from an aging Solaris box).

This is closely related to How to make X.org listen to remote connections on port 6000?. However, I have done everything in the answers and the problem remains.

I need to be able to run a remote X-Windows application, e.g.:

xeyes -display

And have it appear on my local workstation. But what I get is (of course):

Error: Can't open display:

I have edited /etc/gdm3/custom.conf, to contain:


ServerArguments=-listen tcp

I am definitely running gdm, and not lightdm.

I have also edited /etc/X11/xinit/xserverrc, such that it now says:

exec /usr/bin/X -listen tcp "$@"

Although I expect that gdm modifies this anyway.

I have issued the command xhost +remote_server_name and xhost + (in desperation).

I can see X11 listening on port 6001. (x11-1 is 6001 in /etc/services ... why is this not x11-0 / 6000?)

$ netstat -a | grep x11
tcp        0      0 *               LISTEN
tcp6       0      0 [::]:x11-1              [::]:*                  LISTEN

(and rebooted after these changes).

Has some "extra layer" of configuration been added in Ubuntu 19 to prevent X11 running in this manner?

EDIT: It seems like the processes are running OK:

 2196 tty2     Ssl+   0:00 /usr/lib/gdm3/gdm-x-session --register-session --run-script --allow-remote-connections cinnamon-session-cinnamon
 2198 tty2     Sl+   16:53 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -listen tcp -background none -noreset -keeptty -verbose 3

EDIT2: Update for commenters The old application is passed the display on the command-line, e.g.: --display It then takes it upon itself to open further windows on the remote display.

I have tried xhost +, it made no difference.

  • 6001 would be screen :1, so try (on Ubuntu 16.04) xinit /usr/bin/xterm -- :1 vt3 The later desktops made running X more of a problem getting another screen up (on virtual term 3 (ctrl-alt-F3). – ubfan1 Nov 6 '19 at 17:54
  • How do you start the application on the Solaris machine? What is the DISPLAY variable set up to on it? – wazoox Nov 8 '19 at 15:49
  • Can you try running xhost +, and retry the remote X application command? This will disable access control to the running X Server, and will indicate if this is the problem. – vidarlo Nov 10 '19 at 17:34

I am using Ubuntu 20.04. I could not connect to port 6000, despite all the options you are talking about.

What finally works is this hack:

sudo vi /usr/bin/Xorg

and add -listen tcp to the Xorg command(s):

#exec "$basedir"/Xorg.wrap "$@"
 exec "$basedir"/Xorg.wrap "$@" -listen tcp

Then save and exit the file and restart the user graphical interface:

 sudo service gdm restart

and then check that port 6000 is open:

 nmap localhost

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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