HOWTO: Enable Remote XDMCP connections under Kubuntu 6.0.6
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.
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:
Get rid of the '#' and make sure it says Enable=true
Also get rid of the '#' in front of the following lines:
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!
This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those who have expressed a prior interest in receiving the included information for research and educational purposes. For more information go to: http://www.law.cornell.edu/uscode/17/107.shtml
. If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner.