*cygwin iso !!インストール *http://www.cygwin.com/setup.exe *setup.exe 実行 !追加が必要な自分がよく使うパッケージ *ImageMagick *bc *bsdtar *curl *==diffutils== Base インストールに含まれた *==file== Base インストールに含まれた *==openssl== Base インストールに含まれた *openssh *p7zip *perl *perl_manpages *ping *rsync *time *unzip *vim *wdiff *wget *zip *xinit を入れると、Windows 上で X Window Server が起動する。 *リモート X が可能 *X window がインストールされていないリモートサーバに、ローカルで起動したX Window Server 画面からリモートXで接続し、リモートサーバ上の X 画面を起動できる。 !!更新 *setup.exe 実行 !!日本語化 !uenox HomePage Cygwin 日本語化 *http://uenox.ld.infoseek.co.jp/cygwin/japanese.html */etc/inputrc set kanji-code sjis set convert-meta off set meta-flag on set output-meta on */etc/profile.d/jp.sh export LANG=ja_JP.SJIS export TZ=JST-9 export JLESSCHARSET=japanese-sjis alias ls='ls --show-control-chars --color -F' chmod +x /etc/profile.d/jp.sh !!Cygwin-X で画面転送 *Windows+cygwin+X-Window --ssh--> Linux/FreeBSD *Linux/FreeBSD 上で X を起動しなくてもXのプログラムを実行できる。 *X画面を Windows 側で表示 *Oracle インストーラや RaidManager などの GUI でしか提供されていないプログラムに利用 !sshd 設定確認 */etc/ssh/sshd_config *X11Forwarding yes *デフォルト no が多い *sshd 設定反映 # service sshd restart *host-config-ssh **発生エラー1 *** Warning: The file /etc/passwd is not readable by all. *** Warning: Please run 'chmod +r /etc/passwd'. *** Warning: The file /etc/group is not readable by all. *** Warning: Please run 'chmod +r /etc/group'. *** ERROR: Problem with LocalSystem or Adminstrator IDs nonaka@nona.to ~ $ ls -l /etc/passwd /etc/group -rwxr-x---+ 1 nonaka Users 501 Aug 20 18:57 /etc/group* -rwxr-x---+ 1 nonaka Users 2451 Aug 20 18:57 /etc/passwd* nonaka@nona.to ~ $ chmod +r /etc/group /etc/passwd $ ls -l /etc/passwd /etc/group -rwxr-xr--+ 1 nonaka Users 501 Aug 20 18:57 /etc/group* -rwxr-xr--+ 1 nonaka Users 2451 Aug 20 18:57 /etc/passwd* **発生エラー2 *** Warning: The permissions on the directory /var are not correct. *** Warning: They must match the regexp d..x..x..[xt] *** ERROR: Problem with /var directory. Exiting. nonaka@nona.to ~ $ ls -ld /var drwxrwx---+ 8 nonaka Users 0 Dec 11 09:35 /var/ nonaka@nona.to ~ $ chmod o+rx /var nonaka@nona.to ~ $ ls -ld /var drwxrwxr-x+ 8 nonaka Users 0 Dec 11 09:35 /var/ !Cygwin-X インストール *cygwin の setup.exe で xorg をインストールする !Cygwin-X の実行 *Xterm 起動する !ssh で接続 % ssh -X USERNAME@REMOTE !rootになるとき *X 画面転送に必要な環境変数 DISPLAY を保持するため、 su - または su -m でroot取得 !cygwin は OpenSSH-3.8 に更新 *動いていたX11画面転送が動作しない untrusted X11 forwarding setup failed: xauth key data not generated !cygwin FAQ: X11 forwarding *http://www.cygwin.com/ml/cygwin-xfree/2008-11/msg00154.html ""信頼できない通信回線でのX11画面転送で問題が出ている人は ""http://x.cygwin.com/docs/faq/cygwin-x-faq.html#remote を(もう一度)読んでね !Cygwin X FAQ / Remote connections *http://x.cygwin.com/docs/faq/cygwin-x-faq.html#remote ""Q6.1 Cygwin の OpenSSH では X11Forwarding が動かない *A1 動かない理由 ""OpenSSH 3.8 では、「untrusted X11 forwarding(信頼できない回線でのX11画面転送)」をサポートするsshサーバに接続しようとした時、デフォルトで「untrusted X11Forwarding」を実施します。ほとんどの GNU/Linux での ssh サーバのバージョンは「untrusted X11Forwarding」が有効になっているため、cygwin の OpenSSH-3.8 を使った接続は「untrusted X11Forwarding」が有効になってしまいます。ほとんどのXアプリケーションはコピーやペーストしようとすると kill されてしまったり、ローカルで起動した場合と比べて xdpyinfo では数分の一の情報しか表示されないようになってしまいます。 *A2 対策 ""ssh接続前に、Xサーバの起動と環境変数DISPLAYを設定する必要があります。 $ DISPLAY=localhost:0.0 $ export DISPLAY $ ssh -Y remotehost $ DISPLAY=localhost:0.0 ssh -Y remotehost ""引数 -Y は OpenSSH-3.8 から導入されました。これより古いバージョンを使っている場合は -X を使ってください。 *A3 無効オプションの確認 ""-x オプションなしで ssh を起動しているか確認しましょう。X11Forwarding を無効にします。 *A4 ssh クライアント設定の確認 **/etc/ssh_config **~/.ssh/ssh_config ForwardX11 yes *A5 ssh サーバ設定の確認 **/etc/ssh/sshd_config X11Forwarding yes !!Cygwin 終了時の「バッチジョブを終了しますか」を回避 *Ctrl+C を使うと発生する *起動するショートカットが C:\cygwin\cygwin.bat を起動しているため。 *c:\cygwin\bin\bash.exe --login -i に変更すると直る *参考: http://discypus.jp/wiki/?Cygwin%2F%A5%E1%A5%E2 !ショートカットの作成 *新規作成 *ショートカット *項目の場所: c:\cygwin\bin\bash.exe --login -i *名前: cygwin(任意) *完了 !コマンドライン *cygwin update setup-x86_64-2.873.exe -q -g *install setup-x86_64-2.873.exe -q -P procps !!!参考サイト !沖ソフトウェア エンジニアリングソリューションセンタ *http://www.okisoft.co.jp/esc/cygwin.html !/dev ファイルシステムと /proc ファイルシステム / Studio Sixnine *http://www.sixnine.net/cygwin/cygwin-doc/devices.html ,/dev/scd0,CD-ROM ドライブ ,/dev/sda,ハードディスク ,/dev/sda1,ハードディスクの第一パーティション