Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2959239
  • 博文数量: 685
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5303
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-19 14:17
个人简介

文章分类

全部博文(685)

文章存档

2015年(116)

2014年(569)

分类: LINUX

2014-08-08 20:04:56

原文地址:XP VMvare 上跑 X86 OpenWRT 作者:long_ming

起  因:为了更方便安装调试一些应用,比如 Luci,Bonjour等一些应用,在 XP 的 VM 上装个 OpenWRT 免得还要插个其它 Mipsel 路由器,再说 PC 总比嵌入式快吧。上次在 XP VM 上过,但是现在要来重做,忘了不知从哪里开始了,为了下一次,这次记下来。
 
编译方法和 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
 
 
参考资料:
 




 
阅读(907) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~