HOWTO: Enable Remote XDMCP connections under Kubuntu 6.0.6
Posted: 6/15/2006 3:19:42 PM
By: Comfortably Anonymous
Times Read: 10,251
0 Dislikes: 0
Topic: Linux
Decided to start using Kubuntu 6.0.6 (Dapper Drake) this week. I like the Ubuntu philosophy, but don't really care for Gnome (I don't dislike it, I just like KDE better), so am somewhat 'on my own' by using the less popular KDE version, Kubuntu.

Needed to be able to access the Kubuntu machine from my Windows box using Cygwin/X. After doing a bit of research and mucking with a couple config files, was able to get it working.

Here's how:

First off, KDE uses a modified version of CDM, called KDM, which is the program that allows remote X connection and presents the login screen to the remote connections. So all we have to do is modify the KDM configuration to enable remote connections (It's turned off by default.)

There are two files of importance here: /etc/kde3/kdm/kdmrc and /etc/kde3/kdm/Xaccess. We'll do some slight changes to each and you should be good to go. Note that this is done in the most insecure way possible, which allows anyone on your local network to get a login screen from your Kubuntu box. (If your machine is directly connected to the Internet, without a firewall, then (you are stupid/insane) anyone on the Internet can get a login screen as well, so have your head examined for damage if you are going to try this with a machine direct-connected.)

First, open Konsole (text/command line window) which is under System in the KDE 'start' menu.

Since Unbuntu is weird about logging in directly as root, we'll have to use sudo to do these changes. Am going to use VI to make the edits, if you don't know how to run vi, then you can also substitute 'kate' in place of 'vi' in the instructions below which will bring the file up in a GUI-based text editor. (You'll get a whole bunch of warnings and a long delay when you fire up kate from sudo, so be prepared to wait a while.)

----------------------

Let go ahead and make the changes to /etc/kde3/kdm/kdmrc first:

sudo vi /etc/kde3/kdm/kdmrc

Scroll down until you find a section starting with [Xdmcp], a few lines below you'll find a line as follows:

#Enable=...

Get rid of the '#' and make sure it says Enable=true

Also get rid of the '#' in front of the following lines:

#Port=177

#KeyFile=/etc/kde3/kdm/kdmkeys

#Xaccess=/etc/kde3/kdm/Xaccess

#Willing=/etc/kde3/kdm/Xwilling

Go ahead and save the file.

----------------------

Now we're going to make the changes to the Xaccess file:

sudo vi /etc/kde3/kdm/Xaccess

Only two changes to make to this file:

Get rid of the '#' at the beginning of the following line (and only the '#' at the beginning of the line, leave the second one there):

#*               #any host can get a login window

Same thing for this line too:

#*           CHOOSER BROADCAST  #any indirect host can get a chooser

Save the file.

-------------------------

Now we need to restart the KDM process so it will re-read the configuration file. The easiest way to do this is to just reboot the machine. The quickest is to do the following:

ps -ef | grep kdm

This will print out a list of processes with the letters 'kdm' in the name. Find the one that looks like the following (Specifically the one that ends in /usr/bin/kdm):

root    4530      1     0 0:09:20 ?          00:00:00 /usr/bin/kdm

See the number right after root? 4530 in my example, you will almost certainly have a different number. That's the process ID or PID. Type the following command to restart kdm (Substituting the PID number you have for the 4530 in my example):

sudo kill -HUP 4530

--------------------------------

You should now be able to connect from the remote X client!

If you are using Cygwin/X, the following will work from your Cygwin command prompt:

xwin -query -once

ex: xwin -query kubuntumachine -once

If all goes well, you'll be staring at a login screen for your Kubuntu box in just a few seconds. Enjoy!
Rating: (You must be logged in to vote)
Discussion View:
Replies:

HOWTO: Enable Remote XDMCP connections under Kubuntu 6.0.6
Posted: 6/15/2006 3:19:42 PM
By: Comfortably Anonymous
Times Read: 10,251
0 Dislikes: 0
Topic: Linux

If you have access to do a graphical login on the local display of the Ubuntu box, this is extremely easy:

1. Click System, Administration, Login Window. (You'll be prompted for YOUR password at this point.)
2. Select the 'Remote' tab.
3. Change the 'Style' from 'Remote login disabled' to any of the other selections. (I went with 'Same as Local')
4. Once you have changed the Style, you will now have a 'Configure XDMCP' button in the lower right. (You don't have to change anything there, but good to take a look to see what you can change.)
5. Close 'Login Window Preferences'

Everything is set up at this point, but we still have to restart GDM (The graphical login handler) so that it picks up on the configuration changes.

Now we need to restart the KDM process so it will re-read the configuration file.

- The easiest way to do this is to just reboot the machine.

- The quickest way is to do the following:

ps -ef | grep gdm

This will print out a list of processes with the letters 'gdm' in the name. Find the one that looks like the following (Specifically the one that ends in /usr/sbin/gdm):

root    4530      1     0 0:09:20 ?          00:00:00 /usr/sbin/gdm

See the number right after root? 4530 in my example, you will almost certainly have a different number. That's the process ID or PID. Type the following command to restart gdm (Substituting the PID number you have for the 4530 in my example):

sudo kill -HUP 4530

This restarts the Gnome Display Manager. Doing this instantaneously kills all graphic sessions on the box (including the one you are using) with no warning. Don't panic when this happens, the login screen will pop up in a few seconds and you can log back in. (But no reason to, as in the next step you are going to log in from the remote location...)
--------------------------------

You should now be able to connect from the remote X client!

If you are using Cygwin/X, the following will work from your Cygwin command prompt:

xwin -query -once

ex: xwin -query ubuntumachine -once

If all goes well, you'll be staring at a login screen for your Ubuntu box in just a few seconds.

Enjoy!

** WARNING: This next step will do an instantaneous forced logout!! **
** Make sure you have all other programs closed and data saved before proceeding!! **

1. Click Applications, Accessories, Terminal.

Rating: (You must be logged in to vote)

HOWTO: Enable Remote XDMCP connections under Kubuntu 6.0.6
Posted: 6/15/2006 3:19:42 PM
By: Comfortably Anonymous
Times Read: 10,251
0 Dislikes: 0
Topic: Linux

Since I've been making these Ubuntu XDMCP HowTos for a while, I figured I'd better make one for the new 8.04 version.

I wrote the stuff at the bottom yesterday, and since then the bug in GDM has been fixed and there is a fix in the latest Ubuntu Updates that fixes this issue. So ignore the stuff about replacing GDM with KDM, no longer needed! :)

OK, to get it to work, make sure you're running the latest version of GDM, as the version that shipped with the release version of Ubuntu 8.04 DID NOT WORK!!!  If you've done an update since todays date [2008/07/02], you should have it. If not, go to System|Administration|Update Manager, click Check, then click Install Updates to get it.

To Configure GDM to allow XDMCP connections:

Go to System | Administration | Login Window. Once that's open, there's a few tabs:

  • General tab:

    - Make sure "Default Session" is checked, and Run Xclient script is selected.
    - Another setting to think about is the "Disable multiple logins for a single user" -It is checked by default. Depending on your needs you may wish to uncheck it. But as far as simply getting XDMCP connections working, it doesn't matter.
  •  Local tab:

    - Nothing here really matters, it's only for local logins, not XDMCP logins.
  • Remote tab:

    - By default, the Style is set to "Remote login disabled" - gotta change that for sure! Set for either "Same as Local" or "Plain with face browser". (I'm a little shy of the "Same as Local", simply because an earlier version of GDM had problems with that, but it's probably not a problem anymore.)
    - The rest of the settings are pretty much your choice. Under "Configure XDMCP" I enabled "Honor Indirect Requests" and increased my "Displays per host" (Which is easier to think of just as "Displays per User" for the most part, unless you have multiple people ) to 4 just because I sometimes log in more than once.
    - Under Logo, I picked ubuntu-screensaver.svg for the Image, instead of the default Debian logo, since this is Ubuntu. Just seems to make more sense that way. ;)
  • Accessibility tab:

    - This is your choice, based on your needs. Nothing here specifically affects XDMCP connections.
  • Security tab:

    - I'm not sure if it was needed, as the X Window protocol normally uses UDP packets, but I unchecked "Deny TCP connections to Xserver", I also unchecked "Never place cookies on NFS" simply because I don't use any NFS file systems.
    - Clicking "Configure X Server..." brings up a dialog for tweaking how you want things to work. I didn't change anything here. But take a look so you know what's configurable.
  • Users tab:

    - Once again, nothing here to modify unless you want to add/exclude certain users from access. You can set things like which face image to show as a default in the face browser

Click the Close button, which also saves the new settings. (You can look at /etc/gdm/gdm.conf-custom to see the new config file that was created.)

At this point, everything should be ready to go with just one last easy step - resetting GDM to pick up the new settings. You can look at previous posts to see several different ways to do this, but the absolute easiest way is to just hit CTRL-ALT-Backspace and it instantly kills your login and restarts GDM. Make sure you have anything else saved before doing this, because there is no conformation prompt, it just kills the session.

---------  Original Message for dealing with broken GDM -----------------

 I've spent way too much time lately trying to get XDMCP to work with the default GDM (Gnome Display Manager) that comes with Ubuntu 8.04. After doing a lot of research and experimentation, I'm finding that it seems that XDMCP support in the version of GDM provided with Ubuntu 8.04 just simply doesn't work. (I haven't found anyone out there that can get it to work either, there's a bug opened with Ubuntu, but it's only been assigned a low priority for some reason. Sure, I understand that not everyone needs XDMCP but for the people who do need it, it's pretty much a deal-breaker if you can't get XDMCP working!)

The solution I found: Install the KDE Display Manager, KDM. It worked perfectly the first time. Although it "ruins" a pristine Gnome-only environment since it has some KDE dependencies, but that's just techno-religious fanboyism anyway. You can still run Gnome just fine with KDM.

To Install KDM:

Easiest way (among many) is to just open the Synaptic Package Manager (Under System|Administration), click the Search button to search for KDM, put a checkmark next to KDM, and then click the Apply button. During the install, a dialog will pop up asking you which display manager should be set as the default - set it to KDM.

(Bad directions completely removed)

At this point, everything should be ready to go with just one last easy step - resetting KDM to pick up the new settings. You can look at previous posts to see several different ways to do this, but the absolute easiest way is to just hit CTRL-ALT-Backspace and it instantly kills your login and restarts KDM. Make sure you have anything else saved before doing this, because there is no conformation prompt, it just kills the session.

Hope this helps! Enjoy!

Rating: (You must be logged in to vote)