This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to get xdm working?


On Mon, 8 Sep 2003 pnews@lomarline.freeserve.co.uk wrote:

> CYGWIN_95-4.0 myhost 1.5.3(0.90/3/2) 2003-09-01 13:15 i586 unknown
> unknown Cygwin
>
> I am running these tests on a Samba partition which is mounted
> on the F: drive.
>
> I can make an XDMCP connection using startxdmcp.bat or the command line
> Xwin.exe -query remotehost. (Having learnt to mount the /tmp as a bin
> type mount! )
>
> This works fine and I can get the indirect list of machines on my net
> served up to me via the remotename machine. Connect to that machine
> and get the remote xdm to give me a login prompt.
>
> Is it possible set up cywin to run the equivalent of my Linux Boxes'
> inittab lines:
>   x1:5:respawn:/usr/X11/bin/X -indirect thislocalhost
>   x2:5:respawn:/etc/X11/xdm -nodaemon

There is a sysvinit package for Cygwin that might do exactly what you
want.  See the package documentation in /usr/doc/sysvinit* (or
/usr/share/doc/sysvinit*) and the Cygwin-specific documentation in
/usr/doc/Cygwin/sysvinit-*.README (or /usr/share/doc/...).

> I have tried to do this in two ways:
> The first is to run xdm without removing the line in
> /etc/xdm/Xservers specifying the server name:
>   :0 local /usr/X11R6/bin/X
> Infact I modified this to:
>  localhost:0 local /usr/X11R6/bin/X
> Because I needed that name to fix the "auth" problem. (see below)
>
> I could then run xdm from the command line. It returns:
>   "Only root wants to run xdm"
> I worked around this in one of two ways:
> either running "xdm -debug 10"
> or creating a root account and logging in as root.

This is probably a bug in xdm.  It's been discussed on this list before.
Cygwin (or, rather, Windows) doesn't have a root user, but does have users
with various permissions usually attributed to "root".  On Win9x you can
simply add a line for "root" to /etc/passwd (on WinNT/2k/XP you can copy
the line for "system" and change the user name in that new line to
"root").

> The other files I altered were all in /etc/X11/xdm
> Xaccess
>   *                   #any host can get a login window
>   * CHOOSER BROADCAST #any indirect host can get a chooser
>
> xdm-config
>   !DisplayManager.errorLogFile:  /var/log/xdm.log
>   DisplayManager.errorLogFile:  /tmp/xdm.log
>
>   ! removing this makes life simpler for now
>   ! DisplayManager.willing:             su nobody -c /usr/X11R6/lib/X11/xdm/Xwilling
>
>   DisplayManager.*.authFile:    Xauthority
>   DisplayManager.RandomFile:            /tmp/XWin.log
>
>   !DisplayManager.requestPort:     0
>
> Some comments on the above. I changed the errorLogFile so that
> I did not have to monitor logs in more than one dir.
>
> I removed the su "nobody -c" because it just complicates things!
> Removing the whole line saves running a script which includes
> programs which do not exist on my installation of cygwin.
>
> I created an "Xauthority" file because the one generated by xdm
> has a colon in it and the file system barfs at that. When
> creating the entries for the Xauthority file I used a modified
> version of the which appeared in May 2002 in this mail list:
>    XAUTHORITY=/usr/X11R6/lib/X11/xdm/authdir/authfiles/Xauthority
>    DISPLAYNUM=:0
>    mcookie=`dd if=/dev/urandom count=1 | md5sum | cut -f1 -d\ '`
>    xauth -f "$XAUTHORITY" -v add "$DISPLAYNUM" . "$mcookie"
>    xauth -f "$XAUTHORITY" -v add "127.0.0.1$DISPLAYNUM" . "$mcookie"
>    xauth -f "$XAUTHORITY" -v add "$HOSTNAME$DISPLAYNUM" . "$mcookie"
> NB; For belt and braces I mounted the file "authfiles" dir as type bin.
> This is why I changed the line in the Xserver file to include localhost as
> this script generates that entry:
>   $ xauth list
>   myhost/unix:0  MIT-MAGIC-COOKIE-1  7042...fc
>   localhost:0  MIT-MAGIC-COOKIE-1   7042...fc
>   myhost.mydomain.com:0  MIT-MAGIC-COOKIE-1  7042...fc
>
> DM.RandomFile was used because the default is /dev/mem which does not
> appear to exist. I would be grateful for a better solution than the
> log file as a file for "sum".

