1、下载QEMU_EFI.fd引导程序
下载iso镜像
openEuler下载 | 欧拉系统ISO镜像 | openEuler社区官网
如果想跳过第二步镜像安装,也可以直接使用官方安装好的镜像,然后直接执行第四步
官方镜像默认用户名:root 密码:openEuler12#$
windows环境:
2、创建虚拟存储
qemu-img create -f qcow2 C:\D\openEuler\openEuler.qcow2 40G
3、安装镜像
qemu-system-aarch64.exe -m 2048 -cpu cortex-a72 -smp 8,sockets=4,cores=2 -M virt -bios C:\D\openEuler\QEMU_EFI.fd -device VGA -device nec-usb-xhci -device usb-mouse -device usb-kbd -drive if=none,file=C:\D\openEuler\openEuler.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 -drive if=none,file=C:\D\openEuler\openEuler-22.03-LTS-SP3-aarch64-dvd.iso,id=cdrom,media=cdrom -device virtio-scsi-device -device scsi-cd,drive=cdrom -net nic -net user,hostfwd=tcp::2222-:22
4、启动环境
qemu-system-aarch64.exe -m 2048 -cpu cortex-a72 -smp 8,sockets=4,cores=2 -M virt -bios C:\D\openEuler\QEMU_EFI.fd -device VGA -device nec-usb-xhci -device usb-mouse -device usb-kbd -drive if=none,file=C:\D\openEuler\openEuler.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 -net nic -net user,hostfwd=tcp::2222-:22
以上方法qemu虚机使用NAT网络。
window下也可以使用TAP桥接网络,百度有~
linux环境:
2、创建虚拟存储
qemu-img create -f qcow2 openEuler.qcow2 40G
3、安装镜像
qemu-system-aarch64 -m 4096 -cpu cortex-a72 -smp 4 -M virt -bios QEMU_EFI.fd -nographic -drive if=none,file=openEuler-22.03-LTS-SP3-aarch64-dvd.iso,id=cdrom,media=cdrom -device virtio-scsi-device -device scsi-cd,drive=cdrom -drive if=none,file=openEuler-20.03-LTS.aarch64.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 -net nic -net user,hostfwd=tcp::2222-:22
4、启动系统
qemu-system-aarch64 -m 4096 -cpu cortex-a57 -smp 4 -M virt -bios QEMU_EFI.fd -nographic -device virtio-scsi-device -drive if=none,file=openEuler-20.03-LTS.aarch64.qcow2,index=0,id=hd0 -device virtio-blk-device,drive=hd0 -net nic -net user,hostfwd=tcp::2222-:22
以上方法qemu虚机使用NAT网络。
ps:使用TAP桥接网络
#!/bin/sh
ifconfig enp1s0 down
brctl addbr br0
brctl addif br0 enp1s0
brctl stp br0 off
brctl setfd br0 1
brctl sethello br0 1
ifconfig br0 0.0.0.0 promisc up
ifconfig enp1s0 0.0.0.0 promisc up
ifconfig br0 192.168.1.69 netmask 255.255.255.0
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.255
#route add -net default gw 192.168.1.255
tunctl -t tap0 -u root
brctl addif br0 tap0
ifconfig tap0 0.0.0.0 promisc up
qemu-system-aarch64 -m 4096 -cpu cortex-a57 -smp 4 -M virt -bios QEMU_EFI.fd -nographic -device virtio-scsi-device -drive if=none,file=openEuler-22.03-LTS-SP1-aarch64.qcow2,index=0,id=hd0 -device virtio-blk-device,drive=hd0 -net nic -net tap,ifname=tap0,script=no,downscript=no
参考: