在windows系统下使用QEMU运行openEuler镜像的RISCV64系统
资源以及工具准备
1. QEUM
打开地址:https://www.qemu.org/download/
可以看到 Stefan Weil provides binaries and installers for both 32-bit and 64-bit Windows.
点击 64-bit 进入 https://qemu.weilnetz.de/w64/
下载 qemu-w64-setup-20230531.exe,安装到 D:\qemu
2. RISC-V 64系统
打开地址:https://repo.openeuler.org/openEuler-preview/RISC-V/openEuler-22.09-riscv64
或者:https://mirrors.nju.edu.cn/openeuler/openEuler-preview/RISC-V/openEuler-22.09-riscv64/
点开QEMU路径,下载
openEuler-22.09-riscv64-qemu.qcow2.tar.zst
将 openEuler-22.09-riscv64-qemu.qcow2 解压缩释放到 d:\openEuler\
下载 fw_payload_oe_qemuvirt.elf 保存到 d:\openEuler\
3. zst解压工具
https://github.com/facebook/zstd/releases/download/v1.5.4/zstd-v1.5.4-win64.zip
启动批处理
将下面内容保存到 D:\openEuler\preview_start_vm.bat
内容修改自openEuler官方的:preview_start_vm.sh
@echo off
chcp 65001
set vcpu=8
set memory=8
set drive=openEuler-22.09-riscv64-qemu.qcow2
set fw=fw_payload_oe_qemuvirt.elf
set ssh_port=12055
echo :: Starting VM...
echo :: Using following configuration
echo vCPU Cores: %vcpu%
echo Memory: %memory%G
echo Disk: %drive%
echo SSH Port: %ssh_port%
set path=D:\qemu;%PATH%
qemu-system-riscv64 -nographic -machine virt -smp %vcpu% -m %memory%G -kernel "%fw%" -bios none -drive file=%drive%,format=qcow2,id=hd0 -device virtio-vga -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=usernet -netdev user,id=usernet,hostfwd=tcp::"%ssh_port%"-:22 -device qemu-xhci -usb -device usb-kbd -device usb-tablet -append "root=/dev/vda1 rw console=ttyS0 swiotlb=1 loglevel=3 systemd.default_timeout_start_sec=600 selinux=0 highres=off mem=512M earlycon"
系统登录
账号:root
密码:openEuler12#$