Immutability: The Future of Linux

post-thumbnail

A look at two similar and one unique implementation of application containerisation and immutability in the Linux ecosystem.

post-thumbnail

One of the first big problems that many new Linux users encounter is when they break their system while trying to add or remove applications, when they don't understand the impact on other installed dependencies. A popular example of this is tech YouTuber Linus Sebastian breaking his system while trying to install Steam.

However, with increasing Linux adoption for personal desktops and workstations, there has been an advent of new Linux distributions which isolate the base system from user-installed applications to eliminate breakage and create repeatable (if not reproducible) systems. In this post, I try to understand and explain three popular Linux distributions which champion immutability and reproducibility using two different approaches.

Application Containerisation

post-thumbnail

Docker and Kubernetes, industry-standard tools for creation and management of containerised applications, have made the concept mainstream in the application development space. Red Hat and SUSE brought these principles to operating systems with the Project Atomic and openSUSE Kubic respectively, which have now been retired and replaced by Fedora CoreOS and openSUSE MicroOS respectively. These systems have also been adapted for desktops and workstations.

post-thumbnail post-thumbnail

Fedora Silverblue

post-thumbnail

Silverblue was first presented as an official spin of Fedora Workstation in October 2018 with the release of Fedora 29. While both distributions are identical in appearance, the distinction between Silverblue and Workstation can be explained in three parts - the base system, GUI applications and command-line applications.

The base system uses rpm-ostree, a packaging system created by combining libostree with Fedora's package manager DNF. The system update mechanism is atomic, i.e. a new image is generated and applied. This allows users to choose from multiple images to boot into, and also rollback easily to the last working state in case of any failure during updates. The base system is intended to be identical by default in terms of packages present, but Silverblue also provides the flexibility of layering packages over the base system.

For installing GUI applications, Silverblue recommends Flatpak, a universal package manager which creates a sandbox comprising of the installed applications and their dependencies separate from the base system. These applications can be installed from the Fedora Flatpak registry or an abridged version of Flathub, the official advertised app store.

For command-line applications, Silverblue comes pre-installed with toolbox based on Podman, a drop-in replacement for Docker. Users can use OCI images for a minimal base to install command-line applications, and even GUI applications (although Flatpak is recommended). Fedora provides official images, and the community has created unofficial images for other popular distributions like Arch Linux and Ubuntu.

openSUSE MicroOS

post-thumbnail

The architecture (for lack of a better word) of Silverblue and MicroOS is quite similar, but the implementation is somewhat different in all three parts.

The base system of MicroOS uses their default package manager zypper under the hood but delivers atomic updates and rollback functionality by creating snapshots of the BTRFS subvolumes using snapper. Another difference is the absence of layering, thus making the base images 100% identical across deployments.

Users have complete unfettered access to Flathub for installing Flatpak on MicroOS, unlike Silverblue which provides the Fedora Flatpak registry and a curated version of the Flathub, thus limiting the application availability for the latter.

And finally for command-line containerisation tools, users also have the alternative of using distrobox which works with both Podman and Docker and provides images for more distributions, thereby seems to be less limited than toolbox.

openSUSE MicroOS is still deemed as alpha software, but it seems to edge out Silverblue with the use of standard tools like BTRFS and snapper, unfettered Flathub access and the out-of-box availability of distrobox.

Nix and NixOS

post-thumbnail

While working on his Ph.D at Utrecht University in the Netherlands (read his thesis), Eelco Dolstra created the Nix language for the cross-platform Nix package manager, which provides a way to create reproducible builds of packages and by extension, as evidenced by NixOS.

NixOS provides the same features as the aforementioned distributions, but manages them in a very different manner. It provides an immutable root file system by replacing all global system directories with the /nix/store directory which contains all the binaries and configurations for various system components in their own directories. This aids features like installing multiple package versions, atomic upgrades and rollbacks and rebasing based on changes made to the configuration.nix file, which can be used for deploying reproducible builds across multiple machines.

