GDM and XDMCP configuration for remote graphical Linux desktop access (2025)

Linux configuration for a GUI login:

Typically Linux configures the choice of a text console login or a graphical GUI login in the init script configuration file /etc/inittab. In order to allow remote a GUI login, the system itself must be configured for a X11 GUI login.

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

(Partial file listing)

Note that this shows a run level of "5" for a Red Hat / Fedora / CentOS based configuration.

Ubuntu:

  • Start GDM manually with the command: /etc/init.d/gdm or on system boot.
    (This can be added to the system init process: ln -s /etc/init.d/gdm /etc/rc2.d/S13gdm)
    or
  • add to /etc/inittab
    x:2:respawn:/usr/sbin/gdm 
    Ubuntu uses runlevel 2-5 as regular multi-user mode.

Also see the YoLinux.com Linux init process tutorial.

Granting remote GUI desktop access to your system:

The system login manager provides the GUI screen presented to the user for one to login to the system.The system admin can configure the system to use the following Login/Display Managers:

  • RHEL: XDM, GDM, KDE
  • Ubuntu: LightDM, GDM, KDM

The typical default of modern Linux systems (current Red Hat or Ubuntu) is to use Gnome GDM. Older systems used the X11 login manager XDM. It is still available and a valid option. The system is typically configured for a single login display manager.Multiple display managers can run simultaneously only if they are configured to manage different servers (not covered in this tutorial).

In order to use the Linux desktop remotely, the login manager must be configured for remote use.

  • # Red Hat Enterprise Linux (RHEL) XDMCP Configuration (includes Fedora and CentOS)
  • # Ubuntu Linux XDMCP Configuration

RHEL XDMCP Configuration:

How to set the default display manager and configure it for remote XDMCP desktop display.

Display Manager Default:

The default display manager for Red Had based systems can be set in /etc/sysconfig/desktop
Desktop choices: GNOME, KDE
Display Manager choices: GNOME, XDM, KDE

Example

/etc/sysconfig/desktop
DESKTOP="GNOME"DISPLAYMANAGER="GNOME"

Specifying GNOME as a display manager will invoke GDM.

Upon boot, the system will run /etc/init/prefdm.conf which will in turn call the "Preferred Display Manager" (prefdm) script /etc/X11/prefdm which will utilize the settings in /etc/sysconfig/desktop if available.

XDM login manager configuration:

  • Required RPM Package: xorg-x11-xdm
  • Edit file:
    • Red Hat: /etc/X11/xdm/Xaccess
    • Suse: /usr/X11R6/lib/X11/xdm/Xaccess

    Change from:
    # * #any host can get a login window
    To:
    * #any host can get a login window
  • Edit file: /etc/X11/xdm/xdm-config
    Change last line from:
    ! SECURITY: do not listen for XDMCP or Chooser requests! Comment out this line if you want to manage x terminals with xdmDisplayManager.requestPort: 0 
    To:
    !DisplayManager.requestPort: 0 
    System default for RHEL4/FC3.
  • Remote XDM Login Screen:

GDM login manager configuration:

  • Required RPM Package: gdm
  • Edit file:
    • Red Hat Enterprise 5/6, CentOS 5/6: /etc/gdm/custom.conf
      Add two entries to the existing categories:
      .....[xdmcp]Enable=true[security]DisallowTCP=false..... 
      Valid options and system defaults can be found in /etc/gdm/gdm.schemas
      One can also use the GUI config tool /usr/sbin/gdmsetup.
      (No longer available on RHEL6. Configure by editing config files)
    • Red Hat Enterprise 3/4, CentOS 3/4, Fedora 1-6: /etc/X11/gdm/gdm.conf
      Ubuntu: /etc/gdm/custom.conf
      Change last line from:
       [xdmcp]
      Enable=false
      To:
       [xdmcp] Enable=true 
      Valid options and system defaults can be found in gdm.schemas
      One can also use the GUI config tool gdmsetup (see below).
  • Restart X-Windows using one of the following methods:
    • Restart using init:
      • [root]# init 3
      • [root]# init 5
      [Potential Pitfall]: When using Linux terminals F2, F3, etc note that the command "init 5" may push you to a different console terminal. Use ctrl-alt-F7 to navigate to the graphics console. Remember to navigate to the console terminal from which you entered the command as it will still be logged in.
    • Restart using the keystroke ctrl-alt-Backspace
  • Remote GDM Login Screen:

Note:

  • You can use the config tool /usr/sbin/gdmsetup to configure GDM (see below).
  • You can test the GDM login screen locally: X -query localhost :1

[Potential Pitfall]: RHEL6 users may find that the remote X-server has a blank screen when trying to start a remote XDMCP desktop. This may require a change to the default sshd configuration.

Edit file:

/etc/ssh/sshd_config

be sure the following three lines are uncommented:

.....X11Forwarding yesX11DisplayOffset 10X11UseLocalhost yes.....

You will have to restart sshd and the window manager to pick up the configuration changes:

  • service sshd restart
  • ctrl-alt-Backspace

KDE login manager configuration:

  • Required RPM Package: kdm
  • Edit file: /etc/kde/kdm/kdmrc
    .....[Xdmcp]Enable=trueWilling=/etc/kde/kdm/XwillingXaccess=/etc/kde/kdm/Xaccess..... 
  • Edit file: /etc/kde/kdm/Xaccess
    Change from:
    # * #any host can get a login window......# * CHOOSER BROADCAST #any indirect host can get a chooser 
    To:
    * #any host can get a login window* CHOOSER BROADCAST #any indirect host can get a chooser 
  • Restart the window manager: ctrl-alt-Backspace
  • Remote KDM Login Screen:

GDM Configuration using gdmsetup:

gdmsetup: This GUI will edit the configuration GDM configuration file.Note that this GDM configuration GUI is no longer available with RHEL6.One must edit config files to configure GDM.

  • Red Hat Enterprise 5, CentOS 5: /etc/gdm/custom.conf
  • Red Hat Enterprise 3/4, CentOS 3/4, Fedora 1-6: /etc/X11/gdm/gdm.conf

Select the check box "Enable XDMCP":
GDM and XDMCP configuration for remote graphical Linux desktop access (4)
GDM and XDMCP configuration for remote graphical Linux desktop access (5)

Ubuntu XDMCP Configuration:

The config file

/etc/X11/default-display-manager

sets the system default and is typically:

/usr/sbin/lightdm 

Options:

  • /usr/sbin/lightdm (typically the Ubuntu default: 12.04)
  • /usr/sbin/gdm
  • /usr/bin/kdm

The default can also be reset using the GUI console configuration tool:
sudo dpkg-reconfigure lightdm
In this example the default is being set to "lightdm". Valid options include "gdm" and "kde".

LightDM Configuration: (Ubuntu 12.04)

Add the following to the file:

/etc/lightdm/lightdm.conf
......[XDMCPServer]enabled=true 

Restart LightDM:

sudo lightdm restart

GDM Configuration: (Ubuntu 10.04)

Add the following to the file:

/etc/gdm/custom.conf
......[daemon]RemoteGreeter=/usr/lib/gdm/gdmlogin[xdmcp]Enable=true 

Restert GDM:

sudo gdm restart

KDM Configuration:

  • Required Ubuntu Package: kdm
  • Edit file:
    • Ubuntu: /etc/kde4/kdm/kdmrc
    .....[Xdmcp]Enable=trueWilling=/etc/kde/kdm/XwillingXaccess=/etc/kde/kdm/Xaccess..... 
  • Edit file: /etc/kde4/kdm/Xaccess
    Uncomment the lines and change to:
    * #any host can get a login window* CHOOSER BROADCAST #any indirect host can get a chooser 
  • Restart the window manager: ctrl-alt-Backspace

Ubuntu KDM Config Files:

  • /etc/kde4/kdm/backgroundrc : background settings
  • /etc/kde4/kdm/kdm.options : options for X display manager kdm
  • /etc/kde4/kdm/kdmrc : kdm configuration file
  • /etc/kde4/kdm/Xaccess : access control file for XDMCP connections
  • /etc/kde4/kdm/Xreset : script to run as root after session exits
  • /etc/kde4/kdm/Xsession : script to run as user after login of user
  • /etc/kde4/kdm/Xsetup : script to run as root before the login dialog appears
  • /etc/kde4/kdm/Xstartup : script to run as root before session starts
  • /etc/kde4/kdm/Xwilling : output of this script is displayed in the chooser window

Configuration Pitfalls:

  • Make sure the system firewall rules allow XDMCP protocol to pass.
    • List firewall rules: iptables -L
    • Flush all firewall rules: iptables -F
    The following ports and protocols must be able to pass through the firewall:
    • UDP: 177 (XDMCP)
    • TCP: 6000-6005 (X11 protocol)
    • TCP: 7100 (xfs: X font server)

Remote X server access for MS/Windows:

Open Source MS/Windows PC X-Windows server software:

  • Xming - [instructions] - X-Windows for MS/Windows - My preferred choice!
    (Remote X-Desktop access using Xming)
  • Cygwin/X: See the YoLinux Tutorial - Linux for a Microsoft Windows Environment and Network for Cygwin configuration.

Commercial MS/Windows PC X-Windows server software:

Also see accessing Linux from Microsoft Windows for more remote X-Windows configuration information.

Remote X server access for Linux:

Use the X-Windows Xnest command to connect.

/usr/bin/X11/Xnest -query computer-node-name -geometry 1280x1024 :1


Example using option "-geometry 850x680".

[Potential Pitfall]: If your get the following error message:

Fatal server error:Server is already active for display 0

This means you forgot the ":1" at the end of the command and it defaulted to :0 which is your current desktop window thus causing a conflict.

Red Hat / Fedora / CentOS distributions require package xorg-x11-Xnest

Links:

GDM and XDMCP configuration for remote graphical Linux desktop access (2025)

FAQs

How to enable Xdmcp in Linux? ›

