Ubuntu下运行QEMU模拟riscv64跑Debian

1.安装QEMU

下载地址:

https://www.qemu.org/download/

建议选择稳定版本,下载后解压,然后make

wget https://download.qemu.org/qemu-8.0.3.tar.xz

tar xjvf qemu-8.0.3.tar.xz

cd qemu-8.0.3

./configure --enable-kvm --enable-virtfs

make

--enable-virtfs 用户虚拟机和宿主机之间共享文件

2.安装u-boot-qemu

sudo apt install u-boot-qemu

3.下载Debian的riscv64 image

下载地址:https://cdn.artifacts.gitlab-static.net/9d/f6/9df69d693033f3071b9dee279b40dead9517d1ec9a95eb4bf3404e5d8767b683/@final/4c/40/b1a5e7823e522f8e18d15a30458eb6bf7a81b06fb4e5d1446abf0a994e8a?Expires=1693379985&KeyName=gprd-artifacts-cdn&Signature=v7OlQeXqgcjDlFjmMu38g7wZ2S4=

下载后解压,得到 image.qcow2

4.启动Qemu

qemu-system-riscv64 -machine virt -cpu rv64 -m 8G -smp 4 -nographic \

-append "console=ttyS0 rw root=/dev/vda1" \

-device virtio-blk-device,drive=hd \

-drive file=imge.qcow2,if=none,id=hd \

-device virtio-net-device,netdev=net \

-netdev user,id=net,hostfwd=tcp::2222-:22 \

-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \

-object rng-random,filename=/dev/urandom,id=rng \

-device virtio-rng-device,rng=rng \

-virtfs local,path=~/shared,mount_tag=host0,security_model=passthrough,id=host0

5.访问Debian

可直接在Qemu上登录,账号密码是 root : root

相关推荐
努力成为一个程序猿.14 小时前
Clickhouse数据副本和分片
运维·clickhouse·debian
矜辰所致1 天前
沁恒 RISC-V 蓝牙芯片 Flash 分区管理及操作
risc-v·flash·flash读写·ch585·蓝牙 ble
矜辰所致1 天前
沁恒微 RISC-V 蓝牙芯片低功耗测试
低功耗·risc-v·ble 蓝牙·蓝牙低功耗·沁恒微蓝牙
易·木1 天前
阅读 RISC-V 手册
risc-v
南林yan5 天前
Debian系统的多内核共存
linux·debian·linux内核
闪耀星星5 天前
debian elctron-builder
运维·debian
会飞的土拨鼠呀5 天前
Debian 12 笔记本合盖不休眠设置指南
运维·debian
矜辰所致6 天前
CH585 高速 USB模拟 CDC串口应用示例
沁恒微·risc-v·usb·cdc串口·usb 模拟串口
ejinxian7 天前
Linux 虚拟化技术 KVM/ESXI/Docker
linux·运维·docker·qemu·openvz
John Song8 天前
用zookpeer搭建Hadoop的HA集群,组件启动的启动顺序是什么?
大数据·hadoop·debian