1. 程式人生 > >虛擬機器VMvare 上跑 X86 OpenWRT

虛擬機器VMvare 上跑 X86 OpenWRT

編譯方法和 OpenWRT backfire 編譯方法 是一樣的。 裝 Luci web UI :
1. ./scripts/feeds update packages luci
2. ./scripts/feeds install -a -p luci
經過這個步驟,在 make menuconfig 裡就有 LuCI 相關選項。
X86 XPVM相關配置:
1. make menucofig 裡選 X86    Target System (x86)  —> (X) x86   2. 配目標檔案系統為 EXT2    Target Images  —>  [*] ext2     Target Images  —>  [*]   Build VMware image files (VMDK)      這樣就後面編譯時產生可以直接在 VM 上用的虛擬硬碟。
3. 配 Web UI :
  1) Base system  —> <*> uci……………. Utility for the Unified Configuration Interfa    2) LuCI  —>  Components  —>     — luci-admin-full….. LuCI Administration – full-featured for full    <*> luci-app-ddns……………………… Dynamic DNS configuratio    <*> luci-app-firewall……………. Firewall and Portforwarding app     luci-admin-full….. LuCI Administration – full-featured for ful       <*> luci-app-ntpc……. NTP time synchronisation client configuratiox    <*> luci-app-samba……………….. Network Shares – Samba SMB/CIFx    3)
 Network  —>    <*> uhttpd…………………… uHTTPd – tiny, single threaded HTTP server —>    <*>   uhttpd-mod-lua… uHTTPd – tiny, single threaded HTTP server (Lua plugin)    4) make V=99 編譯,時間有點長,完後,在 bin/x86/ 就是最後編譯出來的檔案了。    5) 拷貝  bin/x86/ ,我的全部路徑是 /home/longjindong/openwrt/trunk/bin/x86/ 中的 “openwrt-x86-generic-combined-ext2.vmdk”到 XP 電腦上;
XP VM 安裝執行 OpenWRT:
1. 建立一個虛擬機器    開啟 VMware –> New –> Virtual Machine … –>  下一步 –> 下一步 –> linux 、Other Linux 2.6.x kernel –> 下一步 –> 這裡Vm名和路徑可以自己指定 –> 下一步 –> 網路預設“Use bridged networking” –> 下一步 –> 這裡的硬碟大小用預設,反證一會要被刪掉 –> 完成;這樣在 VMware Workstatio 裡有“Other Linux 2.6.x kernel”的虛擬機器了。 2. 載入 OpenWRT 虛擬盤並啟動    1) 刪建立虛擬機器時的虛擬盤    右擊 “Other Linux 2.6.x kernel” — > Setting –> Hard Disk –> Remoe;    2) 載入 OpenWRT 虛擬盤    “Other Linux 2.6.x kernel” — > Settin –> Add  –> Hard Disk –> Next –> Use an existing virtual disk –> Browse ,選前面 “openwrt-x86-generic-combined-ext2.vmdk” –> Finish.    3) 點 run 按鈕就可以開始執行 OpenWRT。
補  允
   這裡 vmdk (虛擬硬碟) 也可以從 OpenWRT 管網上下載現成的,也可從管網上下openwrt-x86-ext2.image,然後製作 vmdk,製作方法如下:    第一種方法,在 linux 裡:    qemu-img convert -f raw openwrt-x86-ext2.image -O vmdk openwrt-x86-ext2.vmdk    第二種方法,在已經安裝 VMware 的系統 windows 命令列裡:    VBoxManage convertfromraw –format VMDK openwrt-x86-ext2.image openwrt-x86-2.6-ext2.vmdk 轉自:http://blog.micro-studios.com/?p=3891