Version 2 (modified by mitty, 9 years ago) (diff) |
---|
- Windows に Cygwin バージョン 1.7 をインストール
- cygwin がMS-DOS形式のパスをWarningするので消した - ブックマクロ開発に
cygwinの環境変数については次のサイトが詳しい
Cygwin/X
- 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
- 以下の手順はセキュリティを弱めることで問題に対応しているので、内容を理解して行うこと
- Forwarding X11 using ssh on modern desktop
localのXサーバの -nolisten tcp オプションを外す (snip) local機の 6000番ポートにつなげられる人がちょっかい出せるようになるので、 おすすめされていない。 (xauthが有効な限りDoS以外の害はなさそうだが)
- Forwarding X11 using ssh on modern desktop
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
- $ echo $DISPLAY
- 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
- D:\>netstat -nao | grep 7688
- startxwinをデフォルトのまま用いると、6000/tcpでListenしなくなる
- 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
- Cygwin/X Frequently Asked Questions 3.13. I upgraded and now X clients can't connect
- (SOLVED) X Server not accepting remote connections after update / Newbie Corner / Arch Linux Forums
- 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
- D:\>netstat -nao | grep 6000
- 実際にはこれだけでは不足で、XWin.exeを直接起動するようにしたほうが良い(see #Authorizationrequired)
Authorization required
- $ virt-manager
Authorization required, but no authorization protocol specified Unable to init server: Could not connect: Connection refused
- 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
- 最終的に、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
- 公式の ftp://ftp.cygwinports.org/pub/cygwinports が使えないほど遅い
- apt-cygを使うと良い模様
- like: $ apt-cyg -m http://ftp.jaist.ac.jp/pub/sourceforge/c/cy/cygwin-ports/ install id3v2
Attachments (1)
- putty-x11.png (6.5 KB) - added by mitty 9 years ago.
Download all attachments as: .zip