摘要
本文記錄以Ubuntu上的QEMU虛擬化軟體來操縱預裝之樹莓派(Raspberry Pi)使用的Linux作業系統Raspbian映像檔的注意事項。
本文
以QEMU虛擬化軟體來操縱預裝之樹莓派使用的作業系統的說明可以參照這裡,隨後專注於Ubuntu 24.04上的QEMU執行步驟,其中搭配了這裡預先建構完畢的映象檔。
1. 安裝QEMU套件。
sudo apt-get update
sudo apt-get install qemu-system
2. 下載適用於QEMU的Linux核心與設備樹。
git clone https://github.com/dhruvvyas90/qemu-rpi-kernel.git
3. 在終端機上鍵入下列指令,以載入核心、設備樹、以及對應的映象檔。
sudo qemu-system-arm \
-machine versatilepb \
-cpu arm1176 \
-m 256 \
-dtb ./qemu-rpi-kernel/versatile-pb-buster.dtb \
-kernel ./qemu-rpi-kernel/kernel-qemu-4.19.50-buster \
-append 'root=/dev/sda2 panic=1 rootfstype=ext4 rw' \
-no-reboot \
-serial stdio \
-net nic \
-net user,hostfwd=tcp::5022-:22 \
-net tap,ifname=vnet0,script=no,downscript=no \
-drive format=raw,file=./image_2025-02-23-leo-raspbian/2025-02-23-leo-raspbian.img
操作畫面如下所示。
完成。
參考文獻
https://engineer-leo.blogspot.com/2014/12/qemuraspbian.html
https://engineer-leo.blogspot.com/2025/02/rpi3-camera-1-3-waveshare-pan-tilt-hat-2020-02-13-raspbian-buster-pi-gen.html
https://github.com/dhruvvyas90/qemu-rpi-kernel
https://superuser.com/questions/1535589/qemu-emulating-a-raspberry-pi-doesnt-have-internet-capability
沒有留言:
不接受新意見。