4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Raspberry Pi :Emulate Raspberry Pi using QEMU

http://2017.pyconuk.org/static/img/sponsor-logos/raspberry-pi-foundation.png
#### What Will I Learn? This tutorial is all about how to emulate R-Pi on Linux.
  • You will learn how to emulate Raspberry-Pi on Linux.
  • You will learn what is QEMU and how to download it.

Requirements

  • Raspberry Pi running in Linux
  • Ubuntu Linux knowledge
  • Getting the Raspberry-Pi Image
  • Installing QEMU emulator
  • Compile or download a QEMU-Ready kernel of Raspberry-Pi

Difficulty

  • Intermediate

Tutorial Contents


Getting the Raspberry-Pi Image

You can simply download the latest Raspbian Wheezy distribution from RaspberryPi.org.

QEMU

QEMU is short term for Quick Emulator . It is generic and open source machine emulator and it is a free and open-source hosted hypervisor that performs hardware virtualization (not to be confused with hardware-assisted virtualization).

You need to install QEMU on your Linux.
On Ubuntu terminal do:

$sudo apt-get update && sudo apt-get install qemu-system-x86

To check the correct installation, do as follow:

$qemu-system-arm --version

Get things going…

  • So first of all create a working directory anywhere you like in your system.
  • Copy your newly downloaded Raspberry Pi image to current directory and unzip it.
  • Then rename it to rpi.img.

Download the QEMU-Ready R-Pi’s kernel

Download it from here
or you simply clone the git repository in the directory that you just created using the command below.

$git clone https://github.com/dhruvvyas90/qemu-rpi-kernel.git

Set-up Phase

  • If you have done everything correctly your working folder should contain these files and folders.

    image.png
  • you need to make a simple script to make it easier to start the emulator. Open up your favorite text editor and save the content below as a new file and name it config
qemu-system-arm -kernel ./qemu-rpi-kernel/kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -hda rpi.img
  • After saving the file, make sure you make it executable by the command below:
$chmod +x config
  • Now you are ready to start the raspberry pi in configuration mode. To do so, run the script you just created:
$./config
  • If you have done everything correctly you will be greeted by terminal prompt of Raspberry Pi:

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

8 upvotes $2.61

Replies (7)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: