-
Star
(316)
You must be signed in to star a gist -
Fork
(52)
You must be signed in to fork a gist
-
-
Save hfreire/5846b7aa4ac9209699ba to your computer and use it in GitHub Desktop.
# Install QEMU OSX port with ARM support | |
sudo port install qemu +target_arm | |
export QEMU=$(which qemu-system-arm) | |
# Dowload kernel and export location | |
curl -OL \ | |
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie | |
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie | |
# Download filesystem and export location | |
curl -o 2015-11-21-raspbian-jessie.zip \ | |
-L http://downloads.raspberrypi.org/raspbian/images/raspbian-2015-11-24/2015-11-21-raspbian-jessie.zip | |
unzip 2015-11-21-raspbian-jessie.zip | |
export RPI_FS=./2015-11-21-raspbian-jessie.img | |
# Tweak filesystem: start qemu with init flag, switch to guest window to execute tweak and close window afterwards | |
$QEMU -kernel $RPI_KERNEL \ | |
-cpu arm1176 -m 256 \ | |
-M versatilepb -no-reboot -serial stdio \ | |
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \ | |
-hda $RPI_FS | |
sed -i -e 's/^/#/' /etc/ld.so.conf | |
sed -i -e 's/^/#/' /etc/fstab | |
# Emulate Raspberry Pi | |
$QEMU -kernel $RPI_KERNEL \ | |
-cpu arm1176 -m 256 \ | |
-M versatilepb -no-reboot -serial stdio \ | |
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" \ | |
-hda $RPI_FS \ | |
-redir tcp:5022::22 | |
# Login to Raspberry Pi | |
ssh -p 5022 pi@localhost | |
# Referenced from OSX raspberry pi emulation via QEMU - https://gist.github.com/JasonGhent/e7deab904b30cbc08a7d | |
# Referenced from Emulating Jessie image with 4.1.7 kernel - https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki/Emulating-Jessie-image-with-4.1.7-kernel |
When runnung QEMU I'm getting this error:
qemu-system-arm: arm1176: Could not open 'arm1176': No such file or directory
Searching around hasn't really yielded anything. Perhaps someone ran into something similar?
What command did you run?
Sorry, I thought I had pasted it in my first reply:
$QEMU -kernel $RPI_KERNEL \
-cpu arm1176 \
-m 256 \
-M versatilepb \
-no-reboot \
-serial stdio \
-append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" \
-hda $RPI_FS
The only difference between the original is I installed QEMU via homebrew and I'm wondering if there was an option I needed to pass that I missed. The ARM QEMU binaries exist - it's just complaining about the CPU. I tried substituting it with a few different ARM CPUs and they all resulted in the same error.
Ok, turns out a fresh reinstall of QEMU was needed (thanks brew
). Running the same command now results in the QEMU GUI opening up but the screen is black and there's no output being redirected to my local console. It appears -serial stdio
should redirect to my local session, but nothing is output and it's unresponsive to any input.
Any idea on what to look at?
Ok, turns out a fresh reinstall of QEMU was needed (thanks
brew
). Running the same command now results in the QEMU GUI opening up but the screen is black and there's no output being redirected to my local console. It appears-serial stdio
should redirect to my local session, but nothing is output and it's unresponsive to any input.Any idea on what to look at?
Yeah, same goes for me, but I think you should wait more. (I do not recall if I used this method or another method)
When runnung QEMU I'm getting this error:
Searching around hasn't really yielded anything. Perhaps someone ran into something similar?