How to use XDMCP for Remote Desktop Access on Linux


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. Most Linux admins work from shell and there is not much requirement to connect to the X window. But, in some cases, we need to access graphic console (X window Manager). For example, if a user needs to install Oracle and he/she might need access to Linux remote GUI; then I personally recommend to disable X manager, once the requirement is finished as part of security measures.

1) Edit inittab File

Usually, in /etc/inittab file, sysadmin would be setting it to level 3. So we have to change the level to 5. This makes it effective on the next restart.

# 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)

2) Enable X Window Manager

Enable X Window Manager (GDM or XDM or KDM). If it's already running, you can find which X window by running the below ps command. XDM and KDM are supported on older versions of Linux. From RHEL 5 onwards XDM X window manager is supported.

# ps ax | grep [gkx]dm

To enable XDM manager, you have to edit /etc/gdm/custom.conf file as below:

[xdmcp] Enable=true

[security] DisallowTCP=false

3) Restart X Window

Restart X Window Services using init command:

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

4) Configure Access Rule

Next step would be to configure the access rules. Run gdsetup 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"

5) Restart GDM Utility

Restart GDM utility service as below:

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

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

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

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

Bobbin Zachariah 9:16 pm


Your email address will not be published. Required fields are marked *

All comments are subject to moderation.

1 Comment

  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