在windows系统下使用QEMU运行openEuler镜像的RISCV64系统

1 篇文章 0 订阅
1 篇文章 0 订阅

在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#$

Qemu 1.0.1 Windows QEMU emulator version 1.0.1, Copyright (c) 2003-2008 Fabrice Bellard usage: qemu [options] [disk_image] 'disk_image' is a raw hard disk image for IDE hard disk 0 Standard options: -h or -help display this help and exit -version display version information and exit -machine [type=]name[,prop[=value][,...]] selects emulated machine (-machine ? for list) property accel=accel1[:accel2[:...]] selects accelerator supported accelerators are kvm, xen, tcg (default: tcg) -cpu cpu select CPU (-cpu ? for list) -smp n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets] set the number of CPUs to 'n' [default=1] maxcpus= maximum number of total cpus, including offline CPUs for hotplug, etc cores= number of CPU cores on one socket threads= number of threads on one CPU core sockets= number of discrete sockets in the system -numa node[,mem=size][,cpus=cpu[-cpu]][,nodeid=node] -fda/-fdb file use 'file' as floppy disk 0/1 image -hda/-hdb file use 'file' as IDE hard disk 0/1 image -hdc/-hdd file use 'file' as IDE hard disk 2/3 image -cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master) -drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i] [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off] [,cache=writethrough|writeback|none|directsync|unsafe][,format=f] [,serial=s][,addr=A][,id=name][,aio=threads|native] [,readonly=on|off] use 'file' as a drive image -set group.id.arg=value set parameter for item of type i.e. -set drive.$id.file=/path/to/image -global driver.property=value set a global default for a driver property -mtdblock file use 'file' as on-board Flash memory image -sd file use 'file' as SecureDigital card image -pflash file use 'file'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值