Apart from NixOS, the Nix language and package manager has also inspired a number of projects which take tools like Docker and Kubernetes to another level. The package repository nixpkgs contains over 40,000 packages built for Linux and MacOS. However, NixOS is meant for the more advanced users and comes with a steep learning curve involving understanding this domain-specific expression language.

Final Thoughts

Linux and Unix based operating systems based on the immutability principle are making the experience more user-friendly for non-tech inclined users who want a just works system and advanced users who desire granular control over the system without the risk of data and other losses. I personally have been using Fedora Silverblue for the last three months and it has been an Adwaita experience. I am getting to learn more thanks to people like Jorge Castro who writes almost exclusively about these systems on his website.

Installation Experiment: Trying Debian Distros

post-thumbnail

A small non-meaningful experiment to understand the difference between different Linux distributions created from the same base.

post-thumbnail

Thanks to minor hardware upgrades to my old laptop, I have gotten the confidence to venture a little further into the Linux space. I haven't successfully installed Arch Linux in the traditional way yet, nor have I moved to a window manager from a desktop environment. But I believe I can identify things which could go wrong and avoid them.

Before the hardware upgrade, despite using different distributions at different points in time, I mostly used the XFCE desktop sans the "goodies", i.e. the additional plugins and applications packaged with the base system. Using that as the foundation, I decided to conduct a small, non-meaningful experiment to understand how distributions with the same foundation handle package management differently. The problem statement was pretty simple -

Install four Debian-based distributions using the non-GUI installer for the base system and the terminal for a minimal XFCE desktop; and compare the package count and cold boot RAM usage.

Choosing The Distributions

Debian is one of the oldest actively developed Linux distributions, and has been the most popular choice for first-order and second-order derivative distributions which could be used both for servers and desktops.

post-thumbnail

Ubuntu might probably be the first Linux distribution installed by new Linux users at least in the last decade. While Debian is a community project, Ubuntu is commercial-first and has been partnering with big tech organisations like Microsoft to improve cross-platform compatibility.

post-thumbnail

Devuan is a Debian derivative which does not use systemd, the most popular init system on Linux; and offers alternatives like sysvinit, openrc and runit for the same.

post-thumbnail

Trisquel GNU/Linux is an Ubuntu-based libre distribution with completely open source software, i.e. it removes all proprietary blobs of code from the kernel and other packages (if any). As a result, it is one of the few Linux distributions approved by the Free Software Foundation.

post-thumbnail

Installation Process

There were two parts of the installation process - the base installation and the minimal XFCE installation. For the first part, I decided to use the net install ISO images which come with the TUI menu-based Debian installer. These images were readily available for Debian 11 Bullseye, Devuan 4 Chimaera and Trisquel 10 LTS Nabia; however, Ubuntu had a different process altogether which led to a discovery.

Since April 2020, Ubuntu offer their own server install images for setting up the base installation. Prior to this, they released unofficial net install images with the Debian installer. I managed to locate the image for 18.04 LTS Bionic Beaver, used it for the base installation and then upgraded first to 20.04 LTS Focal Fossa and then to 22.04 LTS Jammy Jellyfish.

For the second part, I discovered a Github repository with an installation script for a minimal XFCE desktop. I installed the packages present in the script along with a few others I use to setup the desktop on all four distros.

Findings

The Debian installation had the lowest package count and second lowest cold boot RAM usage among the four distributions, while Devuan switched places with Debian in both categories. Both installations also took the least time, with the only additional step of selecting the init system in the Devuan installation process.

post-thumbnail post-thumbnail

Ubuntu took the longest time to install because of the two upgrades, but I was able to get a system completely devoid of snap packages. The installation was joint third in terms of package count and third in cold boot RAM usage.

post-thumbnail

Due to package dependency management differences, my Trisquel installation ended up with GNOME components as well which I had to uninstall. Once those were removed, the resultant system had the same number of packages as Ubuntu and the highest cold boot RAM usage.

post-thumbnail

Final Thoughts

Package count and RAM usage don't really mean much unless there are severe storage and RAM limitations, but using individual packages rather than metapackages can help preventing the installation of packages and dependencies which don't get in the way of your applications, and reduce the possibilities of borking the system.

Also, libre distributions don't really make much sense at this moment. In fact, most users wanting to install them on hardware from mainstream hardware manufacturers will fail as most firmware tends to be proprietary. However, this speaks more to the manufacturers' apathy for open source rather than the distributions themselves.

post-thumbnail

Vim: An Unconventional Favourite Product?

An attempt to analyse Vim from the lens of a product management framework by a failed aspiring product manager, because why not?

What is Vim?

Vi Improved aka Vim is a free and open source command-line modal text editor created by Bram Moolenaar in 1991, as a fork of the Vi text editor present in the UNIX operating system. Vim is primarily a desktop application installed by default on macOS, available for all versions of Linux and also for Windows. While Vi was a minimal text editor primarily meant to be used with just a keyboard, Vim has added mouse support and the ability to extend its functionality through plugins.

Competitors

Vim can be anything based on how it is extended and configured, and hence it's competitors include simple text editors like Notepad, advanced ones like Notepad++ and Sublime Text, format-specific ones like Obsidian and IDEs like VS Code, IntelliJ and PyCharm.

Users

Casual users: They use Vim as offered out of the box, without making any changes to the default configuration. This could either be because they are new and haven't explored the app completely, or they use it for very basic tasks which does not require them to know all the functions.

Power users: They have specific workflows and therefore aim to maximise productivity by modifying the default behaviour, and extending the functionality. These could include software developers, academicians, screenplay writers among others.

Plugin maintainers: The extensibility of Vim using its programming language Vimscript has led to the formation of a community of plugin maintainers who have created and maintained plugins for specific applications like syntax highlighting, code linting etc.

Pain Points

Casual users: Vim has a steep learning curve compared to other text editors. Many new users find it difficult to even exit Vim, to the point that it has become a meme. Therefore, Vim does not offer more utility than any other simple text editor.

Power users: Plugins are the easiest way for users to tune the application as per their utility. However, too many plugins tend to make Vim less performant, which is undesirable for such a light-weight application.

Plugin maintainers: Vimscript does not have any application beyond Vim and is also not as powerful and performant as multi-purpose programming languages, and hence is a major limiting factor in terms of expanding functionality, improving performance and maintaining compatibility with newer versions of Vim and Vimscript.

Solutions

Display basic keyboard shortcuts at the bottom of the screen by default, and thereby make the learning curve less steep for casual users.

Add a noob mode for new users with common keybindings like Ctrl+S to save and Alt+F4 to exit.

Enable support for creating Vim plugins with common programming languages like C or Python to improve performance and ease of maintenance for plugins.

Metrics

Vim is a community project, and is primarily used on Linux, where tracking is looked down upon. Sure, we could track total downloads by consolidating numbers from various Linux distributions, but that's where it ends. As a result, it is almost impossible to define and track metrics for various stages of the UX funnel. What could be a viable alternative to measure success?

Academic Arch: An ArcoLinux University Overview

ArcoLinux takes a unique approach by creating a learning path for going from a beginner to an advanced Arch Linux user. But does it really matter to users?

Arch Linux is an advanced Linux distribution and also has some elitism and gatekeeping associated to it. However, it is quite popular among a lot of desktop Linux users for the ease and freedom of customisation. As a result, there are 22 actively maintained Arch-based distributions, starting from old distributions like ArchBang which was created 12 years ago to recent ones like Garuda and Archcraft which were created in 2020.

While all distros in this list provide graphical installers, some of them have unique features. Manjaro Linux uses their custom repositories to deliver upstream packages with a delay after testing. Artix Linux replaces init system SystemD with OpenRC, and Parabola and Hyperbola ship alternatives for packages with proprietary blobs of code.

Belgium-based teacher Erik Dubois had a completely different idea in mind. After working with the core team of Archlabs Linux for a few months in 2017, Erik created ArchMerge which was inspired from a version of Archlabs he had created. He conceptualised a learning path which new Linux users could follow to become advanced users capable of creating an ISO image of their version of Arch Linux, created after installing the packages of their choice and modifying the system by applying themes and enabling background and foreground processes. After the inception in late 2017, the project was renamed as ArcoLinux in March 2018.

In its current form, ArcoLinux has become a set of multiple flavours of an Arch-based Linux distribution. The first flavour is ArcoLinuxL, a pre-configured distribution with the XFCE desktop environment and a host of pre-installed applications. The second flavour ArcoLinuxS comes with a pre-configured XFCE desktop but without the pre-installed applications. It offers the choice of installing the mainline Linux kernel with ArcoLinuxS, or the stable LTS kernel with ArcoLinuxS-LTS. The third flavour ArcoLinuxB provides users the option to choose from a list of 26 desktop environments and window managers, or install all of them with the Xtended ISO. The installer in the ArcoLinuxB ISOs also provides granular control to users in terms of choice of applications to be installed. The final flavour ArcoLinuxD is close to the Arch Linux ISO but with a graphical installer which can help the user install a minimal system easily.

Additionally, there are other ISOs aimed at helping people wanting to create custom Arch-based distributions. However, the current focus of the ArcoLinux team is a program named Arch Linux Tweak Tool, which provides a graphical interface to users for performing a multitude of tasks like installing and removing DEs or WMs; installing, enabling and configuring display managers and modifying other aspects of system behaviour like wallpapers and bootloader background images.

Information about the distribution is disseminated through the websites for the individual and Erik's YouTube channel where he regularly posts videos with information about the latest developments in the project. Erik is also pretty active in the Discord and Telegram group for the distribution. However, the clumsy structure of the websites created using WordPress seem to dissuade a lot of potential users, with people finding it difficult to navigate to the download links which are also on multiple websites depending on the flavour. YouTube videos are definitely useful as guides for installing or maintaining Linux distributions, but navigating to the right video in a sea of close to 4000 videos is difficult, and there can be no assurance of finding one that solves the exact problem that the user is facing.

Therefore, while Erik's passion is definitely commendable, some changes need to be made to the way the website and Github repositories are handled. This will make the project more welcoming for users to try and contribute to, and even reduce the maintenance efforts of the core team.

Domestic Distros: Linux Made in India

An overview of 3 actively developed Linux distributions from India, and trying to answer the question 'Do we need more?'

Since the early 90s thousands of Linux distributions have been created, and many of them have ceased to exist when development was stopped due to lack of interest or funding. As per Distrowatch there are close to 300 active distributions at the moment. When I looked up distributions originating from India, the number came out to be 19. After checking out all their websites, I found that only 3 were being actively developed at the moment -

BOSS Linux

Bharat Operating System Solutions aka BOSS Linux was created by the Centre for Development of Advanced Computing (C-DAC) which falls under the purview of the Government of India's Ministry of Electronics and Information Technology. Boss Linux is based on Debian and comes in three versions - Desktop for the regular desktop users, EduBOSS for educational institutions and Server for server deployments.

BOSS Linux has been around for a long time and was even authorised to be installed in their offices by the Tamil Nadu state government way back in 2011. The distribution also has additional applications with localisation, thereby improving ease of adoption. However the adoption doesn't seem to have taken off as expected, and the number of six million deployments advertised on the website is pretty miniscule for a country like India. I also came across an old Reddit post saying that the version of BOSS Linux used by the Army and Navy was hacked, which doesn't really inspire confidence.

Linux has the reputation of giving a new lease of life to old hardware, and a distribution like BOSS Linux which comes with India-specific utilities could prove to be a great operating system to be used in public schools and government offices instead of having to spend so much money on buying Windows 10 (and now Windows 11) licenses and upgrading hardware to ensure that Windows would run well. With some work on the website and a bit of active outreach efforts, this process could definitely be set in motion.

Garuda Linux

Garuda Linux was created in 2020 by a team of 20-odd people hailing from various countries, led by a 24 year old software engineer Shrinivas Vishnu Kumbhar from Kolhapur. Garuda uses Arch Linux as the base and is focused on improving the gaming experience on Linux with its performance tweaks and tools for installing and managing games. It uses the Chaotic AUR, a curated repository of pre-compiled packages, along with the original Arch Linux repositories.

Garuda has flavours with the six most popular desktop environments - GNOME, KDE Plasma, MATE, Cinnamon, XFCE and LXQt; and three window managers - Sway, Qtile and i3. They also offer a special version with a customised KDE desktop which is aimed towards eye-candy appearance.

Archcraft

To describe this distribution in the words of its creator Aditya Shakya -

Archcraft is just another Linux distribution, made on top of Arch Linux. It uses window managers and lightweight applications, which makes it super fast. With pre-configured settings, Archcraft provides you the best out of the box window manager experience.

Archcraft comes with seven window managers pre-installed - DWM, i3, XMonad, Herbstluftwm, Berry, Fluxbox and Sway. All these window managers are pre-configured with custom themes which can be changed with a few clicks, and with custom keybindings for launching and managing applications. Aditya has also created pre-configured and pre-themed versions of a few more window managers. However, the users wanting to install these have to pay a nominal amount to download the necessary files. This has led to some criticism, with people saying that it goes against the FOSS philosophy. However, Aditya is using it as an additional avenue along with donations to pay for the infrastructure to maintain the package repositories.

Parting Thoughts

Creating a Linux distribution is difficult, but maintaining it is a lot more difficult. That difficulty increases further when the maintainers do not have any steady financial support and have to work on the project alongside their regular day-jobs. Therefore it might be possible that Garuda and Archcraft stop being maintained some time in the future, and they might get replaced by a new distribution. But I really hope that BOSS Linux finds a lot more traction than it has right now. It could prove instrumental in increasing longevity and eliminating licensing and maintenance costs for software.

Linux Learnings: My First 5 Linux Milestones

A summary of my 18 month long Linux journey, remembering past milestones and setting future goals.

The first computer I ever used was a Windows XP machine at school. While some friends had computers at home, I had to rely on cyber cafes for a few years before I forced my parents to buy me my first laptop right after school. I used this Windows 7 machine for a decade through college and during my first job, before it finally gave up a few months into my post-graduation. I was too busy to get it repaired right away so I just bought a new Windows 10 machine, and finally got to it only a couple of years later. It took me no time to realise that the laptop was not able to handle Windows 10 and even the original Windows 7, and that is where my journey with Linux began.

#1: My first Linux installation

I got the idea of installing Linux from a friend who had bought this very laptop around the same time as I had. I hadn't even burnt a Windows CD or bootable USB so I was a complete noob when it came to installing any operating system on my own. After discussing with this friend who used to work with Red Hat at the time, I looked up Linux Mint and ended up on their website.

I found a YouTube video and followed all the steps to download the ISO image, create the bootable USB and choose the right options in the installer, and to my surprise I got it installed successfully in the first attempt itself!

#2: Distro-hopping and landing on Lubuntu

The user interface provided by the Cinnamon desktop environment seemed pretty similar to Windows, so I was able to start doing basic stuff in no time. However, Cinnamon is on the higher end in terms of resource usage, and that would quickly become evident when I opened multiple applications simultaneously. Thankfully, I soon discovered that Linux Mint has another version with the lightweight XFCE desktop. I switched immediately and the improvement in the experience was evident right away, as the RAM usage got halved with XFCE.

