How to Use XDMCP for Remote Desktop Access on Linux

xdmcp on linux

XDMCP (X Display Manager Control Protocol) is a protocol used to provide a mechanism for an autonomous display to request from a remote host.  Using this protocol X11 display server (for example can connect and interact with another computer running X11.

Most Linux admins work from the shell and there is not much requirement to connect to the X window. But, in some cases, we need to access the graphic console (X window Manager). For example, if a user needs to install Oracle and need access remote graphical interface.

In this tutorial, I will show you how to configure your Linux system to use graphical (GUI) login with XDMCP service to access remote GUI.

GDM tool no longer available on modern Linux distributions, this configuration wont work.

1) Enable Display Manager on Boot

To launch the display manager on boot you have to edit initab file. You have to change the runlevel to 5 to start X client on boot.

After changing the runlevel the '/etc/inittab' file would look as shown below:

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)

Note: This change gets into effect only on the next restart.

To change runlevel (targets) to 5 in systems use the following command:

$ sudo systemctl isolate

2) Enable XDMCP with X Display Manager

Based on the desktop environment installed, you may have different display mangers. The most commonly used display managers are GDM (GNOME Display Manager), KDM (KDE's display manager), xdm (X Window Display Manager) and LightDM.

You can use ps command to check which display manager is running:

# ps ax | grep [gkx]dm

Ubuntu has been using GDM as the default display manager for a while and LightDM is a good alternative. First let's check how to enable xdmcp on GDM.

To xdmcp protocol on gdm manager, you have to edit '/etc/gdm/custom.conf' file as follows:



To enable XDMCP protocol in LightDM edit '/etc/lightdm/lightdm.conf' as:


Restart LightDM service:

$ sudo lightdm restart

Note: XDM and KDM are supported on older versions of Linux and not active programs anymore.

3) Restart X Window

Restart X Window Services using init command:

[root@Server1 ~]# init 3
[root@Server1 ~]# init 5

4) Configure Access Rule

The next step would be to configure the access rules. Run gdmsetup command.


a ) Click the Remote tab on GDM setup utility. Change the Style pull-down menu selection from 'Remote login disabled' to 'Same as Local'

b) Under the Security tab enable "Allow local system administrator login" and "Allow remote system administrator login"

Restart GDM utility:

[root@Server1 ~]# /usr/sbin/gdm-restart

You can now test the X window using the below X command.

[root@Server1 ~]# X -query localhost :1

Note: The GDM config tool is no longer available from RHEL6.

6) Open Firewall Ports

XDMCP are using the below ports and make sure these ports are open in the firewall.


X11 protocol 6000-6005 TCP

xfs: X font server 7100 TCP


XDMCP  uses unencrypt traffic recommend only in a secure network say that has an encrypted VPN. FreeNX and x11vnc are good alternatives that feature more security.

I hope you enjoyed reading and please leave your suggestion in the comment section.

1 thought on “How to Use XDMCP for Remote Desktop Access on Linux”... add one

  1. Im using Ubuntu 14.04 LTS. and have found no way to connect from Windows, I have read all sort of tutorials but none really works. Yours seems to go in right direction, but:
    1. There is no /etc/inittab file (what to do?
    2. ps ax | grep [gkx]dm displays nothing, is this the right command?
    3. Step 3 cannot be done until figure it out how to do #1 first
    4. Second step #3 impossible because gdsetup reports "No command 'gdsetup' found"
    5. Step 4 impossible because there is no such /usr/sbin/gdm-restart
    6. step 6 does not explain how to make sure these ports are open in firewall
    Would you mind addressing those?
    BTW, I entered the commands with sudo and without sudo, the results are the same


Leave a Comment