First step to building a Raspberry Pi 4 desktop computer that you can use as a full time PC. Hardware list:
- Raspberry Pi 4
- Pi 4 case and power supply
- 2.5″ Hard Drive, preferably SSD
- Micro SD card, minimum 4GB
- Keyboard and mouse, TV/computer monitor
Step 1. Buy a Raspberry Pi 4 with 4GB minimum, 8GB models are out there. Simple right? They are sold in various places, including eBay, Amazon, Microcenter, etc.
I have no affiliation with any seller and don’t care where you buy it.
Step 2. Get a nice case. There are many out there and I have purchased (wasted money!) on many. This is the one I’m using now from Geeekpi and I love it because it spreads out the ports, puts them in the back like a real desktop and has full size HDMI ports.
Step 3. Next, you will need a hard drive case, a 2.5″ hard drive, and a cable to connect the drive. I recommend this case, which also includes the USB C cable:
Any 2.5″ hard drive will work but your mileage will be greater with a 7200 RPM hard drive or an SSD drive by Samsung, Segate or Western Digital.
Step 4. You will also need a micro SD card for the initial setup. Because initially space isn’t a big deal, you only need a 4GB card, so anything you have laying around will probably work but if you are going to repurose the card later, or use for a backup Pi system (recommended), a nice 128GB micro SD card by Sandisk would be perfect.
Step 5. Also needed is something obvious that you likely also have lying around – a keyboard and mouse and a monitor to display your system.
The Operating System
You will need to flash the Raspberry Pi OS on your SD card. To do this, download Balena Etcher, which is available for Windows, Mac OSX and Ubuntu.
You will also need to download the Raspberry Pi OS image here. Download the 32-Bit image with Desktop (not the Lite version).
Here’s a tutorial on flashing the Pi OS image with Etcher.
Pi 4 Firmware update that allows USB booting
Boot up your new Pi OS image using the SD card in your Pi 4 and make sure your USB drive (hard drive, flash drive, or SSD) is connected. Follow the new user prompts. Open a terminal and type the following commands (sudo password is usually “raspberry”):
sudo apt update sudo apt full-upgrade Sudo nano /etc/default/rpi-eeprom-update
Change the FIRMWARE_RELEASE_STATUS value from “critical” to “stable.”
sudo rpi-eeprom-update -d -a
Verify firmware date. Open a terminal and type:
Should output a firmware with a recent date.
Power down your Pi 4 because it’s now ready to boot Raspberry Pi OS from a USB drive!
Go back to your PC.
Use PC/Mac to flash Raspberry Pi OS image to USB drive using the Balena Etcher guide.
Now, mount the SD card you setup to your PC.
Copy all .dat and .elf from existing Pi OS SD install’s boot directory to the boot directory of new USB drive.
Leave the SD card out of your Pi 4 and attach the new USB drive with the new Raspberry Pi OS and boot it. Your Raspberry Pi 4 should now be equipped with a bootable USB drive with the advantages of faster speeds, higher reliability and more storage!
Now that you have a working system, it’s time to install some useful programs. Open up your terminal and type in the following commands for the programs you may find useful:
Before you install anything, update your system in the terminal.
sudo apt update sudo apt upgrade
obconf (for multiple desktops)
sudo apt install obconf
>>>Right-click taskbar, Add/Remove Panel Items, Add, “Desktop Number / Workspace Name”
Rhythmbox (Swiss Army knife of an audio program)
sudo apt install rhythmbox
VLC (another great audio program)
sudo apt install -y vlc
abcde (CLI/Terminal CD ripper)
sudo apt-get install abcde lame eject id3 id3v2 eyed3 normalize-audio vorbisgain mkcue mp3gain libdata-dump-perl flac
One single FLAC file:
abcde -1 -o flac -a default,cue
Pulse audio (manage sound-cards)
sudo apt install pulseaudio sudo apt install pavucontrol
7zip (7z compression)
sudo apt-get install p7zip
Sound Juicer (CD ripper)
sudo apt install sound-juicer
Filezilla (FTP/SFTP program)
sudo apt install filezilla
Transmission (Bit Torrent program)
sudo apt install transmission
Private Internet Access (PIA) (Commercial VPN)
sudo apt-get install openvpn cd /etc/openvpn wget https://www.privateinternetaccess.com/openvpn/openvpn.zip sudo apt-get install unzip sudo unzip openvpn.zip Find the VPN server you wish to connect to. Look for a .opvn file that matches the desired location: ls -l Connect to the server. You will need to enter in your username and password. Example: sudo openvpn US\ Chicago.ovpn Optional: Save your password in a text file so you don't need to enter credentials each time sudo pico /etc/openvpn/pass.txt In the text file, on the first line, type your username. Second line, your password. ^X (save) Now, type "auth-user-pass pass.txt" at the bottom of the desired VPN server file. Example: sudo pico US\ Chicago.ovpn ^X (save) Next time you want to connect: cd /etc/openvpn sudo openvpn US\ Chicago.ovpn
Meld (compare two files or directories)
sudo apt install meld
gparted (Disk utility)
sudo apt install gparted
Audacity (record audio)
sudo apt install audacity
Brasero (CD writer)
sudo apt install brasero
kid3 (mp3/FLAC tagger)
sudo apt install kid3
lynx (CLI/Terminal web browser)
sudo apt install lynx
Midnight Commander (CLI/Terminal file manager)
sudo apt install mc
fre:ac (snap program/CD burner, mp3 or FLAC file converter)
sudo apt install snapd sudo snap install freac
Telegram (snap program/social media)
sudo snap install telegram-desktop
sudo apt-get install traverso
Simple Screen Recorder (useful for making youtube videos!)
sudo apt-get update sudo apt-get install simplescreenrecorder
Kdenlive video editor (video editor)
sudo apt-get install kdenlive
Retropie (all the retro game systems on your pi!)
sudo apt-get install git lsb-release cd git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git cd RetroPie-Setup chmod +x retropie_setup.sh
Once the system is installed, you will need to run the script and install the base programs.
Run the program in a terminal:
From there you will need to configure a joystick. After that, after a little trial and error, you will be up and running. 🙂
Tips and Tricks
Format a hard drive/thumb drive/sd card as FAT32:
Install the Raspberry Pi Imager: sudo apt install rpi-imager Run the program from the menu: /Accessories/Imagre From the 'Operating System' tab, choose Erase, Format card as FAT32 From the SD Card tab, choose the right card (!) Select 'Write' and let the magic begin. *This is also an excellent tool to create a variety of bootable Raspberry Pi OS installs on your media
Measure CPU Temperature:
cat /sys/class/thermal/thermal_zone0/temp cpu=$(</sys/class/thermal/thermal_zone0/temp) echo "$((cpu/1000)) c"
Measure GPU Temperature:
sudo /opt/vc/bin/vcgencmd measure_temp
Write a program to measure temperatures:
#!/bin/bash # Script: my-pi-temp.sh # Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3 # Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+ # Script revised by Brian Shunk # ------------------------------------------------------- echo "Temperature of GPU and CPU" cpu=$(</sys/class/thermal/thermal_zone0/temp) echo "$(date) @ $(hostname)" echo "-------------------------------------------" echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)" echo "CPU => $((cpu/1000))'C" echo "Complete. Press return to exit" read dummy
Turn off on-board wifi (for phone data sharing)
sudo ifconfig wlan0 down
sudo apt-get install bluez* sudo systemctl enable bluetooth sudo systemctl start bluetooth or sudo service bluetooth restart && sudo service bluez restart or pulseaudio --start
Add a user to list of sudoers
sudo adduser <username> usermod -aG sudo <username>
Add a program to the menu:
Preferences/Main Menu Editor/New Item
Add EXFat Support
sudo apt-get install exfat-fuse sudo apt-get install exfat-utils
CAD on the Raspberry Pi 4
Close all programs, open your terminal and type:
sudo apt install cmake build-essential libtool lsb-release swig libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-serialization-dev libboost-signals-dev libboost-thread-dev libcoin-dev libeigen3-dev libgts-bin libgts-dev libkdtree++-dev libmedc-dev libopencv-dev libproj-dev libvtk6-dev libx11-dev libxerces-c-dev libzipios++-dev qt4-dev-tools libqt4-dev libqt4-opengl-dev libqtwebkit-dev libshiboken-dev libpyside-dev pyside-tools python-dev python-matplotlib python-pivy python-ply python-pyside libocct*-dev occt-draw libsimage-dev doxygen libcoin-doc dh-exec libspnav-dev
Download the FreeCAD source code:
wget https://github.com/FreeCAD/FreeCAD/archive/0.18.4.zip unzip 0.18.4.zip rm 0.18.4.zip mkdir freecad-build cd freecad-build
Compile the FreeCAD source code:
cmake -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython2.7.so -DPYTHON_PACKAGES_PATH=/usr/local/lib/python2.7/dist-packages/ ../FreeCAD-0.18.4/ make -j8
Run the program from here:
Spacenavigator/3D Connexion/Space mouse support for freecad
sudo apt-get install spacenavd sudo cp ~/.Xauthority /root/ sudo /usr/bin/spnavd_ctl x11 stop sudo /usr/bin/spnavd_ctl x11 start
Once you start FreeCAD, right click in the center of the screen.