Raspberry Pi Emulator for Windows 10   Full Setup Tutorial and Speed Optimization

Raspberry Pi Emulator for Windows 10 Full Setup Tutorial and Speed Optimization

Some of us are just born curious Lemme think here for a scond, so, you don’t own a Raspberry Pi, but you want to get the experience of a Raspberry Pi But on a Windows 10 machine, I might be able to help you out Stick around, because you know what time it is Hey guys Jonathan here with TechWizTime, where I teach you technology through tutorials And today I’m gonna be teaching you how you can set up Raspbian on a PC, in this case a Windows 10 PC, and make it work like a Raspberry Pi would What would you want to do with that, well… There are lots of reasons really, like Just to test out software, test how it actually works, see if you can configure anything, you might wanna write some scripts to make things work easier within Raspbian Really, the list goes on and I’m sure if you leave me a comment down below and let me know your ideas on what you could do with this I might even make it into a video later down the track But before we go any further make sure you like and share this video with your friends because sharing really is caring And it helps this channel to grow and it helps more than you would actually know It’s like you’re donating a dollar every time you share this video So with that little bit of a plug out of the way, let’s jump over tot eh computer and we’ll see how we can get Raspbian set up, on a Windows 10 machine Okay so before we get started, there’s a couple of things that you will need, and that is a Windows 10 machine, because that’s what I’m doing this tutorial on You might be able to do this with a Windows 8 machine or Windoes 7, but this particular tutorial is using Windows 10 And we’re going to need a few pieces of sofware, and one of the first ones is from “QEMU”, and the website is “qemu.weilnetz.de”, the link for this is down in the description below So once you get tot his website you need to go into the “wind-32” folder ow “w-32” folder I should say I would recommend using the 32-bit version over the 64-bit version as a lot of people have reported problems using the 64-bit version, so, just to be safe, I’m going to do the 32-bit version with this tutorial So once you get to the 32-bit page, what you’ll need to do is look through the list there and down the bottom should be where the latest version is And you can see that by “last modified” “2017-04-05” So click on that link and download it The next step is that we need a kernel to use with qemu So I’ll leave the link to this down in the description below, but what I would recommend is downloading the latest one there, which is 4.4.34 So all you need to do is you need to click on the link and once you get to this page here Next to the button “History”, just click on “Download” This will download just that file and that’s all we need for this moment And the last thing we’ll need for this project to work is we’ll need the latest vesion of Raspbian So you need to go to “raspberrypi.org”, once you’re at that website you go to the “Downloads” button up the top, and here you’ll be presented with a couple of options, “NOOBS” and Raspbian, so we wanna click on Raspbian Once that page loads up you’ll see two versions of Raspbian there You can use the Lite version if you don’t mind working through the command line, but in this circumstance, we’re going to show up working with the pixel desktop So, we download the zip file and go from there Now over yo our downloads folder you’ll see we’ve got all the that we’ve downloaded And, the first thing that we’re gonna do is we’re going to extract qemu, now, we can do that in one of two way, we can actually launch the executable file, or if you have a program like 7zip installed, you can simply extract that to it’s own folder like I’ve done here And to keep things simple, what I’m gonna do is I’m going to rename the folder to just “qemu” The next thing we’re going to do is we’re going to extract the latest version of Raspbian to that folder, so, again 7zip is the tool you will use here And lastly what we’ll do once that has been extracted to the folder is we’ll copy the kernel across to the qemu folder aswell So jumping inside the qemu folder now we can see that the image for Raspbian is in there as well as the kernel, and a whole bunch of other files And we’re gonna try and keep this as simple as possible so you can just get it up and running So what we’re going to do in this folder is we’re going to right click in a blank space and we’re going to create a new text file and we’re going to reme this to “start.bat” Now in my particular circumstance I have the file extensions turned on, if you don’t, you will have to do this And to do that you do it thru the “View” menu and there should be a little tickbox there that says “Filename Extensions” So now that we’ve created our “start.bat” file what we’ll do is we’ll right click on that and go to edit And to save some time what I’ve done is I’ve actually Pasted this long string in there and this is going to be the thing that launches qemu correctly Now to explain it a little bit what it does it starts up the qemu in the “arm” system it launches the kernel which I’ve got linked after “-kernel”, you’ll need to change this on yours especially if this tutorial is outdated We’ve got the cpu type which is “arm1176” Now “-m 256” is how much memory is able to be used With the qemu system, now Unfortunately that’s one of the limitations with qemu is that it will only allow you to use a maximum of 256 megabytes of memory, but I’m going to show you a little trick which will give you a little bit more memory than that So the rest of the information there is just to get things up and running One of the lines we will take out after our initial boot but i’ll show you how to do that as well And we also pointed to the actual raspbian file Which you can see there after dashdrive Again, if there is a newer version of Raspbian you will have to change this to suit your version So this string is down in the description below or via my website If you’d like to see the written tutorial So we just saved that and then we’ll go back into the folder And if you’re looking at a screen similar to mine right now you’ll see the address bar up there with “downloads/qmu” This is a really good shortcut, all you need to do is click into there And type CMD and this will launch the command prompt From this folder so once we’ve got the command prompt up and running all we need to do is type in “start.bat” And this will start up the qemu system One of the things that will probably come up is the windows security alert and you can just hit “Allow Access” this means that we can access the Raspbian system via SSH if we need to Now after the initial launch it is going to come up with a couple of errors and this is expected so what we’re going to do is we’re going to type some things in here now Which is going to fix that so what you need to type in is “sudo nano /etc/udev/rules.d/90-qemu.rules” What this does is starts up a new text file that we can edit that will give it some rules that will make it boot properly next time it runs Now this has just got to do with partitions and so forth telling it how to make it work properly It’s something that needs to be in there it’s it’s to do with symbolic links but I won’t go into it in too much detail just know that if you don’t have this in here it won’t work properly So I’ve provided these links of code on my website as well Through the written tutorial But they are also on the screen right now so either way you’ve got the information there, so once you’ve done that all you need to do is press “Ctrl X” “Y” and “Enter” This will save and then what we can do is we can restart, now I’ve had an issue where it doesn’t actually reboot properly so you can just close it down and then start it back up again But this time what we’re going to do is we’re going to edit the start bat file again So you right click on that and hit edit And then what you need to do is you need to go to after “rw” And you need to remove the “init=/bin/bash” line” This stops the qemu emulator from going straight to the command line or the bash prompt, go file save and we need to do one other thing now in the command prompt inside of Windows and that is to give our image a little bit more space to work with So all we need to type in here is “qemu-img.exe resize 2017-03-02-raspbian-jessie.img” plus how much space you want to increase this by, so, in this circumstance I’m only going to give it an extra 4 gigabytes that you could do 10 gigabytes you could do anything that you want All you need to do is type is a number so in this circumstance “+4G” will give us an extra 4 gigabytes So before I run this command what I’ll do is I’ll show you the before And now I’ll run it And it will come back with this message and it looks like “Oh no something went wrong”, but It has resized and it does says there “Image Resized” So now when we go back into the folder you can see there now is eight gigabytes so it has definitely worked So now that we’ve resized it we’ll do “start.bat” again And this will start the boot process now just be aware this is going to take a little while Due to a couple of factors one is that this is only emulating a Raspberry Pi 1 so that’s a single core 700 megahertz CPU And it only has 256 megabytes of RAM so this is not a Raspberry Pi 3 and it won’t be Raspberry Pi 3 Speeds by any standard So you are going to have to wait a little while I’ll put a little counter you are going to have to wait a little while but one of the things that i’m going to show you with this tutorial is how to speed this up just a little bit Through a couple of techniques The first thing we’ll do is now that you can see the pixel desktop there and it looks just like it would on a Raspberry Pi But the first thing we need to do is we need to go to the terminal so to do that we just click on the black icon at the top and what we’re going to do here is we’re going to expand the file system So we need to type in “sudo fdisk /div/sdi” And now the first thing we’ll do is we’ll type in P and this will list out the partitions and their sizes Now this is going to be important so you don’t skip this step Now the next thing we’re going to do is we’re going to delete one of these partitions and that is the second one, “SDA2” So we’re going to type in D, “Enter”, we’re going to select the partition number now you have to be really careful here you need to type in “2” And then press “Enter” Now this will tell us that the partition 2 has been deleted So the next thing we’re going to do is we’re going to create a new partition, so to do that we type in “N” and press “Enter” And we’re given two choices here we’re going to put in “P” for primary And “Enter” And the petition number is going to be “2” and “Enter” now this is where it’s important you’ll see it asked for the first sector Now this is the start sector of SDA2, which is listed up above Which in my case was 137216 And when it comes up to the last sector we just hit “Enter” and that will Allocate the whole amount of the image Now to commit these changes what we need to do is we need to type in “W” and press “Enter” This will write the changes And it will give us a red message in there saying that it failed and so forth but that’s only because we need to reboot before it will allocate it properly So again we need to shut this down and then start back up again with the “start.bat” file And once that does load up what we’ll do is we’ll go back into the terminal again And this time we’re going to resize the SDA to partition so we’ll type in “sudo resize2fs /dev/sda2” and press “Enter” This will take a little bit and then it will come back and it will say that it is resized So the next step is I’m going to show you how to increase the “swapfile” size which will in essence give you more memory to play with So to do that we type in “sudo nano /etc/dephys/swapfile” And press “Enter” And now what we need to do is we need to go down to where it says “conf_swapsize=100” And we’re going to change that to 1024 Which in essence will give us one gigabyte of swap file size Once we’ve changed that we just press “Ctrl X” “Y” and “Enter” And to make this take effect now what we’ll do is we’ll stop the swap file and we’ll start it back up again so to do that we just type in “sudo /etc/init.d/dephys-swapfile stop” So once that stops we do exactly the same but instead of stop we put in start This will take a little bit but once it gets back to the command line again or the bash prompt this will take a little while but once it gets back to the prompt we can check if that works by typing in “free /m” and you can see there the swap now is 1023 so we’ve got a little bit of extra memory there in the form of a swap file that we can work with Okay so once we’ve done all that now what we can do is we can go to the Raspbian menu Go down to preferences and go to “Raspberry Pi configuration” And here we can change some of the settings like keyboard location and also enable SSH and so forth so We’ll go through and quickly show you how to do that now So under the interfaces tab if you put a dot next to enabled this will enable SSH this could be handy for those people that want to just SSH into it to Have a play around with command line codes and get in behind the scenes without actually using the qemu software you still need to have it boot it up but it does run a little bit faster Next we can go into performance now this is a little trickier that we can use use to actually make it a little bit faster so what we’re going to do is we’re going to set it to “Turbo (1000 megahertz” Again this will give us that little bit of an extra speed boost which we wouldn’t normally see from a Raspberry Pi 1 And finally onto location what we can do is we can set the locale here so where it says country we can change it from Great Britain to US or whichever corresponding country you’re from And then press “OK” This will take a little while while it sets the locale but once it’s done we can change the keyboard there you can see here I can change it from the United Kingdom to the United States so once we’re done with that we can press “OK” and again, shut down our qemu and start it back up again with “start.bat” To make sure all those changes have gone into effect so when you start up if you have enabled SSH It will come up with the error message saying that it is a security risk But now as an added bonus I’ll show you that you can log in via “Putty” as I’ve done here and you can actually access the qemu Raspbian via SSH on the same Windows PC and it’s going to run a little bit faster Now this is as good as I could get it to run myself but with the community’s help, you guys out there we might actually be able to get this to run a little bit faster a little bit smoother, so if you have the time and you want to try different things then let us know down in the comments on this video whether or not you got it to run a little bit smoother by using different commands or maybe there’s something you could do to actually increase the resolution on this I did give it a shot but I didn’t have enough time to actually go too deep into it so if you can figure out how to make the resolution better that’s going to help out everyone that watches this video so make sure you leave a comment down below And if it does work then I’ll leave it in the description and of course give you credit for it So now that wasn’t that hard was it? Now you’ve got Raspbian to do whatever you want with on your Windows 10 machine and it’s at your call You don’t even need to own a Raspberry Pi it’s just there, how awesome is that? Is there something that I missed in this video or is there a tutorial that you’d like me to do? Leave me a comment down below and let me know so i can know what to do for you in the future If you’re not one of my thousands of subscribers already then make sure you do subscribe because I release two new videos every week and it comes straight to you especially if you hit that little bell icon C’mon, hit it now, please Thanks again, and as always Imagine, Learn, Create *sneeze*

100 thoughts on “Raspberry Pi Emulator for Windows 10 Full Setup Tutorial and Speed Optimization”

  1. entering the command "sudo nano/etc/udev/…………"

    gives me the following message and does not start another screen.
    sudo: unable to resolve host (none)
    suso: nano/etc/udev/rules.d/90-rules: command not found
    [email protected](none):/#

  2. Thanks for the tutorial. Really good.
    Could you take a look at the raspberrypi.org.
    seems like there is now a desktopversion of rasbian … will it do the same?
    I would like to emulate on my pc and try installian openhab for homeautomation I want to set up.
    I will have to connect at least an rfxcom in order to get my blinds to work.
    Will that be possible or am I totally wrong?

  3. Grab a Raspberry Pi 4 Kit on Amazon ► https://geni.us/diopK5 or eBay ► https://geni.us/UE59

    AMAZON 2GB KIT ► https://amzn.to/2Xyp5IZ or AMAZON 1GB KIT ► https://amzn.to/2YEQm9i

    Or, click Read more under this for other PI ESSENTIALS below!

    ★ ★ Micro HDMI to HDMI Cable ★ ★

    AMAZON ► https://geni.us/uAytFX

    EBAY ► https://geni.us/8VF2

    ★ ★ 5V 3A Type-C Power ★ ★

    AMAZON ► https://geni.us/iXBQP

    EBAY ► https://geni.us/KHZEsa7

    ★ ★ Wireless Keyboard & Mouse ★ ★

    Amazon ► https://geni.us/xa0O

    eBay ► https://geni.us/vnl9i

    ★ ★ 8BitDo Controllers & Gamepads ★ ★

    Amazon ► https://geni.us/2E9IZF

    eBay ► https://geni.us/GaTr

    ★ ★ Kingston USB 3 Reader ★ ★

    Amazon ► https://geni.us/UltUPy

    eBay ► https://geni.us/7OGxZ

    ★ ★ Samsung Micro SD Memory Cards ★ ★

    Amazon ► https://geni.us/hTOi

    eBay ► https://geni.us/PcGu

  4. The readable tutorial he was talking about is here:

  5. Wonderfull "How to". I use more Virtual Box to another things but Qemu it's unbelive! Thanks a lot to Raspberry into PC

  6. Since April they now have different versions and conflicting options. IE, instead of Raspbian with Debian Jessie, they now have "Image with desktop based on Debian Stretch". If I go to the link below that for Raspberry Pi Desktop, it is for "The Raspberry Pi Desktop OS for PC and Mac – based on Debian Jessie"

  7. qemu-system-arm: -redir tcp:2222::22: The -redir option is deprecated. Please use '-netdev user,hostfwd=…' instead. Uncompressing Linux… done, booting the kernel.

  8. I tried but the error prompts:

    qemu>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-11-29-raspbian-jessie.img,index=0,media=disk,format=raw" -redir tcp:2222::22
    qemu-system-arm: -redir tcp:2222::22: The -redir option is deprecated. Please use '-netdev user,hostfwd=…' instead.
    qemu-system-arm: -drive file=2017-11-29-raspbian-jessie.img,index=0,media=disk,format=raw: Could not open '2017-11-29-raspbian-jessie.img': The system cannot find the file specified.

  9. I lost interest when 32 bit Windows was recommended just "becasue some people reported problems with the 64 bit one". Mate, if you aren't technical, do some other YouTube sh*t, don't mess with things you don't understand well..

  10. Dear thank you very much for your time, could you please, do a tutorial to emulate retropie, what happens is that some of the problems when downloading images, is that you do not know if when recording the image in the SD, the SD is bad or the retropie image is bad too, and to modify it must re-record the image and it takes a long time, hopefully help us from now thank you very much.

  11. during creating partition,after creating partition 2 and remaining as partition it shows message as "partition #2 contains ext4 signature."
    Do you want to remove signature ([Y]es/[N]o)

    What to do?…

  12. Dude you really need to go a little more in depth when providing material like this. Watching this video really didn't help me at all..

  13. Great video!
    I need a help tho…
    After creating partition 2 and remaining as partition it shows the message as "partition #2 contains ext4 signature." Do you want to remove signature ([Y]es/[N]o)

    I clicked yes and restarted.

    Now with the command: sudo resize2fs /dev/sda2
    I get the message: "segmentation fault" after the first three lines

    what do I do?


  14. Hi Jonathan
    Do not know where I am going wrong here keep getting error trying to resize (The process cannot access the file because it is being used by another program) This happens right from startup without me running anything else. windows 10 Pro 64bit all updates are done.

  15. I don't have a TV to connect my Pi 3 B+ and to avoid unplug screen, keyboard and mouse every time of my PC I'm interested to emulate raspbian on Windows.
    Is it possible to use the GPIO pins when the Pi is connected to that emulator on PC?

  16. The reason I want to do this, is to set up the pi images before writing them to an SD card. I find it easier to work in a Linux or Windows environment when building the pi image, especially when customizing, because I have a direct line between that image file and photoshop/aftereffects/vegas/every other creation suite you can imagine that helps make my pi look sexy 😉

  17. I dont get the root Shell after qemu starts… therefore cant execute comands. However on the Windows cmd line it appears and I can use it to na extent, but cant use nano since it fucks it all up and cant even use arrow keys…

  18. Did not work, can you redo this tutorial for the current version because I think some major things have changed, I updated everything in start.bat and when I put start.bat into the command window, it gives me the system cannot find the file .bat.

  19. I made a program that lets you emulate Raspberry Pi 3 on Windows in one click
    You can find it on rpi-emulator dot com

  20. Hello. I do need quick help. I followed your instructions carefully except have to change it based on updated image. I boot it up but it says "Guest has not initialized the display (yet)." Can I ask for your advice please? Thank you for your response in advance.

  21. If anyone is making a video like this where the console commands are important, please zoom in on the window so that it's easier to read.

  22. I have to build a rasberry script for both WINDOWS and LINUX and I am so not tech savvy and the tem confuse me painfully. HELP…starting early as I am a goober at this. LOL

  23. Thanks for indicating the location of the description, I would have never found it, was looking above and to the side. Thanks that you made it super clear as well, not just saying below, but down below as well. Thanks for the clarification.

  24. Error bei starting the Start.bat Qemu give me a black screens with the text : "Guest has not initialized the display (yet)" Why?

  25. when im trying to run start.bat, it says "Cannot open pixbuf loader module file 'C:UsersasusDownloadsqemulibgdk-pixbuf-': No such file or directory". what should i do?

  26. Nice vidoe. I have some problem. When I do start.bat it run but then it hang up at the following line:
    crng init done

    Also is there any written guide line for this video. Some of the words and commands I could not hear properly.

    My start.bat is:
    qemu-system-arm -kernel kernel-qemu-4.9.59-stretch -cpu arm1176 -m 256 -M versatilepb -dtb versatile-pb.dtb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -drive "file=2018-10-09-raspbian-stretch.img,index=0,media=disk,format=raw" -redir tcp:2222::22


  27. Excellent! Can you do a Win10 ARM Tutorial? I need a VM where i can test my Visual C/C++ ARM EXEs and DLLs. I live Linux and Macs to but in this case it has to be Win10 ARM.Subscribed!

  28. I was trying to compile some driver for canon, seems that the Linux source is open, can you use this to target a compilation for a different arch?

  29. Greetings,
    I copy the first code and change the file name, then run start.bat
    it shows me this error: qemu-system-arm: -redir: invalid option
    any suggestions?

  30. Nice tutorial and appreciated but would of like to have known about the 256MB RAM limition before I downloaded anything. I wanted to use it as a accurate representation of how my custom RetroPie images would work on a real pi. A real pi seems the only thing for testing so far but thanks all the same.

  31. hi, can I do this virtually ? I mean without the Raspberry pi 3 kit . as we do arduino using Proteus .

  32. 0:10 Sounds ridiculous right? But it's better to kill virtual machine than real device. I'm using one to build an Armbian to deploy it on multiple dev boards.

  33. bro you are awesome.. i was wondering how can i emulate respberry pi on windows..but you have done it.

  34. This is just showing how to install a Raspberry Pi OS. It's not an emulator. And people can just use VMWare or Virtualbox to install the OS. I want a Raspberry pi emulator for electronic stuff, like programming the pins to use them.

  35. Hi It is very good video ….
    I followed your instructions and I am able to do SSH

    now how to get the temperature using raspberry pi emulator
    could you please give steps what needs to be done

  36. Hi, can we install any kind of driver in raspberry pi emulator, in window 10 machine , for working of any h/w device connected like printer or thumb detector.

  37. hi, does anyone else has this problem?
    right after run start.bat

    qemu-system-arm: -redir: invalid option


    -netdev user,id=tcp22,hostfwd=tcp::2222-:22

    beside that, I am not sure, but is this a tutorial to emulate the ARM architecture or just the RPi sw running?
    in the end am I going to have an RPi emulator where I can try on my own linux distro or am I going to have a raspbian that can totally be done by VM in 5min?

Leave a Reply

Your email address will not be published. Required fields are marked *