cht電腦資訊Windows
adm Find login register

Using cygwin X server 連到 connecting to linux 的心得

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
1subject: Using cygwin X server 連到 connecting to linux 的心得Promote 0 Bookmark 12008-04-29quote  

cygwin 可以在 http://www.cygwin.com/setup.exe download

內定是 install to C:\cygwin

修改 C:\cygwin\etc\X11\xinit\xinitrc

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

#exec xterm -e /usr/bin/bash -l
exec xterm -e ssh -X xxx@192.168.0.2

執行 cygwin console, 在裡面的 console shell 執行 startx

這樣就可以用 ssh 直接連上 Linux 的機器,也可以使用 X11 forwarding 的功能。

Cygwin 目前最大的缺點是 copy/paste buffer(clipboard) Windows 與 Linux/X11 無法互通。

像 cygwin 的 windows xterm clipboard 就無法與 linux/X11 的 xterm 互通。 

edited: 4
eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
2subject: Promote 0 Bookmark 02008-12-02quote  

 Cygwin/X 1.5.3

把內定值改了,改成了 single window 還用 twm。如果想要改成 multiwindow 可以修改底下的 startx。 另外 Xauthority變成 enable,目前試不出如何搭配 X11 forward,只好 disable 掉。 加上 -clipboard 選項,這樣 X11 clipboard 可以與 windows 互通。 

C:\cygwin\bin\startx

serverargs="-multiwindow -clipboard"

enable_xauth=0

edited: 2
eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
3subject: Promote 0 Bookmark 02009-02-17quote  

如果要連上第二台 host,可以用 hr 這個 script。不過如果連上之後,我們想開第3個host,在 cygwin bash shell 按 ctrl-Z suspend 後,然後執行 bg,會導致整個 X11 停住不動,應該算是bug。這時候可以再開一個 cygwin bash shell去執行 script。  

$cat hr

#!/bin/bash
export DISPLAY=:0
ssh -X zzzz@hyperrate.com utf8-term

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
4subject: Promote 0 Bookmark 02010-06-07quote  

今天 update 了 cygwin/X 結果不能執行,出現了 error

/var/log/XWin.0.log
2010-03-31 14:51:22 XFree86-Bigfont extension local-client optimization disabled due to lack of shared memory support in the kernel
xxx [dix] Could not init font path element /usr/share/fonts/TTF/, removing from list!
xxx [dix] Could not init font path element /usr/share/fonts/OTF/, removing from list!
xxx[dix] Could not init font path element /usr/share/fonts/Type1/, removing from list!
xxx (EE) XKB: Could not invoke xkbcomp
xxx (EE) XKB: Couldn't compile keymap
xxx XKB: Failed to compile keymap
xxx Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.

google 之後找到 solution

  1. execute \cygwin\bin\ash.exe
  2. 在 ash 底下執行 /bin/rebaseall
eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
5subject: Promote 0 Bookmark 02011-09-02quote  

ssh -X -Y

I must use '-Y', otherwise X forward will be disabled for new clients after 20 minutes.

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
6subject: Promote 0 Bookmark 02012-08-07quote  

建議加上 -C,這樣會壓縮資料,在 Internet ssh 時會有一些速度的改進。

CC: Linux
cht電腦資訊Windows
adm Find login register
views:25204