If you want to use your Raspberry Pi but don’t have a monitor, an HDMI-mini cable, a keyboard or a mouse you might be confused as to how to access it and set it up. Here I will explain the best way to do so.
I bought a Raspberry Pi 4 with 4GB RAM for my first year of university, because we required it for one of our projects. I wanted to be able to connect to it from my laptop and be able to run tests and applications on it while seeing what is happening on my laptop. The only downside of this method is that you have to manually connect your Raspberry to the internet using wpa_sipplicant.conf
file and have the Raspberry on the same WI-FI as the computer you’re using to access it.
The logic behind connecting it is this. You use the Secure Shell protocol (SSH connection which you have to enable first) to access the terminal window of the Pi from your laptop. From there you download a package onto the raspberry which allows it to stream its desktop. You have to download that same program onto your PC and then you connect it from there and voila.
The easiest way to do the setup required for this is to use the Raspberry Pi Imager when downloading the OS. After you select the version you want to download and the card on which you want to download it there is a button for accessing advanced settings. From there you must enable SSH connections which is as simple as clicking this button
as well as set-up the internet from here by setting the region and entering the SSID (which is just the technical term for the name of the network that you’re using) and the password of that network.
If you’re using an older version of Raspberry Pi Imager the button for the advanced options might not exist. In that case you have to download the OS for the Raspberry PI, wait for it to verify and once that is done take it out from your computer and put it back in. Afterwards go to that SD card and in the main folder (find how to rephrase this) add 2 things:
1. You need to add an empty text file and call it “ssh”. You must remove all extensions as well which means that there should be no “.txt” or “.exe” at the end. On boot, the raspberry searches for a file with the name “ssh” and if found, it enables SSH.
2. To set up the Wi-FI manually you must create a wpa_sipplicant.conf
file in the same folder as the ssh file. This time you must add a few lines of text to that file:
country=nl
update_config=1
ctrl_interface=/var/run/wpa_supplicantnetwork={
scan_ssid=1
ssid=”yourWifiName”
psk=”yourPassword”
}
In addition to that you also need to change the End Of Line conversion to the Unix format. This is easiest if you have the Notepad++ app.
Finally, you should add those two files into the boot folder:
After booting up the raspberry pi and waiting for it to set up everything you should be able to go and find its IP address on your network. You’re going to need to find it. THIS is a great article about finding it’s IP address if you want to get more familiar with it.
I personally use the app Fing (App Store && Google Play) which is on my phone. If it’s connected you should be able to see the raspberry show up and find it’s IP address.
Now you open the terminal (cmd) on your laptop and type ‘ssh pi@(YOUR_RASPBERRY’s_IP)
’.
For me it was: ssh pi@192.168.2.18
After that it will ask you whether it should trust this fingerprint and you should let it. Finally it will ask you to input your raspberry’s password which should be “raspberry” unless you’ve changed it from the advanced settings.
If you’ve done everything correctly now it should be connected to the raspberry terminal. From there you need to download VNC viewer. You do that by writing this command
sudo apt–get update
to update the advance packet manager to the latest version and then download VNC by writing this:
sudo apt–get install realvnc–vnc–server realvnc–vnc–viewer
After this you need to enter sudo raspi-config
and enable the PI to share it’s screen. After you type that a menu screen should appear. Then you go to 3. Interface Options -> I3. VNC -> Yes.
Finally, you need to download that app on your own machine from which you want to connect to the PI. Here is the download link to the website’s download page.
After you download it and open it go to File -> New Connection
From there you just enter the IP address of the PI into the VNC Server box and then just hit “OK”.
Then you double-click on the new connection that has appeared, enter your username and password (“pi” and “raspberry” are the default ones if you haven’t changed them yourself).
Finally, if you’ve done everything properly you should be able to access the pi through your computer similar to how you would a virtual machine or a TeamSpeak. Here is an example of how it would look:
P.S. I recommend not installing the updates shown on the screenshot above because my raspberry completely bricks afterwards. I would still risk it and install them and if that DOES happen for you just re-install everything starting from the start of the page :)) I’ve done that around 5 times because I wanted to understand what is causing that brick. The error that shows up (if I connect it to a monitor) is “Kernel Panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,1)” If you have any insight as to what might fix that and why that happens I would love to hear it.
Thank you for reading my post.