Today it’s not uncommon to need to connect to the few of our Linux servers that use GUI’s. The simplest way is to configure it to allow XDMCP logins. Before proceeding you should be aware that this should be used for INTERNAL use only. Let’s get started.
XDMCP (X Display Manager Control Protocol) lets an X server on another machine, such as Xming on a Windows PC, ask the Linux display manager (GDM on CentOS 6) for a graphical login screen. Nothing is encrypted, passwords included, which is why it belongs on a trusted internal network only.
Prerequisites
- CentOS 6 (or RHEL 6) with a desktop and GDM installed, normally booting to runlevel 5.
- Root access and console access, because restarting X kicks off anyone logged in on the console.
- An X server on the client, for example Xming or VcXsrv on Windows.
Steps
Login, and su to root

from here we are going to edit the gdm custom configuration
vi /etc/gdm/custom.conf
![/etc/gdm/custom.conf with DisallowTCP=false, AllowRemoteRoot=true and [xdmcp] Enable=true](https://blog.zwiegnet.com/wp-content/uploads/2026/07/image-1915.png)
your configuration file should look as follows:

[security]
DisallowTCP=false
AllowRemoteRoot=true
[xdmcp]
Enable=true
- [xdmcp] Enable=true is the line that matters: GDM starts listening for XDMCP requests on UDP port 177.
- DisallowTCP=false lets the local X server accept TCP connections. It is not required for remote XDMCP logins and can be left out.
- AllowRemoteRoot=true allows root to log in over XDMCP. For anything beyond a lab, leave it out and log in as a normal user, then use su or sudo.
from here we need to restart X for the changes to take place. Do so with the following commands:
init 3, followed by init 5
Runlevel 3 stops the graphical session and GDM, and runlevel 5 starts them again with the new configuration.
If iptables is enabled, allow XDMCP from your internal network (replace the subnet with yours) and save the rules:
iptables -I INPUT -p udp --dport 177 -s 192.168.1.0/24 -j ACCEPT
service iptables save
now we can test from windows using Xming

Perfect, i configured a XDMCP session in Xming Client, and it let me connect just fine!
In XLaunch choose a display mode (One window is the easiest), then Open session via XDMCP, select Connect to host and enter the server’s IP address or name. The CentOS GDM login screen should appear in the Xming window.
If you are Using CentOS/Xnest, please check out the following:
http://blog.zwiegnet.com/linux-server/install-xnest-centos-6/

Verify
On the server, check that GDM is listening on UDP 177:
netstat -ulnp | grep 177
Troubleshooting
- Xming opens but stays black: after XDMCP negotiation the server connects back to the client’s X server on TCP port 6000. Allow Xming through the Windows firewall, and make sure the server can reach the client (no NAT in between).
- Nothing happens at all: UDP 177 is blocked or GDM did not restart. Recheck the iptables rule and repeat init 3 / init 5.
- Login screen appears but root is refused: that is AllowRemoteRoot doing its job when it is not set; log in as a normal user.
- Very slow login screen: GDM may be waiting on reverse DNS for the client. Add the client to
/etc/hostsor fix DNS.
RHEL, AlmaLinux and Rocky 9/10
XDMCP is a legacy, unencrypted protocol and is not the recommended way to reach a modern desktop. RHEL 9 based systems are better served by VNC or GNOME Remote Desktop, and RHEL 10 and its rebuilds no longer ship the Xorg server, so use GNOME Remote Desktop (RDP) or xrdp there. For an RDP option on CentOS see Install xrdp on CentOS. If you only need a single graphical program, ssh -X forwards it over an encrypted connection.
That’s it, Hosted Linux Servers at www.zwiegnet.com/go

1 Comment