DEV Community

thirdblood
thirdblood

Posted on

在virtualbox中运行openwrt

openwrt官网下载openwrt镜像

openwrt-23.05.3-x86-64-generic-ext4-combined.img.gz

在终端中执行命令

# 解压gz镜像
gzip -d openwrt-23.05.3-x86-64-generic-ext4-combined.img.gz
# 将镜像转为virtualbox硬盘格式
vboxmanage convertfromraw openwrt-23.05.3-x86-64-generic-ext4-combined.img openwrt.vdi
Enter fullscreen mode Exit fullscreen mode

在virtualbox中创建虚拟机
创建虚拟机

内存和处理器,用默认的就够了
设置虚拟机的内存和处理器

在终端中将openwrt.vdi移到虚拟机目录中

mv openwrt.vdi /media/sda1/openwrt2/
Enter fullscreen mode Exit fullscreen mode

在虚拟硬盘这里,先不添加虚拟硬盘,点下一步
设置虚拟机的虚拟硬盘

没有问题的话,就点完成
虚拟机创建完成

现在我们给新虚拟机添加刚刚转换的openwrt.vdi硬盘
点击这里的设置
Virtualbox管理器

点击这里的图标,打开虚拟硬盘选择窗口
虚拟机设置窗口

虚拟硬盘选择窗口,点击注册
注册虚拟硬盘

选择我们刚刚mv过来的openwrt.vdi
选择vdi文件

再选择我们注册进来的openwrt.vdi
选择虚拟硬盘

点击确定

确认虚拟机设置

这里就可以启动我们的openwrt虚拟机啦
启动虚拟机

当虚拟机屏幕内容停止跳动的时候

虚拟机启动成功

按一下Enter,就可以进入我们的shell,这里就启动好了
进入shell

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay