OpenWrt 使用VirtualBox部署以及网络环境(NAT+Host-Only)(二)

首先将编译完成后的安装文件openwrt-15.05-x86-generic-combined-ext4.img.gz解压缩。

然后将解压后的img文件复制出来并转换为Virtual支持的vdi文件。



①找到Virtual Box的安装路径,并且找到VBoxManage.exe应用程序。





②运行cmd命令提示符,键入命令:(VBoxManage.exe的路径) convertfromraw -format VDI (*.img映像文件的位置) (转换后vdi文件的位置)

例如:

E:\VirtualBox\VirtualBox\VBoxManage.exe convertfromraw -format VDI f:\openwrt-15.05-x86-generic-combined-ext4.img d:\openwrt15.vdi


生成文件:openwrt15.vdi。




③使用VirtualBox来安装OpenWrt时,

类型选择Linux,版本选择Linux 2.6/3.x/4.x(32-bit)。


选择内存大小,采用默认设置256MB


最后选择"使用已有的虚拟硬盘文件",openwrt

好的,以下是帮助你搭建QEMU OpenWrt + Cortex-A7 + Visual Studio虚拟开发和debug环境的步骤: 1. 安装QEMU 首先,你需要安装QEMU模拟器。你可以从官网下载QEMU的最新版本:https://www.qemu.org/download/ 。 2. 下载OpenWrt 接下来,你需要下载OpenWrt的镜像文件。你可以从OpenWrt的官网下载:https://openwrt.org/downloads 。 3. 安装交叉编译工具链 你需要安装针对Cortex-A7处理器的交叉编译工具链。你可以从ARM的官网下载:https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads 。 安装完工具链后,将其添加到系统的PATH环境变量中。 4. 启动OpenWrt 使用QEMU启动OpenWrt。命令如下: ``` qemu-system-arm -M vexpress-a9 -m 256M -kernel openwrt-armvirt-32-zImage -append "root=/dev/vda rootfstype=ext4 rootwait console=ttyAMA0" -drive file=openwrt-armvirt-32-root.ext4,if=none,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=network0 -device virtio-net-device,netdev=network0 ``` 5. 连接到OpenWrt 使用SSH连接到OpenWrt。命令如下: ``` ssh -t root@localhost -p 2222 ``` 6. 安装Visual Studio 安装Windows版的Visual Studio。你可以从Microsoft的官网下载:https://visualstudio.microsoft.com/downloads/ 。 7. 配置Visual Studio 在Visual Studio中,选择“工具”>“选项”>“调试”>“远程调试”,然后添加一个新的远程调试器。 设置目标为OpenWrt的IP地址和端口号(默认为2222)。选择“使用SSH连接”选项,并输入用户名和密码。 8. 开始调试 现在你已经准备好在Visual Studio中进行调试了。首先,设置断点或者在代码中插入调试语句。然后,使用Visual Studio启动远程调试器,并连接到OpenWrt。 现在你可以在Visual Studio中进行调试了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值