Last active
October 22, 2020 14:52
-
-
Save rossja/caf9b639aec1ebce6f227096e3bead38 to your computer and use it in GitHub Desktop.
QEMU Raspberry Pi 2 Emulation on Mac OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# tested on Max OS X 10.13.2 "High Sierra" | |
# install qemu using: `brew install qemu` | |
# get kernel from: https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.4.34-jessie?raw=true | |
# get raspbian image from: http://downloads.raspberrypi.org/raspbian_latest | |
qemu-system-arm \ | |
-kernel kernel-qemu-4.4.34-jessie \ | |
-cpu arm1176 \ | |
-m 256 \ | |
-machine versatilepb \ | |
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" \ | |
-drive "file=./2017-11-29-raspbian-stretch.img,index=0,media=disk,format=raw" \ | |
-no-reboot \ | |
-serial stdio \ | |
-curses \ | |
-device e1000,netdev=user.0 \ | |
-netdev user,id=user.0,hostfwd=tcp::2222-:22 | |
# note the last line redirects ssh on the emulated raspi to localhost:2222 |
Wondering if some of the Catalina+ changes may be getting in the way here? I'll run some tests tomorrow and update with what I find.
yep. looks like this is a combination of Catalina and newer raspi images. Looks like the place I ref'd for the kernel image has this working in a much better format: https://github.com/dhruvvyas90/qemu-rpi-kernel/ (and they link to a docker image, also).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey!
Thanks for this but I don't think it work!
After running the command I see on qemu:
Uncompressing Linux... done, booting the kernel.
Then, I am trying to connect with the user pi to localhost using port 2222 and it doesn't work. Looking with netcat it says:
nc: connectx to localhost port 2222 (tcp) failed: Connection refused
Connection to localhost port 2222 [tcp/rockwell-csp2] succeeded!
Back to ssh, after long time waiting I'mg getting the error:
Can you help me and tell what am I doing wrong?