Skip to content

I have tried to figure out a way to run raspberry pi using QEMU but could not. So here I am putting all the references I have pieced together that should just work out of the box.

Notifications You must be signed in to change notification settings

farabimahmud/emulate-raspberry-pi3-in-qemu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emulate Raspberry Pi 3 using QEMU in 64 bit

In this tutorial we will see how we can emulate Raspberry Pi 3 b using QEMU in linux environment. I have tried to piece together information from different repositories and assemble them together so it works right out of the box. Hope it helps.

Install QEMU 6.2 from source:

  1. Make sure you do not have QEMU preinstalled. Remove the existing installation if needed by executing the following -
$ sudo apt-get autoremove qemu*
  1. Download QEMU 6.2 from here -
$ wget https://download.qemu.org/qemu-6.2.0.tar.xz
  1. Decompress the source code for QEMU 6.2
$ tar xvJf qemu-6.2.0.tar.xz
  1. Install the prerequisites for QEMU 6.2 -
$ sudo apt-get install build-essential zlib1g-dev pkg-config libglib2.0-dev \
binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev \
python-capstone virtualenv ninja-build
  1. Change to qemu-6.2.0 directory
$ cd qemu-6.2.0
  1. Inside the qemu-6.2.0 directory, configure the build (default settings would work, but you can fix it as needed)
$ ./configure
  1. Make the build with any number of physical threads you have.
$ make -j8
  1. Add the build directory to the path in .bashrc file. Add the following line to the .bashrc file
export PATH=$PATH:<path-to-qemu-6.2.0/build>

Change <path-to-qemu-6.2.0/build> to appropriate value

  1. Restart the terminal or reload the environment by executing
$ source ~/.bashrc

Download Required Files:

For the next step you need to download the kernel, dtb and disk image and save them to any folder. You would also need to download the launch script.

  1. Launch Script: launch.sh

  2. Kernel: kernel8.img

  3. DTB: bcm2710-rpi-3-b-plus.dtb

  4. Disk Image (disk.img): You can use download either the .xz format or the .img format directly -

    a. disk.xz Archive .xz format (~833MB) need to decompress using ($ tar xvJf disk.xz)

    b. disk.img Decompressed .img format (~4G)

Execute Launch Script:

Once you are done downloading, put all the files in the same directory and you should be able to execute the launch.sh without any trouble. When prompted, the id and the password for default account -

Username: pi
Password: raspberry

If you did this successfully you should be able to see this - Success!

References:

These are the references used for executing the script. However, you might need to modify the files directly obtained from these sources.

About

I have tried to figure out a way to run raspberry pi using QEMU but could not. So here I am putting all the references I have pieced together that should just work out of the box.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages