cygwinでxserver

クライアント側にcygwinが入っていることが前提。

まず、サーバー側のgdmの設定ファイルを編集(gnomeの場合)。以下のどちらか。

  • /etc/gdm/custom.conf
  • /etc/X11/gdm/gdm.conf
  • /etc/X11/gdm/factory-gdm.conf
[xdmcp]
Enable=true
Port=177
[security]
DisallowTCP=false

あと、6000番が通っていることを確認。
ちなみにfirewallはiptablesとかが担っているので、セキュリティを犠牲にして利便性を取りたければ

$ sudo chkconfig iptables off
$ sudo /etc/rc.d/init.d/iptables stop

クライアント側は以下のようなバッチファイルを叩けば良い(startxwin.batを元にすると楽)。

@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/X11R6/bin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale

if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0
del %CYGWIN_ROOT%\tmp\.X11-unix\X0

:CLEANUP-FINISH
if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix
if "%OS%" == "Windows_NT" goto OS_NT
REM Windows 95/98/Me
echo startxwin.bat - Starting on Windows 95/98/Me

goto STARTUP

:OS_NT
REM Windows NT/2000/XP/2003
echo startxwin.bat - Starting on Windows NT/2000/XP/2003

:STARTUP

REM ★★★★★★★★★★ここがポイント★★★★★★★★★★★
%RUN% XWin -clipboard -silent-dup-error -screen 0 1280x1024x65536 -query 192.168.0.125 -from 192.168.0.37

%RUN% xterm -e /usr/bin/bash -l

REM %RUN% twm
%RUN% wmaker

REM Set a background color.  Only needed when not using -multwindow for XWin.
REM %RUN% xsetroot -solid aquamarine4