In this step-by-step guide, I walk you through setting up a Raspberry Pi headless—no monitor needed! Learn how to tackle SD card issues, disable the auto-mount service (uDiscs2) to avoid corruption, and configure SSH for secure remote access. I’ll also show you how to set a static IP using Network Manager, prep the Pi for a WiFi dongle, and install the “screen” utility to save your work. Whether you’re a beginner or a seasoned Raspberry Pi enthusiast, this tutorial covers practical tips to get your Pi online and ready for projects. Hit subscribe, check out my website via the QR code, and join the community for more tech tutorials!
Introduction and SD Card Issue 00:00:00
Disabling Auto-Mount Service 00:00:41
Mounting SD Card Partitions 00:01:24
Configuring SSH on Boot Partition 00:02:15
Setting Static IP in cmdline.txt 00:02:48
Configuring Root Partition and SSH Keys 00:03:44
Setting File Permissions for SSH 00:06:04
Unmounting Partitions and Booting Pi 00:07:31
First SSH Login to Pi 00:09:14
Configuring Network Manager for Static IP 00:09:51
Setting Hostname and System Update 00:17:01
Installing Screen Utility 00:18:24
WiFi Dongle Installation Overview 00:19:11
Video Conclusion and Subscription Request 00:21:00
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
Please help support us!
- Subscribing + Sharing on Social Media
- Leaving a comment or suggestion
- Subscribing to our Blog
- Watching the main “pinned” video of this channel for offers and extras
Okay, I’m back.
I have finished writing my SD card.
I had a problem when the scene was paused.
Basically, those annoying pop-ups came back
where I was like in the middle of writing to the card
and the auto-mounting service suddenly decided
that there was a file system there
and it auto-mounted it and then it, you know,
put it up onto the screen.
And I think it corrupted the card.
So I ended up having to rewrite the card from scratch.
So let me just show you real fast within this video how to disable that service.
It’s sudo system control.
Start with status and then type uDiscs2.service.
For me, I already disabled this to get it working.
So what happened?
No, I already stopped it.
I already stopped it. Basically you just want to do stop to temporarily stop it.
And then if we go back to status, it’s still it’s still enabled. That just means that it’ll come back on for the next boot.
Okay, so if your SD card corrupted or anything like that, you probably want to start over after you disable U-Discs.
And then if we use the Partead partition editor again, we can see that SDB is still there.
So that’s still considered the name of our card. So now that
now that the auto-mounter is not doing anything for us we need to mount the card ourselves so
i’m going to go into cd actually just to double check media and then mike and then notice how
it’s not mounted so i’m going to go into cd i’m going to go into the temporary directory i’m going
to go into that pi directory i think i probably made that earlier on camera for you and then i
made two other directories one called boot and root so i’m just going to mount the uh oops dev
partition one, which is usually the boot partition to the boot folder.
Do my password and then do the same thing for partition two,
which is usually the file system root folder.
So first thing we need to do is go into the boot partition.
So this is what the pie will see when it boots up.
Yeah.
Okay.
So what we need to do is make an empty file called SSH in the boot folder
SSH in the boot folder or the boot partition because we want to tell the
pi that its SSH server should be enabled by default so I’m gonna go sudo touch
SSH if I list it again notice how there’s just an SSH folder and that’s it
there’s nothing inside of it the pi just knows the other thing we have to do is
modify the startup command line here I already did this actually when I jumped
Basically you want to do, you want to edit the cmdline.txt file, and then you want to
find the argument that says root wait.
And right after that, you want to stick the IP address that you want your PI to start
up as or start up with.
So it’s IP equals and then the address.
And then again, like we said before in this video, you need to know what is the subnet
of your existing network and you need to choose an IP address for your PI.
Let’s see if I actually matched what I was supposed to do.
to do oh gosh for the pie yeah 5.1 okay so I’ll move that over to the first thing there yeah so
just 123 is what we wanted so that’s why that is there so I didn’t actually modify this but you’ll
have to modify yours I didn’t because I have to because I already did it and then we’ll go into
the into the root partition so we’ll go into the root partition and notice how it’s got like all
And notice how it’s got like all the files and folders that you’re used to seeing with Linux.
So that means, you know, this is the temporary amount slash pi slash sorry, slash temp slash pi slash root.
Inside of it, there’s a subfolder called home.
And then there’s the home directory for the root account under the root folder.
You could modify that instead if you want to.
I’m just going to go into the home account.
Sorry, the home folder.
And then go into the pi accounts home folder.
because that’s what your PI account is going to start off with.
Again, notice how we’re in like a deeper subdirectory.
So from the PI’s perspective, we’re really only in slash home slash PI.
I already actually did this.
When I jumped away, I wanted to make an extra video for SSH or sorry, for first boot stuff.
So I made the SSH folder.
What you need to do is make directory dot SSH so that you have a SSH folder in this PI folder.
in this pi folder then once you have that go inside of it and you want to make a file called
authorized keys so i did nano authorized keys like that and then i edited it and i just put the public
key of of the machine that i’m currently on right now this is just a virtual machine so i guess it’s
fine if i share but um what you want to do is generate your own ssh key if you don’t know how
but uh you can print out your ssh key with pretty much cat squiggly line or tilde swinton and then
like a slash and then dot ssh and then id and then dot pub so that was my public key that’s how i
found it and then um you know if you don’t have a key you can go ahead and do this on your host
ssh keygen forgot if i put this into the last segment but you type that and hit enter a bunch
of times and when you’re done hitting enter enough you’ll have your public key there somewhere
your public key there somewhere. You probably want to eventually learn how to put a password on your
key but it’s fine for now. So we created the authorized keys file that basically tells
the operating system that I would like that particular key to be able to authenticate as
that user and since the pi is a god user or like a root user it’s pretty nice. The other thing we
have to do is make sure that we set permissions correctly. If the permissions aren’t correct on
your SSH will not authenticate so so I’m gonna make sure that this is set to
the right permissions for me I usually do 7 0 0 on the authorized keys file I
can’t remember if 6 0 is fine so I just put 7 that basically means that your
current user which will eventually be the PI user has full permission to look
at that file but nobody else does so you can tell by the way because on the left
execute and then a bunch of empty dashes meaning nobody else has permissions so we got to do the
same thing for the ssh folder um so i’m going to go uh you know chamad if this doesn’t work by
itself you might want to say pseudo chamad but i think it’ll work because the username that it
thinks is on that folder is actually the same as my current user which is great so i’m going to go
and not the six on there, meaning the current user should be able to actually like read
that directory.
If it’s six, they won’t even be able to read the directory.
So we do that just to make sure that the dot SSH file and the authorized keys file have
correct permissions.
And then I think we’re ready to log into the pie for the first time.
So I’m going to go up.
By the way, if you were inside of root for some reason, I do this sometimes, sudo su
and let’s, oops, let’s go up and then let’s unmount,
whoops, let’s unmount this boot partition
or the root partition.
You may get an error message saying
that the partition is busy
because what you didn’t realize was the account
that you just came from is still considered
in that directory.
So you gotta make sure that there are no terminals
or accounts or anything actually using that directory
before you try to unmount it.
So I’m gonna go sudo, oh, I gotta go up one level.
sudo unmount boot umount and then umount root uh if there are no error messages then that means
the sd card is ready to be put into the actual pi before i do that though i’m going to start
pinging the pi because it’s fun to see the pings come online i’m going to go 192.168.123
because that’s what we chose for the pi already in my other video that i just made i typed like a
here forever on camera. I’m not going to edit it out. So I’m going to take the SD card out
and you can’t really see my Pi because it’s plugged into an ethernet cable, but I’m plugging
an ethernet cable into the Pi. I’m putting the SD card into the Pi and then I’m going to plug power
into the Pi. Totally headless. Don’t have to worry about very much at all. So it’s got power now.
and pretty soon now it should start responding to pings.
Soon as it comes up,
I’m gonna log in and start finalizing the ethernet setup.
There it goes.
Might take like a few more seconds after this
before the SSH server actually comes up,
but I’m gonna give it a try right now and see what happens.
And remember to do PI at,
because we did not make a different user.
When you see this message right here,
that the remote is not recognized that’s a security feature so I’m gonna put yes
and now we’re in the Pi so what I was supposed to do is a network manager connection show at least
this version of the Pi the latest version uses network manager if you’re watching this video
from the distant future you probably just need to you know use whatever tool they have instead of
network manager so I’m gonna edit the ethernet connection and I’m gonna print the connection
the connection details just to double check here.
It’s…
I guess it’s fine.
So now I’m going to set up the IPv4 settings.
So I’m going to go set ipv4.method to manual
because I want a static IP.
Getting dynamic IPs that are also fixed is kind of like another video.
I want to set the address to the one that we just put into the command line.
So 1.123 and give it a 24 block,
meaning it’ll be considered in the same subnet
with other addresses that only have the last number changed.
Then we’ll set the gateway to 1.1,
which is the router address.
Okay.
I’m looking at notes right now, 1.1.
And then we’ll set the DNS.
You don’t actually necessarily need to set the DNS
if you’re, well, I don’t know,
maybe you probably should if we’re doing static right now.
Yeah, you should probably maybe try setting the DNS
as your router, because usually your router
is also your DNS server at home.
If that doesn’t work, maybe try a different number
that you can find online.
This one is, I think, Google DNS.
You just need at least one DNS server,
preferably two or more that works
so you can resolve numbers to names
and your computer can go online by typing names.
So for me, these are my DNS servers.
So I’m just gonna type them in real fast.
Whoops.
And then you don’t need to do this next setting,
You don’t need to do this next setting, but I like to be able to use shorter server names.
So for me, instead of typing… Let me show you what this means in a second. So I’m going to say
my search domain is home because I have a fake domain at home called home. Most people do LAN.
You should probably double check this by saying print ipv4, like print ipv4. And then after we’re
reason I do this is if I ping a server, like let’s say I do router.home, for me that’s too much
typing every single time. If I added that.home search domain, then I could just ping router.
So that’s the only reason that I do that. It’s just a little bit more convenient.
So now let’s remove the setting that we put into the command line so that we have more freedom to
modify the network in the future if we want to. So let’s go to the boot partition.
We’re in the PI right now, so it’s a little bit different.
We’ll go into the firmware subfolder and then we’ll modify that command line file that we
had in before where we were forcing that IP.
We’ll just erase this so that it’s no longer forced because the network manager configuration
we just did should be okay.
And then let’s reboot, reboot the machine.
Do another ping so that I can get online as soon as it comes back up.
Should just take a couple seconds here.
seconds here. So how was your day? How are you? I think somebody let me know if I look weird in
this camera because I have like a new camera with like a viewfinder or not a viewfinder,
like an LCD display. I didn’t used to have that before. I had the oldest, cheapest,
crappiest camera you could possibly imagine. Now it’s just kind of cheap.
lcd you know screen so i’m looking at my own face right now instead of the camera
so tell me if this seems strange or weird to you
but
Okay, so I’m back.
I don’t know where I cut the last video, but basically we had just set a static IP address
on the Pi and then rebooted it and it didn’t come back online.
So I had to stop the video and just try to figure out what I did wrong.
And basically I forgot to tell the connection to start on boot.
So what I did to fix it is I went into the SD card again.
So I did another mount.
I didn’t mount the boot partition.
I only needed to mount the root partition.
and the path that you go into is pretty much this if you’re using network manager
you go into your temporary amount so that’s this first part right here temp pi root and then the
file system from the pi’s perspective this is the path where you can find your system connections so
etc network manager system connections inside of it you’ll see a file for every connection that you
set up on the fail that you just did or that i just did maybe this will prevent you from
failing. Maybe I’ll show you how to set that inside of the Pi too, just to be sure.
So basically we’re just going to edit that connection file. There’s a bunch more stuff
down below, but I just kind of spaced that down so you won’t see it. What you’re really interested
here in this connection file is auto connect. It should have been set to true. And now if we do that,
we should be able to unmount the card and boot the Pi back up and then it should go online.
It’s actually kind of like maybe a good reminder to always include redundancies as a good computer
nerd, right?
Computer scientists, computer nerds, we always like have redundancies in everything.
What I should have done is chose a different IP address for the network manager connection.
That way if I screwed it up, the Pi would still boot under the first address and only
after seeing that it booted with the new address, I could have removed the first address.
But you know, I’m a little impatient and careless sometimes.
I’m going to unmount this root partition and we’ll go back to looking at the
pings, right? That’s the correct ping.
I’m going to remove the SD card from the reader.
I’m going to put it back into the pie and then I’m going to plug in the power.
Okay. Now, hopefully it won’t take long before the pie comes back online.
If it never does, you and me are going to be sitting here.
You and me are going to be sitting here.
Oh, please, come on, what have I done wrong?
Okay, it works this time.
So it was definitely the auto connect.
So now I’m going to go SSH into the Pi.
We already saw that security warning, I think, either in this video or the other video, but
what have I done?
I forgot to put the one there again.
Dumb.
Dumb. Okay, so we’re in the pie. First boot, first connection without even using a computer monitor. Pretty sweet.
So now I’m going to go sudo network manager command line show and then I’m going to edit the ethernet connection
just to show you what we should have set before we saved. It would have been connection.autoconnect.
Connect to yes.
That didn’t change anything, but that’s what I should have done.
I mean, it would have changed something before.
So now we’re inside the Pi, and we’re ready to start setting up more stuff.
So the first thing I’m going to do is, well, I’d like to change the hostname on this Pi.
So I’m going to do sudo nano etc hostname.
There’s a command called hostname I think you can use, but I just like to set it in the file.
So basically, we want to set the hostname of the Pi.
pi that’s not terribly useful for now but I just like it because it shows up on the command line
so I’m going to go pi repeater dot living room dot home don’t judge me for my silly domain names
so now the next time we reboot the pi we’ll have a good domain name then I’m going to do an update
so I’m going to do actually you know what what you should do at home I’m going to omit this just to
sure everybody should do that because the local list of packages that are available needs to be
updated otherwise you might have a hard time installing later it sometimes gets out of sync
and it doesn’t work so we’ll all do update at home you should do upgrade right away i’m not
going to do upgrade right now because it’ll take a long time and then after you do upgrade you
should do auto remove with a dash yes there or just type yes manually again i’m not going to do
And then you should reboot the computer or reboot the PI
then let’s
Install a program called screen which gives us a virtual screen. Let me show you just real fast
What this is for so sudo apt install screen
It’s just basically a virtual screen that you can work on
So if you accidentally lose your connection or something goes wrong, you can log back in and get right back to your work
so I type screen here and I’ll just type like a bunch of random characters and
type like a bunch of random characters and then I will detach from the screen and exit the Pi. So
imagine you lost your internet connection or your network connection. I can go back into the Pi now
and I can list screens with screen-list and then I can reattach to it with a dash R.
Notice how my work is still there. This doesn’t survive if the whole machine reboots but this has
saved me a few times from losing work when I was connected to a remote terminal. Okay so now what
Okay, so now what do we have to do?
The next most important thing that we have to do is install our WiFi dongle.
We have to actually install drivers.
If you’re looking at this video way in the future, I don’t know, maybe the Pi will handle
this.
But right now, as of the making of this video, this dongle doesn’t work unless you install
the drivers from source.
So let me just prove to you real fast.
out. Well, maybe you’ll just have to trust me. At home, do this command IP, whoops, do this command
IP ADDR and hit enter. And you should see two network adapters, you should see Ethernet zero
and also wireless LAN zero. Wireless LAN zero should be already working. It’s not connected
yet, but it’s working. Because well, that’s the one that’s built into the pie. You want also
another one you want wireless LAN 1 like we talked about before for that we have to plug
in the dongle and install the the firmware so I think what I’m going to do now is stop
this video and jump into another one where I just kind of talk about how to install this
dongle so by the time you watch this video that other video should be posted I’m basically
just going to expect that you pause this video and you go over there and you watch the video
If you don’t have the same dongle as me, that’s okay.
The instructions will probably help you get a pretty good idea for how to do it yourself.
And then again, if enough people comment about the same…
I don’t know if I said this before.
If enough people comment asking me to make a video for the same dongle,
I might buy the dongle and then just try to install it for everybody.
We’ll see what happens.
So I’m going to cut the video now.
Go to the other video that shows you how to install the dongle, and then we’ll continue.
Hey everybody!
Thanks for watching this video again from the bottom of my heart.
I really appreciate it.
I do hope you did learn something and have some fun.
If you could do me a please, a small little favor,
could you please subscribe and follow this channel or these videos
or whatever it is you do on the current social media website
that you’re looking at right now.
It would really mean the world to me and it’ll help make more videos
and grow this community.
So we’ll be able to do more videos, longer videos, better videos,
or just I’ll be able to keep making videos in general so please do do me a
kindness and and subscribe you know sometimes I’m sleeping in the middle of
the night and I just wake up because I know somebody subscribed or followed it
just wakes me up and I get filled with joy that’s exactly what happens every
single time so you could do it as a nice favor to me or you could you control me
if you want to just wake me up in the middle of the night just subscribe and
then I’ll just wake up I promise that’s what will happen also if you look at the
look at the middle of the screen right now you should see a qr code which you can scan in order
to go to the website which i think is also named somewhere at the bottom of this video and it’ll
take you to my main website where you can just kind of like see all the videos i published and
the services and tutorials and things that i offer and all that good stuff and uh
if you have a suggestion for uh clarifications or errata or just future videos that you want to see
want to say hey what’s up what’s going on you know just send me a comment whatever i also wake up for
those in the middle of the night i get i wake up in a cold sweat and i’m like it would really it
really mean the world to me i would really appreciate it so again thank you so much for
watching this video and um enjoy the cool music as as i fade into the darkness which is coming for us
Thank you.