Cygwin has a /dev/mem (but it won't be shown by "ls /dev", since /dev is a
virtual filesystem in Cygwin.  Try "ls -l /dev/mem", and you'll see that
it does exist.  I've posted a script to the main Cygwin list that would
create the /dev directory and the various entries in it so that "ls" and
tab completion works.  Another possibility is using /dev/urandom, which
you've used for mcookie above.

> DM.requestPort is commented out because I want other machines to get XDMCP
> messages from this machine.
>
> If I run xdm with the Xservers commented out and from separate
> window with the line: "Xwin -indirect myhost"
> The host name appears in the indirect list on a Linux machine.
> But when I connect to it I get a grey cross hatched screen
> and nothing else. The same is true for the local X screen.
> At the same time as the cross hatch appears xdm "core dumps"
>
> Whether I run "xdm -debug 10" as root or another user whether there is
> an entry in Xserver or chooser or xterm inplace of chooser
> xdm always "core dumps" usually with the  KERNEL32.DLL or less often
> CYGWIN1.DLL depending on the settings in xdm-config

If you'd like to debug this yourself, you could build xdm and Cygwin with
debugging information, and use gdb to see where the fault happens (or use
addr2line to decode the stackdump).  At the very least you could take a
look at the strace of xdm to see if something obvious is going wrong.

> I noted the entry 2003/7/102 that other have been doing far more work
> on his than I have. Has anyone got a version which runs (with the release
> which I am using) and if so what am I doing that is not correct?
>
> Two useful mail list refrences:
> http://cygwin.com/ml/cygwin-xfree/2003-07/msg00102.html
> http://sources.redhat.com/ml/cygwin-xfree/2002-05/msg00226.html
>
> Here is one example of a dump cut from the popup window.
> XDM caused an invalid page fault in
> module KERNEL32.DLL at 0137:bff85fe5.
> Registers:
> EAX=c0013f4c CS=0137 EIP=bff85fe5 EFLGS=00010202
> EBX=8160e5a0 SS=013f ESP=006d0000 EBP=006d009c
> ECX=c0013f48 DS=013f ESI=006d00d0 FS=2877
> EDX=006d01f8 ES=013f EDI=006d00b4 GS=0000
> Bytes at CS:EIP:
> 57 8b 30 55 83 7e 54 00 0f 84 1c 01 00 00 f6 46
> Stack dump:
> 006d00d0 006cda98 00000000 bff85812
> 00000001 0000000e 006d00b4 006d00d0
> 006d0300 0000000b 006cda98
> 00000000 00000000 00000000 00000000
> 00000000
>
> Here is a example taken from the XDM.EXE.stackdump
>
> Excption: STATUS_ACCESS_VIOLATION at eip=610788D1
> eax=20202020 ebx=008CF380 ecx=61621714 edx=61621718 esi=00000039 edi=FFFFFFFF
> ebp=008CF3A8 esp=008CF340 program=F:\CYGWIN\USR\X11R6\BIN\XDM.EXE
> cs=0137 ds=013F es=013F fs=25AF gs=0000 ss=013F
> Stack trace:
> Frame     Function  Args
> 008CF3A8  610788D1  (00000001, 008CF3C0, 00000001, 008CF400)
> 008CF3C8  6107826C  (00000001, 008CF3E0, 00000039, 008CF7F4)
> 008CF7E8  00406800  (00408F96, 10036218, 00000000, 00000001)
> 008CF808  0040905E  (10038CE8, 00000000, 00000000, 001282E1)
> 008CF838  00408D38  (10038CE8, 10036340, 00000001, 610773D0)
> 008CF858  00405E09  (10038CE8, 10036260, 10038DD8, 008CF8A4)
> 008CF8B8  0040C950  (008CF8E0, 00000010, 00000017, 00000017)
> 008CF908  0040B2A3  (0040B300, 00000001, 00000000, 00000000)
> 008CF938  0040B431  (00000014, 004051D0, 00000000, 00000000)
> 008CFD68  00404B4D  (00000003, 6162201C, 10030330, 008CFD9C)
> 008CFDB8  61004D8A  (610D0EE8, FFFFFFFE, 00000005, 610D0E0C)
> 008CFE08  6100507D  (00000000, 00000000, BFFBFA00, 008CFF68)
> 008CFE28  00453D82  (00404910, 037F0500, 008CFF78, BFF88E93)
> 008CFE38  0040103C  (8161F5AC, 8162A27C, 006C0000, 006D6458)
> 008CFF78  BFF88E93  (BFF88A87, 00000019, 8161F5AC, 00000000)
>
> --
> Regards Philip

Hope this helps,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]