Raspberry Pi Emulator for Windows 10
Intro: Raspberry Pi Emulator for Windows 10
In this article, you are going to learn how to run Raspbian on your Windows 10 PC.
If you really enjoy this article, consider checking out my TechWizTime YouTube Channel.
And for an awesome source of Raspberry Pi Accessories, check out my Raspberry Pi Amazon List.
Let’s get started!
STEP 1: What You'll Need
STEP 2: Download QEMU
Go to http://qemu.weilnetz.de/w32/
Select the 32-bit folder.
Click on the version with the most recent modify date.
When it downloads, use 7zip to extract it’s contents into a folder.
STEP 3: Download the Kernel
Go to https://github.com/dhruvvyas90/qemu-rpi-kernel
Select the most recent file.
Click on the “Download” at the left of “History”
After it downloads, place the file inside the folder where you extracted the QEMU.
STEP 4: Download Raspbian
Go to http://downloads.raspberrypi.org/
Click on “Downloads” Select “Raspbian”
Download the Pixel desktop version.
After it downloads, extract the contents on the same folder where you extracted QEMU.
STEP 5: Set Up the Emulator
Get inside the folder where you extracted Raspbian, QEMU and placed the Kernel.
Create a new text file and name it “start.bat”
Right click on it and press “Edit”
Type in “qemu-system-arm -kernel kernel-qemu-4.4.34-jessie -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” -redir tcp:2222::22″
Save the file and close it.
Type “cmd” on the address bar to start up the command prompt.
In the command prompt, type “start.bat”
Type in “sudo nano /etc/udev/rules.d/90-qemu.rules” Press “Enter” Type in “KERNEL==”sda”, SYMLINK+=”mmcblk0″ KERNEL==”sda?”, SYMLINK+=”mmcblk0p%n” KERNEL==”sda2″, SYMLINK+=”root””
Press “Ctrl X” “Y” “Enter”
Close the emulator.
Go to the “start.bat” file.
Delete the line “init=/bin/bash””
Save and close the file.
In the cmd, type in “qemu-img.exe resize 2017-03-02-raspbian-jessie.img +4G”
Press “Enter”
A small error will appear, but the resizing will take effect.
Type in “start.bat”
Press “Enter”
STEP 6: Optimize the Emulator
Once it loads, open up the Terminal.
Type in “sudo fdisk/dev/sda”
Press “Enter”
Type “P”
Press “Enter”
Type “D”
Press “Enter”
Type “2”
Press “Enter”
Type “N”
Press “Enter”
Type “P”
Press “Enter”
You’ll be asked for the first sector of the partition, type in the number you see on the first partition +1. IE: 20298 + 1 = 20299
Press “Enter”
When it ask for the last sector, press “Enter” to use the whole ammount of the image.
Type “W”
Press “Enter”
You’ll get a message stating that the creation of the partition failed, shut down the emulator for the changes to take effect.
In the cmd, start the emulator by starting the “start.bat” file.
Get inside the Terminal of Raspbian once it loads.
Type in “sudo resize2fs /dev/sda2”
Press “Enter”
A message will appear saying that the partition rezise was successful.
Type in “sudo nano /etc/dphys-swapfile”
Press “Enter”
Go down to where it says “conf_swapsize=100” and change the “100” to “1024”
Press “Ctrl X” “Y” and “Enter”
Type in “sudo /etc/init.d/dphys-swapfile stop”
Press “Enter”
Type in “sudo /etc/init.d/dphys-swapfile start”
Go to “Raspberry Pi Configuration”
Click on “Enabled”
Locate “SSH” and press “Enable”
Click on “Performance”
On “Overclock”, select “Tubo (1000GHz)”
EXTRA: You can go to Localization and select your country of residence or the country you prefer and then click on “Keyboard” to change your keyboard settings.
Press “OK” to save all of your changes.
Shut down the Emulator.
Open it again via cmd using the “start.bat”
If you turned on SSH, you’ll see a warning, click on “Yes”
Congratulations, you’ve just installed Raspbian on your Windows 10 PC via QEMU, configured it, optimized it and that’s it for this Instructable.
If you enjoy this Instructable, consider checking out my TechWizTime YouTube Channel.
And for a good source of Raspberry Pi products, check out my Raspberry Pi Amazon List.
28 Comments
AnisB15 2 years ago
qemu-system-arm ^
-M versatilepb ^
-cpu arm1176 ^
-m 256 ^
-drive "file=2021-05-07-raspios-buster-armhf-full.img,if=none,index=0,media=disk,format=raw,id=disk0" ^
-device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" ^
-net "user,hostfwd=tcp::5022-:22" ^
-dtb versatile-pb-buster-5.4.51.dtb ^
-kernel kernel-qemu-5.4.51-buster ^
-append "root=/dev/vda2 panic=1 rootfstype=ext4 rw init=/bin/bash" ^
-no-reboot
ahmedelswerkey 2 years ago
and then I saw your comment and it worked
can i use a bigger memory and higher cpu?
AnisB15 2 years ago
Check out https://github.com/dhruvvyas90/qemu-rpi-kernel/iss...
AnisB15 2 years ago
-append "root=/dev/vda2 panic=1" ^
And if SSH doesn't work, update the -net "user..." line as follows:
-net user,hostfwd=tcp::2222-:22 ^
-net nic ^
stephen.parish57 2 years ago
This, on the other hand is counterproductive. 4 separate downloads, a whole bunch of complicated command line instructions, and an end result that doesn't actually work, except for the Linux geek who wrote it. It just maintains the Raspberry Pi's reputation as a hard to use product for geeks only.
amihart 2 years ago
g-sanders 2 years ago
akhil_2524 3 years ago
virenghone37 3 years ago
sigowww 3 years ago
0799967 3 years ago
vOOda 5 years ago
PiGuy163 3 years ago
https://www.virtualbox.org/wiki/Downloads
download Raspberry Pi OS here (it has to be the PC/mac iso at the bottom):
https://www.raspberrypi.org/software/raspberry-pi-...
and create a virtual machine(guide here):
https://www.howtogeek.com/196060/beginner-geek-how...
and set the type to debian 64 bit
NikColAI 4 years ago
Thanks.
alfredlgophiri 3 years ago
rulet5 3 years ago
qemu-system-arm: warning: GdkPixbuf: Cannot open pixbuf loader module file 'C:\files1\qemu\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > C:\files1\qemu\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache
to make things work again for the time being.
WARNING: Image format was not specified for '2020-05-27-raspios-buster-full-armhf.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
dsound: Could not initialize DirectSoundCapture
dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID
Error: invalid dtb and unrecognized/unsupported machine ID
r1=0x00000183, r2=0x00000100
r2[]=05 00 00 00 01 00 41 54 01 00 00 00 00 10 00 00
Available machine support:
ID (hex) NAME
ffffffff Generic DT based system
ffffffff ARM-Versatile (Device Tree Support)
Please check your kernel config and/or bootloader.
C:\files1\qemu>
Lodbrok 5 years ago
After doing this part I get
"No filesystem could mount root, tried: ext4
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,2)"
Does anyone know how to get out of that hole, and even better, what to do instead?
VladivariusV 5 years ago
I needed to do this emulation so many times, I created a small program to do it in one click! I also thought that other people would find it useful so I put on a website for it. You can find it here:
http://www.rpi-emulator.com/
PavelS113 5 years ago
nerduw 5 years ago
Hey mate, your program is working fine for me. Thanks for that! Your next coffee is on me ;-). Cheers.
P.S.: Unfortunately, I wasn't able to use this instruction here with "2017-11-29-raspbian-stretch-lite.img". Only VladivariusV script did the trick.