2007年10月19日 星期五

colinux, Xming, X11, Forwarding

Freescale 的開發環境需要 Fedora 5 以上的環境.
手邊只有一台 Notebook, 但只能用來跑 Windows XP, 不能重裝, 只好 裝 colinux 搭配 Xming 跑 X-Window 的程式.

一, 安裝 colinux
首先到 www.colinux.org 的網站 download colinux-0.6.4 版本.
colinux 的download 網頁為 SF.net > Projects > Cooperative Linux > Files

1. colinux 主程式的安裝
下載 coLinux-0.6.4.exe
colinux-0.6.4-20060912-update.zip

執行 coLinux-0.6.4.exe, 安裝到 %ProgramFiles%\colinux 目錄下.
再將 colinux-0.6.4-20060912-update.zip 中的 執行檔, 解壓縮到 %ProgramFiles%\colinux

2. 安裝 FedoraCore 6
下載 FedoraCore6-20070502.exe
並解壓 縮到 %ProgramFiles%\colinux

3. 建立 啟動參數 檔

<?xml version="1.0" encoding="UTF-8"?>
<colinux>
<block_device index="0" alias=hda1 path="\DosDevices\c:\Program Files\coLinux\FedoraCore6.img" enabled="true" />
<block_device index="2" alias=hda3 path="\DosDevices\c:\Program Files\coLinux\fc5-2gb-1.ext3" enabled="true" />
<block_device index="1" alias=hda2 path="\DosDevices\c:\Program Files\coLinux\swap.img" enabled="true" />
<block_device index="29" path="\DosDevices\c:\Program Files\coLinux\FC-6-i386-DVD.iso" enabled="true" />
<!--
<block_device index="29" path="\DosDevices\c:\Program Files\coLinux\102p.iso" enabled="true" />
<block_device index="2" path="\DosDevices\c:\Program Files\coLinux\slack102_rootdisk.img" enabled="true" />
-->
<bootparams>ro root=/dev/hda1 fastboot nogui</bootparams>
<image path="vmlinux" />
<memory size="128" />
<network index="0" type="tap"/>
<network index="1" type="bridged" name="LAN" />
</colinux>


4. XP端的網路設定
a. 將 "區域連線"改名成 "區域連線(LAN)".
b. 設定 TAP-Win32 Adaptor V8 (coLinux), 將 TCP/IP 內容中的 IP 地址設為 192.168.2.1

5. 設定 colinux 為 service
切換目錄到 %ProgramFiles%\colinux, 並執行
colinux-daemon --install-service fc6 -c fc6.xml

net start fc6 可以啟動 colinux
net stop fc6 可以 shutdown colinux

6. colinux 端的網路設定
切換目錄到 %ProgramFiles%\colinux, 並執行 colinux-console-nt.exe 即可進入 fedora 6.
a. 設定 eth0 為 192.168.2.2
b. 設定 eth1 為 所在 lan 的地址.

二, 安裝 Xming
Xming 的主網站為
Xming, 這是一套在 Windows 上的 X Server (不需要 Cygwin)
1. 下載 Xming
下載以下軟體, 並依序安裝
Xming-6-9-0-28-setup.exe
Xming-fonts-7-3-0-2-setup.exe
Xming-tools-and-clients-6-9-0-28.zip
Xming-portable-PuTTY-7-3-0-4-setup.exe
Xming-mesa-6-9-0-28-setup.exe

三, 使用 X11
1. 在 Fedora 上的設定, 確定 /etc/ssh/sshd_config 中 有設定
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

2. 在 %ProgramFiles%\Xming 目錄下, 執行
plink -ssh -pw root -X root@192.168.2.2 xterm

也可以將 以上指令, 放在 %ProgramFiles%\Xming\Xmingrc 內.
例如, 在 menu apps 中, 加入以下內容
colinux exec "plink -ssh -pw root -X root@192.168.2.2 xterm"
滑鼠右鍵點選 icontray Xming, 就可選擇 Applications -> colinux
並且開啟 xterm.

note:
putty 的首頁
plink 的使用說明 (這裡)
Z:\sysosd>plink
PuTTY Link: command-line connection utility
Release 0.60
Usage: plink [options] [user@]host [command]
("host" can also be a PuTTY saved session name)
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw
force use of a particular protocol
-P port connect to specified port
-l user connect with specified username
-batch disable all interactive prompts
The following options only apply to SSH connections:
-pw passw login with specified password
-D [listen-IP:]listen-port
Dynamic SOCKS-based port forwarding
-L [listen-IP:]listen-port:host:port
Forward local port to remote address
-R [listen-IP:]listen-port:host:port
Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-m file read remote command(s) from file
-s remote command is an SSH subsystem (SSH-2 only)
-N don't start a shell/command (SSH-2 only)
-nc host:port
open tunnel in place of session (SSH-2 only)

沒有留言: