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*