Rediscovering Puppy Linux as Raspup on the Raspberry Pi
Having recently decided to restart my quest on using more of my Raspberry Pi, I found myself on the distro-hopping road again to find the perfect one that could make a nice compact desktop out of it. The marketing hype will have you believe it's a tiny but complete, full-fledged PC that will (starting with Model 4 and the 4GB+ RAM) kick butt of even big desktops, at a fraction of the cost and the power consumption.
I have found these claims to be very hard to materialize, starting with the question about the OS itself: what distribution can truly maximize the limited resources of this borderline embedded computer so that one can add peripherals and have the machine behave like a desktop? This is where the distrohopping trial-and-error magic comes to play, with all and any fun that this might include. What could be a lightweight enough, flexible enough and disk-preserving that could make optimal use on the Raspberry Pi?
Looking to answer this question the best possible way, I found myself again trying out Puppy Linux.
I'm no stranger when it comes to Puppy Linux because it was one of the first distros I've used after discovering the world of Linux. At the time, it really blew my mind that one could download a CD image from a website, copy it onto a USB stick and voila, an entire Linux desktop was yours to command, without even having to so much touch the computer's hard drive. Oh, and it was fast - insanely fast. Who knew that a complete RAMdisk could make even a netbook fly?
But even as magical and transforming as this discovery was, I had never truly stuck with Puppy Linux. Besides playtime experimentation or as a "polite" way of using other peoples' computers, it always felt too weird to become a daily driver thing. And with other "normal" distros being also quick and easy to use, but with a much more familiar approach, why even bother?
Last week, however, this entire concept changed once again as I dusted off my inactive Raspberry Pi 4 and thought: what if I ran Puppy 24/7 on this guy? This post outlines my discoveries and how, despite its problems and quirks, I found it to be a very candidate for a Desktop use with the Raspberry Pi.
The pros and cons of Puppy on a Raspberry Pi
Puppy belongs to the category of Linux distros intended to be used as a live medium as well as those intended for old computers or those with limited resources. Widely advertised in the early 2010s as a way to breathe new life in your old machines, it basically became a synonym with old PCs, although it can very well play with contemporary and powerful machines.
Unlike other Live Medium distros like Knoppix or Kali that store and load all the programs from the USB like a disk, Puppy loads everything it needs into RAM (using a ramdisk technology called squashfs) just once, and eveything needed in the session will already be loaded to use. This allows for a very fast and snappy desktop experience, albeit at a small cost in RAM usage.
Puppy also differs from other Linux distros in the sense that it's not (at least anymore) built from ground up or based on another distro, but rather is created by adapting and converting other existing distributions into the Puppy way, via a tool called Woof. This way, you can have "puppies" built from Ubuntu, Slackware and other base distributions. And conveniently enough, there is a also a flavor of it built specifically for the Raspberry Pi, called Raspup.
Although not at all my first distro in mind when it came to using the Pi as a desktop, my attention eventually shifted to Puppy because of following following points:
- Due to the "load-from-RAM" operations, Puppy greatly reduces the wear on the fragile SD cards used by the Pi. This will save costs and a lot of headache in the long run, as well as work around the pretty bad I/O speed on some SD cards.
- Puppy comes preloaded with quite a lot of software by default, so time taken to do additional config (as well as the limited space in the SD card) should be minimal.
- Unlike other minimal live systems like Alpine, Puppy is a desktop-oriented distribution, designed in every aspect to be used as one by default. This is evident by the several graphical config tools created by the developers that are simply frontends to shell scripts that do the work in the background.
Puppy is far from perfect, however, and still has some warts that make me scratch my head, including:
- You always run as root. Doing this goes against every good security practice I've ever learned in Linux, and yet, here we are running an entire desktop and all its programs as the almighty user, risking a full-system compromise if any running program gets hacked. This includes some of the system daemons as well. I'm not sure if this is to save space or what, but it does raise a brow in most users. There is a "normal" user account named spot, but for some reason you don't use it by default, only for internet-facing things like services or browsers.
- Puppy requires relatively more RAM to live in comparison to other minimal distros. Much like the Alpine diskless mode, if you install or download something new, it goes to RAM and not disk, via the squashfs. At an average of 600~800MB usage after configuration, it's simply too heavy for early Pis like the Model B with its 512 MB RAM. Not a problem for the Raspberry Pi 4, though.
- As far as I know, there is no way to completely upgrade the system (i.e. kernel and all) except via downloading a new release of Puppy and burning it again to the live medium. Point updates, or even individual software updates (like a browser or file manager) can't be done despite having a package manager available (AFAIK).
- Sometimes, having everything available as graphical programs or scripts masks the command-line tools and interfaces I rather use in my computers. Installing software with a GUI is especially painful in this regard.
Despite its problems, I still went ahead and challenged myself to live on Puppy and the Pi for as much as time as possible - and survived. Let's see some highlights from this adventure, as well as some nice lessons learned.
Setting up persistence
First and foremost, if you are going to use Puppy Linux seriously (that is, for more than just one live session), you will want to set up persistence so you don't have to reconfigure your system every time you shut it down. And if we're going to daily-drive it in this Raspberry Pi, this is a must.
Thankfully, doing this in Raspup is easy, as this feature was supported in the original Puppy Linux family from way early. To do so, request a shutdown or reboot immediately after the OS has booted up. This might sound counterintuitive, but it's actually during the shutdown dialog that you get asked whether or not you want to save the current session. Choose to save the session, pick a name for your session's savefile, and follow the rest of the instructions.
By doing so, a savefile will be created in your SD card and, from now on, it will be available to choose from in the boot menu. Always boot into that savefile from now on, and you will be able to carry over the previous session with you every time. After this, your new session can be saved during its usage without having to reboot by either clicking the Save button on the desktop, or running the command
save2flash from the shell. Your changes to the filesystem will be merged with your savefile in the SD card, and at the end of the process you will have saved another snapshot of your desktop.
You can now make backups of your session by simply copying the
session_name.sfs file found in the SD card from another computer, preferrably encrypting it as well as Puppy's built-in mechanism is self-declared as not very reliable. If you lose your SD card, you can simply burn another one and copy that
.sfs file over and start from the same point you were.
Just remember that there is no autosaving by default in the persistent session of Puppy. So either edit
/etc/eventmanager to set up periodic saves, or run
save2flash after every large transaction has taken place.
Fix the SSL certificates
As I briefly wrote in a previous quip, for some reason all the SSL certificates in Raspup are missing in a default configuration. Their location is filled with symlinks to where they were supposed to be in, but as this location points to a partition that does not exist, it simply doesn't exist.
Good thing that projects like curl maintain their own curated and updated list of root certificates. Get a copy and save it somewhere under
/etc/ssl/certs, then add the following lines to
/etc/profile so they get activated upon login:
export SSL_CERT_FILE="/etc/ssl/certs/cacert.pem" export SSL_CERT_DIR="/etc/ssl/certs/"
Without doing this, pretty much everything that isn't a browser (for example: mail applications, irssi, CLI apps, etc) will not work when attempting a secure connection, which is extremely annoying given how almost everything depends on HTTPS these days. You need to save the session and reboot to make sure they take effect.
Package management and additional software
Now that your system can be backed up and carried over forward, you can safely look for and install new software that will be available for your current and future sessions. Even though Puppy has a plethora of software that covers most use requirements, you might still want to install additional stuff that you're already used to.
For instance, I'm not sure anyone likes the default file manager (ROX Filer), and more familiar alternatives like pcmanfm or thunar are available to be installed. Likewise, the default browser (Midori) feels clunky and lacking. This is where you can use the Puppy Package Manager (ppm) to customize your experience. The trick is not to overdo it, since due to the way squashfs works, installing additional software will increase the RAM used as well. This might not be a problem in the Raspberry Pi 4 and its 4GB of RAM, but definitely needs to be considered around the 1GB mark.
I have yet to see how you can install things from the command-line with it, but there's a graphical program that feels similar to the Synaptic Package manager in older versions of Ubuntu. It's a little clunky, but with some effort you can search and install anything that you want from there.
The big exception here, however, is browsers. The project recommends using the included browser install scripts in order to do so, as they will also configure them to be run as the underpriviledged user
spot (browsing the web as root is a very bad thing to do). These scripts apparently can also update an existing browser that you previously installed, so it's pretty convenient. The scripts are named (not surprisingly):
install_chromium_gui.sh install_firefox_gui.sh install_vivaldi_gui.sh
They don't need to be run from the terminal either, as they basically launch a GUI "wizard" guiding you through the installation.
Everything going pretty well so far? Excellent. Now it's time to deal with the issues.
Even though the experience is pretty polished on the desktop for the amount of resources consumed (i.e. of course you can rice it, but can you rice it within 400MB?) I still can't quite shake the fact that we're running everything as root. I have never heard of anyone in particular having real security problems from this, but still, the feeling hangs around. Good thing we're not running servers with it... right? Coupled with the difficulty of patching or updating individual things short of burning a new image, this can indeed be worring.
In these regards, perhaps Alpine Linux is a saner alternative, especially considering that it has a very good package manager that works even over diskless mode. You do have to spend the time to get it up and running, though.
I did notice that there is some stuff specific to Raspup that seems to be lagging behind or broken in comparison. One example, Xorg: it seems that anytime you lock the screen with
xlock, the session comes back with something missing: sometimes it's the keyboard that stops working (plug it out and in and should come back, though), sometimes applications stop being able to find the Xorg display (which often means you have to reboot to fix). This doesn't happen in vanilla Puppy (fossapup at this time), however, which makes me wonder if the base difference (Ubuntu for vanilla, Debian for Raspup) has any influence in it. Or maybe, as a main project spinoff, it just hasn't been tested as much.
Finally, there's the annoyance that due to the Raspberry Pi using a proprietary Broadcom video driver, you cannot ever use Redshift to ease up your eyes in the evening. Some hacky solutions exist, but ultimately the consensus is that this is still not possible in 2021. This, however, is not something specific to Puppy Linux.
Puppy Linux definitely still has its place alongside the heavy hitters today, especially considering the market for old or less powerful machines. On the Raspberry Pi, the Raspup variant is a good way to get the Puppy experience in your Raspberry Pi and, if you have more than 1GB RAM, a full desktop complete with office and browsing is a reality with it.
As a daily driver, however, it would probably require above-average patience and comprehension to acommodate for its quirks. Namely, you have to learn to do things the Puppy way, try to make more use of the builtin tools and programs and be ready to accept some of the things that break regardless - especially if you're using Raspup instead of mainline Puppy Linux. And be aware that you're always root down there.
With that said, I will be keeping an eye out for Puppy and include it alongside my daily carry with a persistent session. Perhaps when I revisit it further down the road it will have matured into a nice daily-driver, especially for those with SD cards!
Have you ever seriously used Puppy Linux (as in, more than just one live session)? How was your experience? What OS do you use in your Raspberry Pi as a desktop? Let me know on Mastodon!
This post is number #27 of my #100DaysToOffload project. Follow my progress through Mastodon!
Last updated on 09/01/21