Configuring Raspbian on Your Pi
Now that we have all the hardware and a properly flashed SD card, it’s time to boot the whole thing up for the first time. Attach all the cables and peripherals to your Raspberry Pi except for the power cable—this includes the HDMI or RCA cable, the USB hub, the Ethernet cable/Wi-Fi adapter, etc.
Once you have all the cables attached to both the Pi and their respective destinations, insert the SD card. After the SD card is seated firmly, insert the microUSB power cable to begin booting up the Pi.
Almost immediately you will see the boot sequence go scrolling rapidly by—seen in the screenshot above. After a moment or two your Raspberry Pi will kick over into the Raspi-config utility like so:
Here we can complete some basic configuration tasks and enhance the functionality of our Pi unit. Although you can run the Raspi-config tool at any time, it’s ideal to do the bulk of your tweaking and customization right from the start as later changes you make to the system may conflict with some of the configurations tasks.
Expand_rootfs: Our first task is to run expand_rootfs. By default Raspbian is only using as much of your SD card as the core operating system requires. We want to access the entire SD card so we have plenty of storage for future projects.
Use the arrow keys on your keyboard to click down to expand_rootfs and hit enter—a burst of text will scroll by and then you’ll receive the message “Boot partition has been resized. The filesystem will be enlarged upon next reboot.” Click OK.
Overscan: Not every user will need to configure the overscan. If you notice that there is significant black space around the edges of the display (the Pi is using the middle portion of the screen and not the full screen) you may wish to enable overscan to increase the amount of screen real estate the Pi is using. Click on overscan, and then select enable.
Change_timezone: You want your Pi to keep accurate time. Select the change_timezone option and then select the appropriate geographic region (such as US), followed by the appropriate time zone within that region (such as Eastern). A small script will run, seen as several lines at the bottom of the screen, and then return you to the main menu.
SSH: The ability to remotely connect into your Raspberry Pi over your network using SSH is really handy. Take a moment to turn on the SSH server now by selecting ssh. Select enable. Select OK after Raspi-config indicates the server has been enabled.
Boot_behavior: Here we can indicate whether we want Raspbian to boot to the command line or the desktop environment when the Raspberry Pi boots up. Let’s switch it to boot to the desktop by selecting boot_behavior, then Yes in response to “Should we boot straight to the desktop?”
While these basic tweaks should cover most users’ needs, there are a few additional settings worth noting.
Configure_keyboard: Use this command to configure non-US keyboards and enable their character sets/layouts.
Change_pass: Allows you to changet he default password from ‘pi’ to whatever you wish.
Change_locale: Enable locales for the operating system; necessary for non-English speakers.
Memory_split: Change how the system allocates the shared memory for the GPU and the main processor. We suggest leaving this alone unless you, later on in your experimenting with the Pi, discover a pressing need to alter it.
Overclock: The Pi has a 700Mhz ARM processor. The Raspberry Pi Foundation actually supports overclocking the Pi up to 1000Mhz (1Ghz) but we recommend leaving it at the default for now. This way, should any issues arise in your initial setup, you won’t have to rule out overclocking tweaks as a cause.
Update: This is just a simple update script for the actual Raspi-config tool. Since you just downloaded a fresh Rasbian image there isn’t much use for this one yet—keep it in mind should you hop into the Raspi-config tool down the road, however.
When you are all done setting your configuration options, arrow down and select Finish. When prompted to reboot the device, select Yes. Hang tight while the boot sequence scrolls by.
At this point you will be booted into the Rasbian desktop—or, more technically, LXDE, Lightweight X11 Desktop Environment—where we will need to do a few last configuration tweaks.
Configuring network connectivity: Once you are at the desktop, you will need to configure the Wi-Fi adapter (for those using a direct Ethernet cable, go ahead and skip to the next step).
From the desktop, double click on the WiFi Config icon. This will open the wpa_config tool, as seen above. Click the scan button in the lower right corner of the window.
Once the application has scanned the available Wi-Fi networks, double click on the network you wish to connect to.
In the detailed view for that network, enter your network password in the PSK slot. Click Add at the bottom of the window. You’ll be returned to scan results window, go ahead and close both the scan results window and the original wpa_gui window.
Testing the network: Now that we have configured the Wi-Fi connection (or jumped right to this section because we’re using Ethernet) it’s time to test our connection. What better way to test the connection than to fire up the browser and visit How-To Geek?
From the desktop, click on the Midori icon—Midori is an ultra-lightweight web browser—and type in www.howtogeek.com:
Success! Not only do we have network connectivity, but Midori’s WebKit rendering engine makes How-To Geek look just as good on the lightweight Pi as it does on a full-fledged desktop. This will likely be the first of many times you are surprised and pleased with just how capable your new little microcomputer is.
Updating the Software: Before you start digging into your Pi, it’s a good idea to do a basic software update. We have setup the network, we have tested the connection, and now is a perfect time to do a system wide software update.
Close out Midori and, from the desktop, double click on the LXTerminal to open up the command line. Type in the following command:
sudo apt-get update && sudo apt-get upgrade
This combination command instructs Raspbian to search available software repositories for system and software updates and upgrades. As any such updates are discovered, you will be prompted to approve or disapprove the changes with the Y/N keys:
Be patient, especially if you’re updating over Wi-Fi, as there will be periods of time where the whole process appears to hang for a few seconds. Once you have waited for the Y/N prompt, go grab a cup of coffee while it unpacks and installs all your updates. After the updates are finished and you are returned to the prompt, go ahead and close the terminal window.
Click on the power icon in the lower right hand corner of the desktop and select Reboot from the available options.
You will cycle through the boot sequence again and then get dumped back into the LXDE desktop. At this point you have successfully configured your Raspberry Pi to run Raspbian, linked it to the network, updated your software, and you are ready to start playing with your Pi.
Additional Raspberry Pi Resources and Projects
Although we’re busily writing more Raspberry Pi how-to guides and tutorials for your future enjoyment, we understand how exciting it is to have a new tech toy (especially one like the Pi that begs for hands-on involvement and customization). With that in mind, here are a variety of resources we recommend you check out.
The Official Raspbian Documentation—From tweaking your config.txt to installing media players, Raspbian’s user documentation is a handy reference.
The Official Raspberry Pi Blog—If you keep an eye on nothing else Raspberry Pi related, keep an eye on the official blog. They’re constantly posting updates on new Pi developments, fun projects Pi fans have sent in, and other pieces of interest to Pi enthusiasts. While you are checking out the blog, don’t forget to make a stop at the Official Forums.
MagPi: The Unofficial Raspberry Pi Magazine—Published around eight times a year, MapPi is a free and polished electronic magazine for Pi hobbyists.
Raspberry Pi Disk Images—Experimenting with Raspberry Pi distributions is as simple as grabbing another cheap SD card and loading it up with a fresh image. Raspberry Pi Disk Images is a handy index of current Pi-friendly Linux and Android distributions.
eLinux.org’s Verified Peripheral List—Although we mentioned this one earlier in our tutorial, it’s worth mentioning again. If you are trying to figure out why an existing piece of hardware won’t work with the Pi or would like confirmation that a piece of hardware you’re looking at will likely work with your Pi, it’s an invaluable resource.
Have a Raspberry Pi project to share? Have a request for a Pi-oriented tutorial? Shoot us an email at email@example.com or sound off in the comments.