Open tzhao95 opened 7 years ago
The Raspbian Image (ARM Processor) https://www.raspberrypi.org/downloads/raspbian/
Alternative Debian Solution (Raspbian is based off of Debian), Not ideal as it does not emulate the processor. https://grantwinney.com/how-to-create-a-raspberry-pi-virtual-machine-vm-in-virtualbox/
Beginning with QEMU Solution proposed by bainss commented on Apr 7
Emulation is a success with the exception of the ssh. It seems others are experiencing a similar problem on the thread.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && brew update && brew install qemu
export QEMU=$(which qemu-system-arm)
curl -OL https://github.com/dhruvvyas90/qemu-rpi-kernel/raw/master/kernel-qemu-4.4.34-jessie
export RPI_KERNEL=./kernel-qemu-4.4.34-jessie
curl -o 2017-03-02-raspbian-jessie.zip -L http://downloads.raspberrypi.org/raspbian/images/raspbian-2017-03-03/2017-03-02-raspbian-jessie.zip
unzip 2017-03-02-raspbian-jessie.zip
export RPI_FS=./2017-03-02-raspbian-jessie.zip
$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" -drive "file=2017-03-02-raspbian-jessie.img,index=0,media=disk,format=raw"
sed -i -e 's/^/#/' /etc/ld.so.preload sed -i -e 's/^/#/' /etc/ld.so.conf sed -i -e 's/^/#/' /etc/fstab
$QEMU -kernel $RPI_KERNEL -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive "file=2017-03-02-raspbian-jessie.img,index=0,media=disk,format=raw" -net user,hostfwd=tcp::5022-:22
ssh -p 5022 pi@localhost
It didn't work! Will try another method
Develop or find a way to test code designed for a Raspberry Pi on a PC or Mac. This essentially will allow us to test our code without needing to plug it into the raspberry pi. Awkward thing about this is we are basically trying to use one computer to pretend to be a different computer.