Skip to content

Instantly share code, notes, and snippets.

@jeremyblow
Forked from blast-hardcheese/gist:5623703
Created June 8, 2013 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyblow/5733394 to your computer and use it in GitHub Desktop.
Save jeremyblow/5733394 to your computer and use it in GitHub Desktop.
Sources:
- http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
- http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=22975
- http://www.thomaskho.com/blog/2006/02/qemu-and-the-network-bridge/
- http://toast.djw.org.uk/qemu.html
- http://wiki.debian.org/QEMU#Host_and_guests_on_same_network
Files needed:
- http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip.torrent
- http://xecdesign.com/downloads/linux-qemu/kernel-qemu
Filesystem:
unzip 2013-02-09-wheezy-raspbian.zip
getpartoffset() { BLOCKS=$(fdisk -l $1 | grep ${1}${2} | sed -e 's/\s\+/ /g' | cut -d ' ' -f 2); echo $((BLOCKS*512)); }
getpartoffset 2013-02-09-wheezy-raspbian.img 2
mkdir loopback
sudo mount -o loop,offset=${OFFSET_FROM_EARLIER} loopback
sudo sed -i 's/^\([^#]\)/#\1/' loopback/etc/ld.so.preload
sudo sed -i 's/mmcblk0p/sda/' loopback/etc/fstab
sudo umount loopback
Networking:
tunctl -u $USER -t tap0
brctl addbr br0
brctl addif br0 tap0
Arguments:
qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb \
-no-reboot -append "root=/dev/sda2 panic=1" \
-hda 2013-02-09-wheezy-raspbian.img \
-net nic,vlan=0 -net tap,ifname=tap0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment