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 X.org) 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.
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) # id:5:initdefault:
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 graphical.target
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:
[xdmcp] Enable=true [security] DisallowTCP=false AllowRemoteRoot=true
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
b) Under the Security tab enable "Allow local system administrator login" and "Allow remote system administrator login"
Restart GDM utility:
Restart GDM utility service as below:
[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.
XDMCP 177 UDP X11 protocol 6000-6005 TCP xfs: X font server 7100 TCP
I hope you enjoyed reading and please leave your suggestion in the comment section.