尝试qemu仿真VisionFive2 OpenKylin系统
VisionFive2
从这里下载:openKylin开源操作系统
unxz解压:
unxz openKylin-Embedded-V2.0-SP1-visionfive2-riscv64.img.xz
我是解压到这个目录:/mnt/e/360Downloads
然后在这个目录里,执行:
启动
qemu-system-riscv64 \-machine spike \-cpu rv64 \-m 2048M \-drive file=openKylin-Embedded-V2.0-SP1-visionfive2-riscv64.img,format=raw \-netdev user,id=net0,hostfwd=tcp::10022-:22 \-device virtio-net-device,netdev=net0 \-append "root=/dev/vda rw console=ttyS0"qemu-system-riscv64 \-machine spike \-cpu rv64 \-m 2048M \-drive if=none,id=rootfs,format=raw,file=openKylin-Embedded-V2.0-SP1-visionfive2-riscv64.img \-device virtio-blk-device,drive=rootfs \-netdev user,id=net0,hostfwd=tcp::8022-:22 \-device virtio-net-device,netdev=net0-machine spike -cpu rv64
换成这个:
qemu-system-riscv64 \-machine virt \-cpu rv64 \-m 2048M \-drive if=none,id=rootfs,format=raw,file=openKylin-Embedded-V2.0-SP1-visionfive2-riscv64.img \-device virtio-blk-device,drive=rootfs \-netdev user,id=net0,hostfwd=tcp::8022-:22 \-device virtio-net-device,netdev=net0
执行完之后,显示:
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
NVD3D10: CPU cyclestats are disabled on client virtualization
NVD3D10: CPU cyclestats are disabled on client virtualization
同时打开了qemu monitor窗口:
QEMU 8.2.2 monitor - type 'help' for more information
(qemu)
下一步该怎么做呢?请在留言区留言。
调试
启动后报错:
qemu-system-riscv64: -append only allowed with -kernel option
gpt说:
在 QEMU 中,如果你使用 -append
选项,那么你需要同时使用 -kernel
选项来指定要运行的内核镜像。然而,通常情况下,Kylin 镜像文件(如 openKylin-Embedded-V2.0-SP1-visionfive2-riscv64.img
)已经包含了内核、文件系统等,因此你不需要单独指定一个内核。
如果你的镜像文件是一个完整的、可引导的文件系统,你应该在启动时不使用 -append
选项。请尝试以下命令来启动 QEMU,不使用该选项:
启动后,ssh无法登录,怎么回事?
skywalk@DESKTOP-9C5AU01:~$ ssh -p 8022 root@localhost
kylin
kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 8022
启动后,报错没有virtio-bus,
换成
qemu-system-riscv64 \-machine virt \-cpu rv64 \-m 2048M \-drive if=none,id=rootfs,format=raw,file=openKylin-Embedded-V2.0-SP1-visionfive2-riscv64.img \-device virtio-blk-device,drive=rootfs \-netdev user,id=net0,hostfwd=tcp::8022-:22 \-device virtio-net-device,netdev=net0