在使用Hyper-V安装OpenWRT的时候,由于OpenWRT是img格式。需要转换才使用。

准备工作

任意Linux系统,这里使用WSL的Ubuntu。安装qemu-utils工具进行转换。

Bash
sudo apt install qemu-utils -y

先解压img.gz格式,得到img文件。

Bash
gzip -d openwrt-24.10.2-x86-64-generic-ext4-combined-efi.img.gz

转换格式为vhdx

Bash
qemu-img convert -f raw -O vhdx openwrt-24.10.2-x86-64-generic-ext4-combined-efi.img openwrt.vhdx

转换完成后的vhdx文件可以作为硬盘直接挂载到Hyper-V。但是目前OpenWRT只支持第一代Hyper-V。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注