XDMCP

From ArchWiki
(Redirected from Xdmcp)


From Wikipedia:

The X Display Manager Control Protocol (XDMCP) uses UDP port 177. An X server requests that a display manager start a session by sending a Query packet. If the display manager allows access for that X server, it responds by sending a Willing packet back to the X server.

This allows for opening X sessions remotely.

Warning: XDMCP is, similarly to telnet, doing unencrypted authentication. If snooping is possible, this leaves the system vulnerable to attack. It is disabled by default, using an ssh tunnel for X traffic is preferred.

Setup graphical logins

XDM

Comment the last line of the configuration file with a !:

/etc/X11/xdm/xdm-config
!DisplayManager.requestPort:    0

Then allow any host to get a login window in by un-commenting the following:

/etc/X11/xdm/Xaccess
*             #any host can get a login window

In case you have multiple network interfaces also add a line like this:

LISTEN 192.168.0.10

Where 192.168.0.10 is your server IP address.

Then restart xdm.service.

GDM

Enable XDMCP in the configuration file:

/etc/gdm/custom.conf
[xdmcp]
Enable=true
Port=177

Then restart gdm.service.

LightDM

Enable the XDMCP Server in the configuration file:

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

On a headless system, disable the automatic start of one seat so that LightDM can run in the background:

[LightDM]
start-default-seat=false

Then restart lightdm.service.

Accessing X from a remote machine on your LAN

You can access your login manager on the network computer (using 192.168.0.10 in the following command). TCP and UDP streams are opened. So it is not possible to access the login manager via an SSH connection.

$ Xnest -query 192.168.0.10 -geometry 1280x1024 :1

Or, with Xephyr, if you experience refreshing problems with Xnest:

$ Xephyr -query 192.168.0.10 -screen 1280x1024 -br -reset -terminate :1

Or, if you are on runlevel 3

$ X -query server address

Xserver should recognize your monitor and set appropriate resolution.

Note: You can enable XDMCP Direct/Query and Broadcast connections from remote hosts without XDM starting a local X server.

After allowing XDMCP access as described above, edit /etc/X11/xdm/Xservers and comment out:

#:0 local /usr/bin/X :0

Then launch XDM as root, e.g. xdm -config /etc/X11/xdm/archlinux/xdm-config

Thin client setup

This article or section needs expansion.

Reason: Why does DHCP and TFTP need to be setup ? (Discuss in Talk:XDMCP)

First of all one should setup dhcp and tftp server. Dnsmasq has both of them. For network boot image check thinstation project. If your network card does not support PXE, you can try Etherboot

GUI-based Clients

Troubleshooting

Session declined: Maximum Number of Sessions Reached

Edit /etc/gdm/custom.conf and increase MaxSessions. It is worth noting that there may be a limit regarding how many XDMCP connections are allowed at once, so it's worth increasing DisplaysPerHost as well[1] if multiple clients are connecting from the same IP.

[xdmcp]
Enable=true
MaxSessions=X
DisplaysPerHost=X