Modern Warrior School

Portable EmComm Server – Initial Setup

Now that we’ve laid out a plan for what we want to do with the server, its time to get things set up. In this segment, we will flash our operating system to the Pi’s SD card, and do some basic startup procedures to lay the groundwork for our cluster’s PXE configuration.

Laying the Foundation

Even at the beginning stages of this project it’s essential to outline what exactly we hope to accomplish.

For now, our primary goal is to flash an OS onto our master boot node which will become the nerve center for our cluster. Afterwards we will enable VNC (unless you are using an OS without a GUI) so that we can remotely connect and interact with our server’s desktop environment. After a couple minor tweaks, we will save a backup and prepare to set up PXE in an upcoming article.

Flashing the OS with Raspberry Pi Imager

The first thing we need to do is flash the operating system we want onto the Raspberry Pi’s Micro SD card. To do this we will be using the Raspberry Pi Imager tool. To install the Imager, open a terminal and enter the following commands.

sudo apt update && sudo apt upgrade

sudo apt install rpi-imager

Now you should see the RPi Imager tool in your applications menu. From here we can go ahead and select the operating system we want to use on the Pi. In my case, I originally wanted to go with Ubuntu 24.04.1 (found under “Other General Operating Systems”), primarily since I’ve been using Ubuntu for several years and its compatible with just about any application I’ve needed to use with it. 

But as I kept running into issues trying to get it to connect to my router, I ended up going with Raspberry Pi OS which fixed all my problems without any real limitations. Just be aware that you may run into more roadblocks if you decide to go with a different OS.

Before we click “Write” to create our bootable SD card, there are a few more advanced settings we can check out by pressing [Crtl] + [Shift] + X.  Here we can configure our wireless network and set up SSH. This streamlines the setup process for a headless configuration. Once you have everything filled out, go ahead and hit “Write”. For me, it took about 20 minutes to finish the installation onto the SD card, but this may vary depending on your internet speed.

Connect Via SSH

Since we will be running this as a headless unit we’ll need to connect via SSH. We’ve already enabled SSH on our Pi in the last step, but to connect to it we will need to know it’s IP address. To do that, we will install a program called arp-scan to our local device.

sudo apt install arp-scan

sudo arp-scan –localnet

Since I already had a bunch of devices hooked up to my normal router, I set up a fresh one with just the Pi and my local machine to make finding the correct IP easier. Once we’ve determined which device is our Raspberry Pi, we can go ahead and SSH into it using the following command on our local machine.

ssh pi@(ip_address)

Setup & Start VNC

VNC will allow us to not only perform remote administration on our server via the terminal, but also allow us to interact with the desktop environment we just installed as if it were on our local machine. First use SSH to reconnect to the Raspberry Pi, then do the following.

sudo raspi-config

Interface Options > Enable VNC

Now we can start VNC on our Raspberry Pi.

sudo systemctl start vncserver-x11-serviced

Next, we will want to install a VNC viewer on our local machine if one isn’t already installed. I’ll be using TigerVNC due to its simplicity, though you could also use something like Reminna.

sudo apt install tigervnc-viewer -y

Now simply open TigerVNC and input the IP address of the Pi. You will be prompted for the username and password for your Raspberry Pi and after completing these fields, a window will open with your Pi’s desktop. 

Optional: "Version" File

Due to the scope and complexity of this project, I decided I needed some kind of version control. By having a simple text document on the desktop, I could always reference where I left off when restoring from a backup and remind myself what still needs to be done.

For version 0.1.1, this is what my current “version file” looks like:

29 November 2024

[X] Installed security monitoring script and firewalls

[X] Installed Yacy on boot-node via docker

[X] Static IPs and hostnames

[X] Installed OLED status indicator script

[ ] Finalize PXE boot

Known Bugs

PXE hangs at first bot wizard

Next Version (v0.1.2)

File system overlays for the nodes

Backup Procedures

Backups are essential for obvious reasons. Whether troubleshooting software conflictions or in the event of an SD card crashing, being able to roll back to a previously known to work version can save a ton of headaches. Luckily, Raspberry Pi OS makes it extremely simple to perform backups with the integrated SD Card Copier Tool.

Simply open the SD Card Copier from the main menu (under Accessories) and select both the device you wish to copy and the device you are trying to copy to. Keep in mind that this will overwrite the device you are copying to, just like when you flashed the OS onto your original SD card or flash drive. If you are unsure of the path to each device, you can run lsblk in the terminal to list the connected devices. After selecting the appropriate devices, simply hit the Start button to start the backup process.

We may develop a more refined backup script in the future, but for now, the SD Card Copier is a lifesaver.

Conclusion

And like that, we’ve installed Raspberry Pi OS onto our Raspberry Pi 5, set up SSH and VNC, and gotten our feet wet with a few command line utilities. Stay tuned as we continue setting up our cluster server, but beware – things only get more complex from here on out. Don’t forget to check out our YouTube channel as we will be posting regular videos to our channel on the build process.

Leave a Reply

Your email address will not be published. Required fields are marked *