How to enable "-listen TCP" in Xvnc on Red Hat 8.4

1.3k views Asked by At

By default, older versions of Xvnc listened for connections from x-windows clients on ports 6000+. This functionality could be disabled by the "-nolisten TCP" command line option. In turn, the GNOME desktop manager controlled this option via the "DisallowTCP" setting in /etc/gdm/custom.conf.

More recently, "-nolisten TCP" is the default behavior and listening on port 6000+ has to be explicitly enabled with "-listen TCP". The GNOME desktop manager is supposed to be smart enough to know that "DisallowTCP=false" equates to "-listen TCP", but in RHEL 8.4, this does not appear to work.

Has anyone found a way to enable listening on ports 6000+ on RHEL 8.4?

1

There are 1 answers

7
Andrew Vickers On

So it turns out that the "right" solution to my problem is to let the application/xwin libraries figure out for itself the best mechanism to use for connecting to the local xwindows server. The missing piece was that the xwindows server has to allow connections from processes that it does not control (i.e. those started by the GNOME desktop).

I solved the problem as follows:

  1. In the user's ~/.vnc/xstartup file, add the command 'xhost +'
  2. Restart the vncserver service to pick up the change.
  3. When the remote process has connected via SSH, set the display environment variable without specifying the host: 'export DISPLAY=':1', before running the xwin application.

Problem solved without using TCP.

I still think this is a Red Hat/GNOME bug, but at least I can work around it to solve my real problem.