@white
This is my command line to emulate a Raspberry Pi 3b with qemu on macOS Sonoma:
qemu-system-aarch64 -M raspi3b -cpu cortex-a72 -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -dtb bcm2710-rpi-3-b-plus.dtb -sd 2023-05-03-raspios-bullseye-arm64.img -kernel kernel8.img -m 1G -serial stdio -smp 4 -usb -device usb-mouse -device usb-kbd -device usb-net,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22
What I did:
1) Installed qemu 8.1.X via "brew install qemu" in Terminal
2) Downloaded the 2023-05-03-raspios-bullseye-arm64.img from
https://downloads.raspberrypi.com/rasp ... ios-bullseye-arm64.img.xzThis package needs to be unzipped.
3) You need to resize the image to an appropriate size (for example qemu-image resize 2023-05-03-raspios-bullseye-arm64.img 32G), the size must be a power of 2), you need to tell the raspi to use the full "disk"-size via raspi-config, when I remember correctly.
4) You need the kernels, take them from here
https://github.com/dhruvvyas90/qemu-rp ... ter/native-emulation/dtbs and here
https://github.com/dhruvvyas90/qemu-rp ... mulation/5.4.51%20kernelsCommunication between host and emulated raspberry pi is possible via ssh / sftp, just use port 5555, it gets forwarded to port 22 on the "pi" (example: ssh -p pi@localhost:5555), so you can exchange files easily. Just make sure that ssh is enabled via raspi-config.
So you want to use this emulation to set up some kind of "browserservice"? Maybe you take a look at Selenium Webdriver, which uses Chromium on the pi to do some web scraping. Did this some weeks ago, but to figure out how it's working caused me headaches. You need a debian chromium for arm64 package and the debian chromium-webdriver package for arm64, make sure both versions are the same (this is important, otherwise selenium won't work). Install them with apt and make sure both packages won't updated automatically via apt. I used selenium web driver with python 3.11 on my emulated pi, in headless mode, because qemu only allows 1G of memory.
Maybe this helps a little.
Edit:
Some screenhots of my QEMU-"Pi":
https://www.dropbox.com/scl/fi/cebb9xd ... jxyf8bo7f72yf7zi4zxt&dl=0https://www.dropbox.com/scl/fi/xwfrxl3 ... g4q0se8xor1o3xtp53an&dl=0
Edited by miggymac on 2023/10/31 12:46:48
Edited by miggymac on 2023/10/31 12:50:28
Edited by miggymac on 2023/10/31 12:52:25