Enable XDMCP By Editing Files
  1. Open the files /etc/opt/kde3/share/config/kdm/kdmrc and /etc/opt/kde3/share/config/kdm/kdmrc.SuSEconfig. Find the XDMCP section and set Enable to true. ...
  2. Open /etc/X11/xdm/Xaccess. ...
  3. Open /etc/X11/xdm/xdm_config. ...
  4. Restart the system.

What is XDMCP in Linux? ›

XDMCP, short for X Display Manager Control Protocol, is a network protocol that provides a mechanism for remote graphical login capabilities, enabling a user to access a desktop environment on a remote server through the X Window System (also known simply as X11).

How to remote access a Linux system with GUI interface? ›

Remote connection to Linux with a graphical interface
  1. Install 'vncserver' on Linux.
  2. Check your Linux distribution's documentation for the VNC Server installation process.
  3. Connect remotely from your local desktop via VNC client/viewer.
  4. On Windows, you can use TightVNC, RealVNC, or UltraVNC.

What is the best way to remotely access Linux desktop? ›

16 Best Tools to Access Remote Linux Desktop
  1. Zoho Assist Remote Desktop Sharing.
  2. Remote Access Plus.
  3. ThinLinc – Linux Remote Server.
  4. TigerVNC.
  5. RealVNC – Remote Desktop Access Software.
  6. TeamViewer – The Remote Connectivity Software.
  7. Remmina – Remote Desktop Client.
  8. NoMachine – Free Remote Desktop Client.
Nov 1, 2023

How to setup XDMCP in Ubuntu? ›

XDMCP Configuration
  1. Install LightDM. $ sudo apt install lightdm. ...
  2. LightDM Configuration. Configure the /etc/lightdm/lightdm. ...
  3. Firewall Configuration. $ sudo service ufw stop. ...
  4. Restart XDMCP service daemon. ...
  5. Create Xmanager Session.
Apr 13, 2021

How do I connect to XDMCP? ›

Connecting with a Secure XDMCP session

Double click on the Secure XDMCP session. Enter the user name in the SSH User Name dialog box. Select an authentication method and enter the appropriate information. Remote login screen appears on Xmanager.

How do I enable GUI mode in Linux? ›

To switch from the Command Line Interface (CLI) to the Graphical User Interface (GUI) in Linux, press Alt + F7. This keyboard shortcut takes you back to the original virtual terminal where the GUI is running.

How do I enable remote access in Linux? ›

Configuring Linux for Remote Access
  1. Click on the icons that are at the far-right of the system menu bar and click Settings.
  2. In the Settings window, select Sharing and click on the top switch button to enable the service.
  3. Click Remote Desktop.
  4. Enable Remote Desktop (click on the switch).

How to configure remote desktop in Linux? ›

How To Install XRDP (Remote Desktop) on Ubuntu 20.04
  1. Step 1: Log into Ubuntu 20 Server. You will need to log in your Ubuntu server first. ...
  2. Step 2: Install ubuntu-desktop Environment. ...
  3. Step 3: Install XRDP. ...
  4. Step 4: Open port 3389 on the firewall. ...
  5. Step 5: Test XRDP connection.

What is the difference between VNC and RDP? ›

Both protocols provide access to remote desktops for quick and easy remote working and troubleshooting. The main difference is that RDP is a virtual session and VNC captures the physical display; you see exactly what the remote user sees.

Which Linux is the best for remote desktop? ›

The best Linux remote desktop clients of 2024 in full:
  1. RealVNC Connect. The best Linux remote desktop client for transferring files. ...
  2. Remmina. The best Linux remote desktop client for high performance. ...
  3. TigerVNC. Linux remote desktop client with the best interface. ...
  4. TightVNC. Best Linux remote desktop client for Windows users.
Apr 21, 2024

How to enable multipath in Linux? ›

The basic procedure for configuring your system with multipath is as follows:
  1. Install the multipath-tools and multipath-tools-boot packages.
  2. Create an empty config file called /etc/multipath. conf.
  3. Edit the multipath. ...
  4. Start the multipath daemon.
  5. Update initial RAM disk.

How to enable proxy server in Linux? ›

To set up the HTTP proxy on Linux, follow these steps:
  1. Open the network settings on your Linux distribution, usually found in the system settings or network manager.
  2. Locate the proxy settings and provide the necessary details, such as the proxy server's IP address, port, and authentication credentials if required.
Jun 29, 2024

How do I enable repository in Linux? ›

To enable a particular repository or repositories, run the following command as the root user: yum-config-manager --enable repository… Alternatively, you can use a global regular expression to enable all matching Yum repositories: yum-config-manager --enable glob_expression…

How to enable SSH agent in Linux? ›

To use ssh-agent and ssh-add , follow the steps below:
  1. At the Unix prompt, enter: eval `ssh-agent` Make sure you use the backquote ( ` ), located under the tilde ( ~ ), rather than the single quote ( ' ).
  2. Enter the command: ssh-add.
  3. Enter your private key password.
  4. When you log out, enter the command: kill $SSH_AGENT_PID.
Jun 27, 2023

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6430

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.