X Windows (Was: [Q] Debain 3.0 Startup....)
rasjidw at openminddev.net
Sat Aug 17 20:20:37 EST 2002
On Sat, 17 Aug 2002 2:55 pm, Donovan J. Edye wrote:
> Thought I would spin this off as a new thread and state my requirements to
> make things clearer and more understandable.
> The Debian box I am accessing is on my local network behind another box
> which serves as my firewall. What I want to do on this box is basically run
> Kylix (Borland Development Environment for Linux). I have CygWin Xfree-86
> installed on my Windoze workstation box and ideally would like to run KDE
> to access the Kylix installation on the Debian box. I have no other X
> requirement than this on that Debain box.
> So how do I go about achieving the above?
Okay, in this situation I would use XDMCP.
1. Make sure that the Debian box is still booting to runlevel 5. You will
need to turn off starting X locally (to deal with your monitor) via the X
config files rather than changing the default runlevel or removing kdm.
Which version of KDE are you running on the Debian box? The following
instructions are based on KDE 3.0 on RH7.3, but should be readily modifiable
to Debian, and from memory I can't see any big changes here from the last
time I did this with KDE 2.
locate kdmrc (/etc/X11/xdm/kdmrc on RH7.3)
edit kdmrc as follows:
Enable=false -> Enable=True
There should also be some lines that start with:
(files may be different of Debian, but I suspect not, and on RH7.3, these are
just simlinks to the files in /usr/X11/xdm)
Modify the Xservers file. It should say something like:
:0 local /usr/X11R6/bin/X
Commenting this out will stop X being run locally, even though you are still
in runlevel 5. This will keep your monitor happy. (As an aside, adding extra
entries will give you extra X sessions on another virtual console, so you can
go away with a session locked, and other family members can log in without
logging you out.)
Modify the Xaccess file. It should have a line that says:
# * #any host can get a login window
Uncomment this, so the * is visible.
Now restart the Xserver. (I always either change the runlevel to 3 and then
back to 5, or use the GUI for this, so I'm not sure the best way of doing
this on debian. Rebooting will do it. ;-) Can someone let me know? Is a
killall the best way?
Anyway, if all has gone well, you will no longer start X locally, but kdm will
be listening on udp port 177. The following commands should give output as
given. If not, get me a copy of Debian (Michael??) and I'll sort it out.
# netstat -u -n -a | grep 177
udp 0 0 0.0.0.0:177 0.0.0.0:*
# netstat -u -a | grep xdmcp
udp 0 0 *:xdmcp *:*
# /usr/sbin/lsof | grep xdmcp
kdm 2885 root 6u IPv4 7008 UDP *:xdmcp
Now, provided there is no firewall on your debian box, loggin into it from
your Windows machine should be as simple as running
/usr/X11R6/bin/XWin.exe -query debian.box
/usr/X11R6/bin/XWin.exe -query debian.box -from windows.box
You can of course just set up a windows shortcut to
with the given paramters. You will need to change the "Start in" property of
the shortcut to "C:\cygwin\bin", or add "C:\cygwin\bin" to your %PATH.
Double-clicking the shortcut will then give you an XDMCP login to your debian
But wait! There is more! Depending on your Cygwin setup and your debian
setup, you may want to be sure that any fonts your debian programs require
are available on your Windows X session.
If so, you will want to be running the font server on your debian box.
First, see if it is running.
$ ps -A | grep xfs
1501 ? 00:00:02 xfs
If not, ask some debian person as to which config to edit. Should not be that
hard. On RH, you just do the rc.d thing to /etc/init.d/xfs.
You will also need to edit the xfs config file (/etc/X11/fs/config on RH7.3).
The last line of this file should be
no-listen = tcp
Comment this out.
Restart the font server. On RH7.3:
# /etc/init.d/xfs restart
Then you should get:
# netstat -t -a | grep xfs
tcp 0 0 *:xfs *:* LISTEN
# netstat -t -a -n | grep 7100
tcp 0 0 0.0.0.0:7100 0.0.0.0:* LISTEN
# /usr/sbin/lsof | grep xfs | grep TCP
xfs 3696 root 4u IPv4 38655 TCP *:xfs
Now, you just need to tell XWin to use the debian box's font server.
XWin.exe -query debian.box -fp tcp/debian.box:7100
(With the -from if required).
All should be well. Double click your shortcut, and you are away!
PS. I'm planning on writing a python script to do this (hopefully designed to
respond appropriately in various distributions, so debian experts please
provide me with any debian specific adjustments) and have been meaning to
take some notes on the whole process. (I keep losing my paper ones.) So
thanks Donovan. ;-)
More information about the linux