Tag Archives: xdmcp

Running X Window on MS Windows

I am less than mobile at the moment. Recovery from surgery takes longer than I expected (one week has passed and I still can wear normal trousers only for short periods of time).

It takes me some effort to go up two stairs and work at my Slackware desktop system, so that left me less than happy yesterday when I was facing the living room PC which is running Vista. I still wanted to work with my trusted Slackware display, and of course there is a solution for that.

Ever heard of XDMCP or “X Display Manager Control Protocol“? A Linux (or as it stands, any UNIX) computer running a graphical login manager like KDM can be configured to listen for remote login requests made by computers on the LAN. The protocol used for this, is XDMCP.

What I needed to do was twofold:

  1. enable XDMCP on my Slackware box, two floors up
  2. install an X server for MS Windows

A Slackware computer does not enable XDMCP by default. The reason should be obvious – security reasons. Unlike remote logins using ssh, the XDMCP network packets travel across your wires unencrypted.

If you are not too concerned about security (for instance, nobody else uses your local network) these simple steps enable XDMCP – if security is an issue you may want to have a look at NoMachine’s NX technology instead.

  • In the file “/etc/X11/xdm/xdm-config” comment out this line (by placing a ! in front):
    DisplayManager.requestPort: 0
    which prevents XDM from listening to XDMCP requests
  • In the file “/etc//X11/xdm/Xaccess” uncomment this line (remove the #):
    #* #any host can get a login window
    so that any host is allowed to see the login window
  • If you are going to use KDM as the graphical login manager, then edit the file “/etc/kde/kdm/kdmrc” and comment out this line in the section “[X-:*-Core]“:
    ServerArgsLocal=-nolisten tcp
    which inhibits KDM from listening on a network socket
    Also, look in section “[Xdmcp]” and change
    Enable=false
    to
    Enable=true
  • Finally, make sure that your machine starts in the graphical runlevel ( for Slackware that is runlevel 4) by editing the file “/etc/inittab” and changing
    id:3:initdefault:
    to
    id:4:initdefault:

Simple enough isn’t it?

When you have rebooted your Slackware computer, it will be listening on your local network for incoming login requests. When you have KDE installed, then Slackware will use KDM as the login manager. Otherwise,  XDM will be used. If you decide to install one of the 3rd-party Gnome add-ons that exist for Slackware (GnomeSlackBuild, gware, dropline, gnomeslacky) then by default GDM will be running to manage your logins.

Next step is to install a X-Server for the MS Windows machine. There is one that I really like a lot. It is called Xming and you can find it at http://www.straightrunning.com/XmingNotes . It is a cross-compiled X.Org using the mingw compiler. Xming comes in two flavours – a version that is non-free (you have to pay to get access to the binaries) and a version that is in the “public domain” (you are free to use and distribute it). The author has written a page with an overview of the component licenses and has all his patches to the original X.Org/freetype/Mesa sourcecode available for download. The free version lags a bit behind with regards to version number but it does all the things I need. The installer comes with a handy tool called “Xlaunch” which is a wizard-like application to configure access to the remote server.

After installation of Xming, and running Xlaunch, it took only a few mouseclicks and entering my Slackware hostname to be greeted by my familiar KDM login screen 🙂

Note: if you have two Linux computers, the story is even simpler if you want to perform a remote graphical login. After enabling XDMCP on one computer, you run the following command on the other (assuming you are already running X locally and want a second parallel X session to the remote machine on IP address 192.168.0.11):

  • X -query 192.168.0.11 :1

To switch between your local and remote X sessions, use the <Ctrl><Alt>F8 and <Ctrl><Alt>F7 key combinations.

Enjoy! Eric