Sharra Mae avatar

Raspberry Pi :Emulate Raspberry Pi using QEMU

athenamae

Published: 12 Feb 2018 › Updated: 12 Feb 2018Raspberry Pi :Emulate Raspberry Pi using QEMU

Raspberry Pi :Emulate Raspberry Pi using QEMU

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

Leave Raspberry Pi :Emulate Raspberry Pi using QEMU to:

Written by

My greatest joy in life is to experience all. The good, the bad, the ugly, the beautiful, the crazy, the sane, the bitter, the sweet…

Read more #utopian-io posts


Best Posts From Sharra Mae

We have not curated any of athenamae's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Sharra Mae