[[PageOutline]] * http://www.cygwin.com/setup.exe * [http://kkaneko.com/rinkou/cygwin/cygwin.html Windows に Cygwin バージョン 1.7 をインストール] * [http://d.hatena.ne.jp/takuya_1st/20110423/1303586388 cygwin がMS-DOS形式のパスをWarningするので消した - ブックマクロ開発に] > cygwinの環境変数については次のサイトが詳しい * [http://gnupack.sourceforge.jp/docs/current/UsersGuide_technical_info.html gnupack Users Guide - 技術情報] = Cygwin/X = * [http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html Installing Cygwin/X] * xorg-server (required, the Cygwin/X X Server) * xinit (required, scripts for starting the X server: xinit, startx, startwin (and a shortcut on the Start Menu to run it), startxdmcp.bat ) * xorg-docs (optional, man pages) * X-start-menu-icons (optional, adds icons for X Clients to the Start menu) = X11 forwarding with PuTTY = * 以下の手順はセキュリティを弱めることで問題に対応しているので、内容を理解して行うこと * [http://vega.sra-tohoku.co.jp/~kabe/vsd/ssh-x.html Forwarding X11 using ssh on modern desktop] > localのXサーバの -nolisten tcp オプションを外す (snip) local機の 6000番ポートにつなげられる人がちょっかい出せるようになるので、 おすすめされていない。 (xauthが有効な限りDoS以外の害はなさそうだが) == Could not connect: Connection refused == * $ virt-manager {{{ PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused Unable to init server: Could not connect: Connection refused }}} * $ echo $DISPLAY {{{ localhost:10.0 }}} * $ sudo netstat -nap | grep 6010 {{{ tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 6568/sshd: mitty@pt tcp6 0 0 ::1:6010 :::* LISTEN 6568/sshd: mitty@pt }}} * puttylog {{{ Event Log: Requesting X11 forwarding Event Log: Requesting OpenSSH-style agent forwarding Event Log: X11 forwarding enabled }}} {{{ Event Log: Received X11 connect request from ::1:56944 Event Log: Opened X11 forward channel Event Log: Forwarded X11 connection terminated due to local error: Network error: Connection refused }}} * C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cygwin-X\XWin Server.lnk {{{ C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/startxwin" }}} * startxwinをデフォルトのまま用いると、6000/tcpでListenしなくなる * D:\>netstat -nao | grep 7688 {{{ TCP 127.0.0.1:53045 0.0.0.0:0 LISTENING 7688 }}} * D:\>netstat -nao | grep 6556 {{{ TCP 127.0.0.1:53447 0.0.0.0:0 LISTENING 6556 }}} * http://x.cygwin.com/docs/man1/startxwin.1.html > By default startxwin passes '-nolisten tcp' to the server, the special server option '-listen' can be used to stop startxwin from doing this. * 実際には{{{-listen tcp}}}とする必要がある → http://x.cygwin.com/docs/man1/Xserver.1.html * [http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-xserver-nolisten-tcp-default Cygwin/X Frequently Asked Questions] 3.13. I upgraded and now X clients can't connect * [https://bbs.archlinux.org/viewtopic.php?id=193953 (SOLVED) X Server not accepting remote connections after update / Newbie Corner / Arch Linux Forums] * [http://unix.stackexchange.com/questions/202043/putty-cygwinx-and-x11-forwarding-connection-refused linux - PuTTY, CygwinX, and X11 forwarding connection refused - Unix & Linux Stack Exchange] > {{{ > C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/startxwin -- -multiwindow -listen tcp" > }}} * XWin Server.lnk {{{ C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/startxwin -- -multiwindow -listen tcp" }}} * D:\>netstat -nao | grep 6000 {{{ TCP 0.0.0.0:6000 0.0.0.0:0 LISTENING 4276 }}} * 実際にはこれだけでは不足で、XWin.exeを直接起動するようにしたほうが良い(see [#Authorizationrequired]) == Authorization required == * $ virt-manager {{{ Authorization required, but no authorization protocol specified Unable to init server: Could not connect: Connection refused }}} * [https://cygwin.com/ml/cygwin-xfree/2015-02/msg00075.html Jon TURNEY - Re: Can't open display with PuTTY and xinit 1.3.4-1] > I'm afraid it seems '-listen tcp' is not enough for PuTTY to successfully connect. > If the server was started with -auth (which startxwin does since xinit-1.3.4-1), then PuTTY will need authorization data to successfully connect. > Whilst you can do this by setting the "X authority file for local display" in PuTTY's configuration to the Windows path equivalent to ~/.serverauth.NNNN, this isn't much of a solution as this filename changes everytime the server is started. > Perhaps xinit needs an option to avoid using -auth? One can demonstrate that works by starting the server directly, e.g. using 'XWin -multiwindow -listen tcp' rather than 'startxwin'. * /usr/bin/startxwin (xint 1.3.4-9) {{{ xserverauthfile=$HOME/.serverauth.$$ }}} * {{{startxwin -- -multiwindow -listen tcp}}}で起動したときの /var/log/xwin/XWin.0.log {{{ XWin was started with the following command line: /usr/bin/XWin :0 -multiwindow -listen tcp -auth /home/mitty/.serverauth.10152 }}} * {{{-auth}}}のパスが毎回変わるため、PuTTY側で指定するのが困難[[br]][[Image(putty-x11.png,33%)]] * 最終的に、{{{XWin Server.lnk}}}を以下のようにすることで解決 {{{ C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/XWin :0 -multiwindow -listen tcp" }}} = Cygwin Ports = * [http://sourceware.org/cygwinports/ Cygwin Ports] * 公式の ftp://ftp.cygwinports.org/pub/cygwinports が使えないほど遅い * apt-cygを使うと良い模様 * http://code.google.com/p/apt-cyg/ * like: $ apt-cyg -m http://ftp.jaist.ac.jp/pub/sourceforge/c/cy/cygwin-ports/ install id3v2