In simple terms, a desktop environment (DE) is a set of programs which enable the use of a graphical user interface (GUI) on a Linux distribution. Google helped me understand that Cinnamon, the default DE offered by Linux Mint, is one of the more resource-heavy ones. A few more searches later, I found out that XFCE is a lightweight DE and consumes much less resources than Cinnamon. Fortunately, Linux Mint also offers a XFCE edition, which I installed immediately.

I was able to reduce the footprint further by uninstalling the apps I didn't use, but I wanted to check out if there was anything lighter. That is when I found Lubuntu, which used the minimal LXQt desktop environment. Switching to Lubuntu was also quite easy because it is an official flavour of Ubuntu, which is the most popular Linux distribution and is also the base for Linux Mint and many other distributions. The switch from LXQt to XFCE helped me reduce RAM usage by another 40%, with a measly 259 MB RAM usage on a fresh boot!

#3: I use Arch btw!

Lubuntu was working perfectly for my workflow so it stuck with it for more than 5 months. During this period, I discovered multiple Linux sub-Reddits, YouTube channels and podcasts and that helped me learn about various Linux distributions, their similarities and differences. One Linux distribution which piqued my curiosity was Arch Linux. Unlike Linux Mint, Arch is an advanced distribution which allows the user to install a base system using a text-based command line and then customise the experience by adding components of their choice. The Arch wiki which contains information about installing and maintaining Arch Linux is considered the best documentation source for a Linux distribution, so much so that it can help you debug issues with other distributions too!

My first attempt at installing Arch Linux was unsuccessful as expected, so I thought of choosing an easy-to-install Arch-based distribution like EndeavourOS or using an automated installation script like ArchTitus. This is when Arch Linux announced the inclusion of archinstall, their own automated installation script written in Python. As with Linux Mint, my first attempt at Arch Linux using archinstall was successful, and I got a fully functional desktop running in less than an hour!

#4: Installing Linux inside Windows with WSL2

The direction taken by Microsoft after Satya Nadella took over meant that there were a lot of positive yet unexpected products getting introduced. One of them was the Windows Subsystem for Linux, which allowed users to install a Linux distribution within their Windows installation. While WSL utilised a translation layer between both operating systems, WSL2 utilised a virtual machine with a Linux kernel as the base, and therefore you could just install core utilities provided by the distribution of your choice and start working.

I started by installing Ubuntu on WSL, but I was unable to upgrade to WSL2 so I had to uninstall a couple of months later. I decided not to use WSL at all and tried to uninstall it as well, but ended up getting WSL2 (Microsoft doesn't seem to like it when you uninstall some programs). The improvement from WSL to WSL2 was pretty confidence inspiring for me, so I decided to stick with it. Thanks to WSL2, I am currently running three Linux distributions within Windows - Gentoo, Void Linux and Fedora.

#5: Trying out advanced Linux distributions

While popular Linux distributions make a lot of choices in terms of the components used to build on the base that is the Linux kernel, there are many advanced distributions which allow users to choose less common but more optimised replacements for these components.

Users installing Gentoo have to compile packages instead of using pre-compiled binaries, and therefore can optimise them to the specifications of their own system. Void Linux provides an alternative init system (which controls background and foreground processes running on an operating system) and an alternative standard library used for the compiler toolchain. Alpine Linux, takes it deeper by providing alternative core utilities and bootloader (used to identify the install operating system) along with the aforementioned components.

I was able to get Gentoo and Void running on WSL2 immediately, and replaced Arch Linux with Alpine Linux on my second laptop for some time before I went back to Arch.

What Next?

I just got two 4 GB RAM sticks delivered for my old laptop as I write this post. With the RAM upgrade, I hope to try out more Linux distributions, desktop environments and applications. The ultimate objective is to move completely to Linux, which might not happen until I find a convincing replacement for Microsoft Office. Hope I can inspire you to try it out!