New Method to Setup Raspberry Pi Without Keyboard or Mouse (Headless)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Nothing wrong with making a how to...

But selling the de facto default way of setting up a headless Pi as "new" is quite clickbaity... Not a huge fan.

👍︎︎ 12 👤︎︎ u/AlexisColoun 📅︎︎ Sep 26 2021 🗫︎ replies

Is this new? I’ve used pi’s for years and usually just create an SD card, boot and ssh in? Why do you need a keyboard?

👍︎︎ 9 👤︎︎ u/HLingonberry 📅︎︎ Sep 26 2021 🗫︎ replies

Are you new to Pi?

👍︎︎ 3 👤︎︎ u/FizzBitch 📅︎︎ Sep 26 2021 🗫︎ replies

I am curious, is this genuinely new to you or was this some sort of SEO play?

👍︎︎ 5 👤︎︎ u/MrSuck 📅︎︎ Sep 26 2021 🗫︎ replies

If you are a noob, everything is new

👍︎︎ 3 👤︎︎ u/Knurpel 📅︎︎ Sep 26 2021 🗫︎ replies

You can plug a Monitor into a PI? I have three, never did and why would you (if you Plan headless anyway!).

👍︎︎ 1 👤︎︎ u/belzeBUB2111 📅︎︎ Sep 26 2021 🗫︎ replies
Captions
this video is going to show you how to set up your raspberry pi without using any peripheral devices like a keyboard and mouse this is typically called a headless setup so in this video we're not going to need a keyboard and mouse to directly connect to our device we're just going to power on our device and then we're going to connect to it remotely over ssh or putty or remote desktop anyways let's get started okay so the first thing we're going to want to do is download raspberry pi imager from the raspberry pi website and this software lets us flash the operating system to our micro sd storage card okay so we need to get the raspberry pi operating system onto our sd card so the software that we want to use is called raspberry pi imager and we're going to get that from raspberrypi.org so let's take a look over there and then we're going to click on software basically what you're going to see here is if we go to all download options so these are the actual raspberry pi operating systems and we're going to want that but we also need a way to get the os onto the sd card we need a flasher and so we're going to use raspberry pi imager and this is going to bundle everything together so let's go ahead and download raspberry pi imager for our system i'm going to download for mac os okay so now we should have raspberry pi imager looks like we do i'm going to load it up if you like this video go ahead and click that like button so we can get it out to a wider audience thank you okay so this is going to let us flash the operating system to our sd card okay and since we're looking to flash our sd card we're going to go ahead and pull it out of our um raspberry pi slot here and um just so you know i'm using a sandisk 32 gigabyte micro sd card so we do need to connect it to our computer so that we can get the opera the raspberry pi operating system on this card so you can use one of these guys which is a sd card to usb converter or you can use a micro sd to sd converter and since my mac has a native sd card reader i'm just going to go ahead and use this so i'm going to throw it in there and then i'm going to insert it into my computer here quick note here if your micro sd card is over 32 gigabytes then you may need to format it to the fat 32 file system type and that's pretty easy to do both microsoft and mac have uh native formatting solutions that you can use to do that um but if your sd card is smaller than that you shouldn't need to worry about that now that we have our sd connected to our computer let's just double check that it is showing up okay so now that the sd card is connected to my computer i'm just going to look in a finder window to see what drives i have um currently attached and it looks like it is showing up as boot which looks fine to me so let's go ahead and flash the raspberry pi operating system to that drive okay and since we want our raspberry pi to run headless we wanted to immediately connect to our wi-fi network we also want ssh to be enabled on the initial boot up so there's a special menu option if you press ctrl shift x with raspberry pi imager in focus it will bring up a menu where we can uh make some of those initial configurations so we can enable ssh it's going to ask us to change the default password that's just a security precaution and then we're also going to provide our wi-fi network name and password make sure that you're connecting to a 2.4 gigahertz network because many of the devices can't connect to 5g some of them need to be updated before they can do that and then we'll go ahead and click save so we're going to select the operating system we want i'm going to do the out of the box raspberry pi os 32 bit and then we're going to select our storage make sure you're selecting the right storage here because uh if you select the wrong drive you're going to overwrite everything so this is my one terabyte samsung do not want to select that this is my 32 gigabyte micro sd and that's the target drive so we're gonna go ahead and click right okay looks like we're all set that probably took about four minutes so we're gonna come back over to finder here okay it looks like it ejected the drive proactively for us okay so now we can take out our micro sd card and place it into our raspberry pi like so um all right and then we're just gonna power it on without connecting it to any peripheral devices okay so i just plugged in the usbc power cable and uh let's see here which one is it's this guy at the end and then i just i'm going to toggle the switch all right and we can see that light turning on should be booting up momentarily so now we need to validate that our raspberry pi is in fact connected to our local network so i actually just logged into my router's home page here the admin portal and most routers offer this capability where they will list connected devices just so you can kind of audit that um the devices that are connected to your network are the expected devices okay and then when i list the connected devices i see raspberry pi here that is the default host name you can change that if you need i might also see the ip address so this is what i would expect and it's connected to my 2.4 g network because i have a dual band router and as i mentioned it will not connect to 5g so make sure you keep that in mind so another way to validate that it's on the network if you can't find your router login page is to pull open a terminal okay so i'm just going to open a terminal here expand this guy we should be able to ping the hostname so i'm going to do ping raspberry pi and you can see it is responding to uh ping traffic i i see mp traffic so i'm going to do control c to terminate that um quick caveat if you're on a windows machine a windows 10 machine you're not going to have a linux terminal to do with like the ssh and the ping and and that sort of thing so what you're going to want to do is download the linux subsystem if you're on a windows computer you want to download the linux subsystem and once you do that and have it enabled i think you can use like the windows store to download ubuntu or one of the linux operating systems it's actually a really great feature of windows 10 which is you can run a linux container and that linux container will give you a linux terminal which is similar to the unix terminal that i'm running here on my mac and when you have that ready you can do exactly what we're doing here with ping ssh and that sort of thing okay so we're going to show you a couple other ways to connect remotely to your raspberry pi so first we're going to want to connect over ssh and because we dropped the ssh flag in the boot drive we can go ahead and do that right now so i'm just going to do ssh the default username on raspberry pi is pi and then we need to supply the hostname so we're going to do pi at raspberry pi and then it's going to ask us only on the first connection if we want to use the um rsa fingerprint we're just going to select yes um okay so i have fingerprints from previous connections and it's saying that there's a discrepancy here i'm going to just proceed through that it's prompting me for a password so out of the box the password is raspberry okay and now i'm connected if i do ls just to list um everything so so so raspberry pi os is a debian linux variant so essentially it's just a linux operating system so um things will look pretty standard so the next thing we're going to want to do is update the packages on the operating system so i should be able to do apt get update oh okay so it's saying i don't have proper permission so what we can do is we can elevate ourselves to root so the way we do that is sudo su dash okay so now i'm a root user and we want to update the operating system so we're going to do apt get update and now we're just updating that debian operating system and it's good to do this right away when we log in okay and then we can run apt-get upgrade as well okay so apps get upgrade finished running so now we know we have the latest and greatest on the operating system and i'm going to just quickly okay the next thing we want to do is change some of the default settings you know if everyone knows our default username and our default password then we're kind of exposed people can connect to our device i mean they have to be on our network but we still probably want to swap out the default usernames and passwords so the way we can do that is by running razpi hyphen config and that will open up this utility here so what we can do is we can come over to system options and then we can do a hostname and we can change the host name so i can do so i'll do pi underscore refactored that will be my new hostname and then let's see what else here right so if we wanted to add a new network we could do that here i'm not going to do that um if we wanted to change our password we could do that here i guess i will do that okay so i just changed my password now if you wanted to modify your username meaning change it from pi to something else you could do that but you can't do it from this menu here you have to do that from the command line adding a new user the same way you would with any linux operating system okay and then unfortunately um not all of those settings will take effect immediately the password change will but the host name won't until we do a reboot so i'm going to do sudo reboot this is going to shut down the pie and restart it obviously the connection drops as well okay so now we can see um the raspberry pi is connected again and it's using the new host name oddly enough the underscore looks like it was taken out um i'm not sure if that's right let's go ahead and ping so i'm going to do ping pi refactored yeah nothing so let's do let's take the underscore out okay so you can't do an underscore apparently that's fine so the host name is now pi refactored and now what we can do is ssh at pi refactored and then we should be able to connect just fine and this i'm going to use my new password all right and we're logged back in um another thing you can do is um if you want to save the connection you can do shell new remote connection um just select ssh do plus provide the host name in this case it's pi refactored and then user and then yeah that's it so the command is ssh pi pi refactored and we can just test it out here and that looks good okay so now we have a saved connection it's kind of like putty so if you're on windows you can download putty and you can save the connection as well and i just wanted to prove you can do that on mac as well so next if you want a full gui desktop experience with your raspberry pi you can use remote desktop and connect using the vnc protocol okay so to connect over vnc we need to enable that on the raspberry pi so we're going to do raspberry ersart raz pi can config and then we're going to do interface options and then for vnc would you like the vnc server to be enabled yes so now when we try to connect through the vnc protocol to our raspberry pi device the raspberry pi device has a server listening for inbound traffic okay so to be able to view our raspberry pi's actual gui and desktop we're gonna have to use a vnc client okay so i'm gonna download realvnc and just make sure you're getting the viewer software looks like it works on all platforms so you should be able to use this for windows as well okay so i'm going to put the address in here which is using the ip address that we found this is a local terminal if i do dig i'm sorry the new the no the new host name is pi refactored all right so i believe this is going to be my ip address let's try this okay [Music] and then we might have to adjust our local max settings so that we can actually control and screen share properly [Music] let's not give that one all right so i'm just giving vnc okay and now you can see we're controlling um our actual raspberry pi so let's see here we're going to set the country to unite set the country to united states language is american english this one we want new york for me use english language use keyboard set the country code and uh language properly because there's some weird quirk with raspberry pi where if you don't set it properly i think wi-fi can be affected so okay so right here on the left we have the vnc remote desktop connection where i can actually interface with the gui on the right we have the ssh connection and what i want to show you is how the two correlate so like if i navigate to the desktop and that's the directory being shown here i can create a file right touch test dot txt and you can see it shows up on the desktop see these are just two different ways to interface with the operating system there's the gui and then there's the cli the command line utility and then real quick if you're on windows another option is to use remote desktop it's a native application that should be able to connect to vnc servers okay and then to wrap this all up let's just do one quick little fun project which is to host a website on our raspberry pi so the easiest way to do this in my mind is to choose a server software i like nginx so i'm going to do apt get install nginx it's asking me to elevate to root so i'm going to go ahead and do that and then i'm going to retype that command and i'm going to install nginx so this downloads the nginx server software and it also should stand up a website that we can visit when we hit the ip address of our raspberry pi okay let's just validate that the website is serving up traffic on localhost so we're just going to do curl localhost okay this is the out of the box nginx website so in theory let's open a new local terminal let's grab the ip address of our raspberry pi so i'm going to do oops i changed the hostname to pi refactored so this is my ip address so from here if i do curl on the ip address i get my website so this is making me think if i um open a new incognito window incognito window and go to this ip address boom we're hosting a website from our raspberry pi and just to confirm that that we are in fact hosting that website um i'm going to go to the html directory so i'm going to install a text editor because i want to be able to edit text i'm going to use vim so app get install vim and i'm going to use vim and i'm going to remove the h1 element and add a new h1 element okay and i'm gonna go ahead and save that now when we go back to our website boom and i just want to make a quick plug for all the other really interesting projects that you can do with raspberry pi you can buy add-ons and extensions and modules that can do all sorts of things gps and robotic arms and things like that so there's a whole lot of things that you can do with raspberry pi and i'd urge you to take a look at some of that as always if you're interested in learning about the latest and greatest around emerging tech ai iot google cloud platform go ahead and subscribe to this channel as i am releasing content around those topics on the regular anyways thank you for listening
Info
Channel: Refactored
Views: 3,644
Rating: undefined out of 5
Keywords: pi 4, canakit, how to setup raspberry pi, how to setup raspberry pi 4, raspberry pi 4 tutorial, noobs, raspbian, raspberry pi, etcher raspberry pi, raspberry pi 3 b+, arduino vs raspberry pi, arduino, arm cpu, small computer, raspberry pi tutorial, raspberrypi.local, raspberry pi 3 setup on mac, mac os on raspberry pi 3, install raspbian on micro sd card, etcher, install raspbian, etcher.io, raspberry pi 3, raspberry pi 3 model b+, raspberry pi 3 setup, diy, how to
Id: rGygESilg8w
Channel Id: undefined
Length: 20min 4sec (1204 seconds)
Published: Sun Sep 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.