A complete guide for installing Raspberry Pi OS Lite version in headless Raspberry Pi Zero W

Jayeeta Mondal
6 min readApr 9, 2023

--

Raspberry Pi W; source:https://www.adafruit.com/

This is a complete tutorial to set up desktop free lite version of Raspberry Pi OS for Rpi Zero board.

Raspberry pi zero is a $5-$10 single core machine which comes in the size of a USB flash drive. It can be integrated into compact casing and easily carried outdoors. Rpi zero has 3 SKUs (Stock Keeping Units), all of which has the same Broadcom BCM2835, ARM11 32-bit CPU and 512 MB RAM. Find further details in page https://blog.techdesign.com/evolution-raspberry-pi-zero-3-versions/. The CPU is same as the Raspberry Pi 1 (first version), but is overclocked to 1 GHz. The wireless support and Rpi camera module supports are much better and improved in the newer versions. Raspberry Pi Zero W has bluetooth and WiFi supports but is costlier ($10), whereas, Raspberry Pi Zero version 1.3 is cheaper ($5) with no wireless connectivity.

There are 3 different OS versions released by the Raspberry Pi Foundation based on Debian Linux distribution. For Rpi zero boards, a 32-bit version of the OS is adviced, however the newer versions of Rpi zero can handle 64-bit version as well. To save the compute resources on Rpi zero a much minimalist version of Rpi OS can be installed.

Raspberry Pi OS LITE is suitable for projects that do not need the entire Desktop version installed into Rpi and can work on customizable low computational-overhead operating system. There are two different versions of the LITE OS, 32-bit and 64-bit. This tutorial includes the step by step installation guide for setting up 32-bit operating system in headless Rpi zero W board with remote desktop settings.

What do you need for this set-up?
1. Raspberry Pi Zero W board. (you can purchase from the website https://www.adafruit.com/category/176).
2. USB cable
3. Host laptop
4. WiFi connection (make sure to have 2.4G network)
5. micro SD card (8GB/16GB)
6. micro SD card reader.

Figure 1: This is all you need !

So, Lets get started!

The first step is to flash your SD-card with the Raspbian OS. I am going to use a 8 GB micro SD card for this tutorial.

  1. Download Raspberry Pi imager from official website https://www.raspberrypi.com/software/. Go ahead and select the imager as per your OS. In this tutorial I will download and install the windows version. (Figure 2)
Figure 2: Download options in raspberry pi official website.

2. Install the imager_version.exe file in your laptop. (Figure 3)

Figure 3: Install the imager

3. Once the imager is ready open it. Insert the SD card into the readable device and plug it into your laptop. In the imager, select the appropriate OS version. I will choose the 32-bit Raspberry Pi Lite OS for this tutorial.

Figure 4: 32-bit Raspberry Pi OS Lite

4. Next, go ahead and select the storage device (drive with the SD card mount) for the flashing.

Figure 5: Flash the SD card mount on D drive

5. Before you proceed, check on the tiny settings icon at the bottom of the imager window to pre-configure your time-zone, WiFi settings and SSH. Provide the correct details in the configuration. “Enable SSH” for the headless set-up. Provide the SSID and password of your WiFi. Untick the “Eject media when finished” option and save it.

Figure 6: Settings window in imager

If you want to change any configuration later you can do so by typing raspi-config in the terminal of your rpi and then once all configurations are altered you can reboot the system to take effect.

6. “Write” the OS into the SD card and continue. If there is any issue with this step, try re-writing again if it still fails you can try changing your SD card.

Figure 7: write the SD card

7. Unmount the SD card, and insert it into Raspberry Pi zero and power it up using the usb connector cable. But before you do that, you will need an IP address scanner app on your device to find the IP of your Rpi. I have used Advanced IP scanner (https://www.advanced-ip-scanner.com/), however, you can also find the IP from router login page. In Advanced IP Scanner you will be able to locate your device under the manufacturer “Raspberry Pi Foundation”. You can check if Rpi is connected to your WiFi by trying to ping the hostname.

Figure 8: ping hostname to check !

8. For this you would need a linux machine or a windows machine with linux subsystem. SSH into the raspberry pi by typing “ssh username@hostname” from a linux terminal. Then update the OS as root using the following commands.

sudo su -
apt-get update
apt-get upgrade
Figure 9: establish ssh into your rpi

Note: While upgrading you might face errors such as:

Figure 10: connection failure

The fix to this:

nano /etc/apt/sources.list

Change the link given in the first line of the file to the very first link that you can see on top of the page http://www.raspbian.org/RaspbianMirrors. If you are in Indian sub-continent, still the first mirror link should work. Write out the file by pressing Ctrl+O. Now perform apt-get upgrade as root.

9. Note: For remote desktop settings you will need to install the full version of Raspberry Pi OS. For enabling VNC in Rpi first do raspi-config from rpi terminal (as root). Go to interface options and do VNC enable. Download and install Real VNC viewer (https://www.realvnc.com/en/connect/download/viewer/) in your host machine. Alternatively, you can create your Real VNC account.

Figure 11: VNC viewer

10. Connect to the ip address of your rpi from VNC viewer. Press “Continue”. Give the username and ip address of your rpi and view your desktop!
If you are getting “Cannot currently show the desktop” error on your screen, then, power down your rpi to take the SD card out. Read the card in your laptop to open config.txt file from boot directory. Add the below three lines of code in the file:

hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=9
Figure 12: config.txt file should look like this now.

Plug the SD into your rpi and power it up. Try connecting with VNC again using your rpi ip address by deleting the old connection and creating a new one. If this does not yet solve your problem, try changing the desktop resolution with raspi-config from rpi terminal (raspi-config>Display options> VNC resolution). Choose the highest possible resolution to fix the problem and reboot your rpi. Change the autologin option from raspi-config>System Options>Boot/Auto Login>Desktop Auto login. Reboot the rpi. VNC desktop should connect now.

--

--

Jayeeta Mondal
0 Followers

|Researcher@TCS Research|Metch@BITS, Pilani|Guest Faculty@IIM Bodh Gaya