How to Set Up Raspbian for Headless Use

by brian314 in Circuits > Raspberry Pi

1360 Views, 4 Favorites, 0 Comments

How to Set Up Raspbian for Headless Use

Materials a.jpg
Materials b.jpg

These instructions are on how to configure the Linux distribution Raspbian designed for the single board computer known as the Raspberry Pi to run as a headless system.

Supplies

Windows, OSX, or Linux computer with at least 4GB of available hard disk space. Please not that instructions are geared towards Windows users

  • Available USB port or SD card reader

8+ GB Class 10 MicroSD card

  • MicroSD to USB or SD adapter depending on what interface your computer has.

Download Everything You Need

Step 1a.PNG
Step 1b.PNG

Download the latest version of Raspbian Lite. At the time of writing that is Buster September 2019.

Download the latest version of Etcher for your device.

Install Etcher

Step 2.PNG

Navigate to where Etcher was downloaded and double click the executable.

Follow the prompts (if any) on the screen.

When complete, Etcher should automatically launch.

Unzip Raspbian

Step 3a.PNG
Step 3b.PNG

Navigate to where Raspbian was downloaded.

Windows

For Windows right click and select Extract All...

  • If you do not see Extract All... on the prompts you may have a third party compressed file manager. If you do not know how to use your compressed file manager, follow these instructions to restore your PC to the default manager.

Click Extract or Browse to choose a new location that you can find later.

Unix

For Unix operating systems, open the terminal and navigate to the directory where Raspbian was downloaded and run the following command, replacing xxxx with the name of the file downloaded.

  • unzip xxxx.zip

Prepare the Media

IMG_20191013_150351.jpg

Connect the MicroSD card to the computer though its SD card reader or USB port.

Windows

If prompted to format the disk, click cancel. We will do this in the next step.

Flash Raspbian to the SD Card

Step 5a.PNG
Step 5b.PNG

Open (or reopen) Etcher

Press "Select Image" and navigate to where Raspbian was extracted in Step 3. This should be a .img file. Click Open.

Verify that the SD card is selected. It should automatically select the correct device unless you have additional removable media.

Click Flash and wait for it to finish. This may take several minutes depending on the speed of your computer.

Windows

Allow Command Prompt to make changes if prompted.

Verify the Image

Step 5c.PNG

Once flashing is done, Etcher will automatically begin verifying the Raspbian image.

If Etcher successfully verifies the image, proceed on, otherwise repeat Step 5.

  • Note that 1 Failed device error is expected and does not indicate a failed flash.

Windows

You may be prompted to format the disk again. Do not do this, it will undo Step 5.

Enabling Secure Shell

Step 7b.PNG
Step 7a.PNG
Step 7c.PNG

Navigate to the new drive called Boot.

  • Note that after flashing you may need to reinsert your MicroSD card.

Create a text file called ssh. In Windows this can be accomplished by right clicking on any empty space in the file explorer and left clicking create new text document in the menu that pops up.

  • It is okay if the file has the .txt file extension.

Configure the Network

Step 8a.PNG
Step 8b.PNG

In the same directory as Step 7, create a file called wpa_supplicant.conf

Input this into the newly created file

network={

	ssid="<Name of your WiFi>"

	psk="<Password of your WiFi"

}

Replace with the SSID (name) of your network.

Replace with the WiFi password.

Visit here for more information.

Eject

Step 9.PNG

You are now done configuring your Raspberry Pi for headless operation.

Windows

Safely eject your SD card.

  • You will see two partitions, ejecting either one will eject both.

Unix

Unmount the SD card with your operating specific operations.

SSH to Your Hearts Content

Insert your SD card into your Pi of choice, power on, and connect with your SSH client.