- cross-posted to:
- [email protected]
- cross-posted to:
- [email protected]
Immutable distributions are slowly spreading across the Linux worldā but should you care? Are they hacker friendly? What does āimmutableā mean, anyway?
Immutable means ānot subject or susceptible to changeā according to Merriam-Webster, which is not 100% accurate in this context, but itās close enough and the name is there so weāre stuck with it. Immutable distributions are subject to change, itās just that how you change them is quite a bit different than bog-standard Linux. Will this matter to you? Read on to find out! (Or, if you know the answers already, read on to find out how angry you should be in the comments section.)
Immutability is cloud-based thinking: the system has a known-good state, and itās always in it. Everything that is not part of the core system is containerized and controlled. Iām writing this from a KDE-based distribution called Aurora, part of the Universal Blue project that builds on Fedoraās Atomic Desktop work. It bills itself as being for ālazy developersā.
The advantage to this hypothetical lazy dev is that the base system is already built, and you canāt get distracted messing around with it. It works, and it isnāt at all likely to break. Every installation is essentially identical to every other installation, which means reproducibility is all but guaranteed. No more faffing about arguing on forums to figure out which library is conflicting with which. In an immutable system, theyāve all been selected to play well together, and anything else is safely containerized. (Again, a cloud ideal.) If the devs make a mistake during an update, well, just roll back!
50 Shades of Immunability
The different flavours of immutable linux differ in how they accomplish that, but all have rollbacks as a basic capability. Each change to the system becomes a new, indivisible image; thatās why we talk about atomic updates. You create a new system image when you update, but you donāt start using it until you reboot the system. (This has some advantages to stability, as you might imagine, although the rebooting can get old.) The old image is maintained on your system, just in case you happen to need it.
MicroOS and its descendants (like Aeon) use a system based on BRTFS snapshots to provide rollbacks. Fedoraās atomic desktops, like Silverblue, and the Universal Blue downstreams that are based on Fedora like Bazzite or Aurora use a system called OSTree, which is considerably more complex and more interesting. You can do something similar with Nix, of course, but that is a whole other kettle of fish.
OSTree bills itself as āGit for operating system binariesā. Every update, or every package installed is layered onto the tree and can be rolled back if neededā en masse, or individually. You can package up that tree of commits, and deploy it onto a new system, making devising new ādistrosā so trivial they donāt really deserve the name. In theory, you can install everything via OSTree, but the further you take your system from the base image, the less you have that āevery system is identicalā easy-problem-solving that the immutable guys like to talk about.
Of course you do want to install applications, and you do it the same way you might on a server: in containers. What sort of containers can vary by taste, but typically that means Flatpak for GUI applications. Fedora-based immutable distributions like Silverblue or Aurora use Flatpak, as does OpenSuse. (AppImage and snap are also options, technically speaking, but who likes snaps?) The Universal Blue team adds in Homebrew for those terminal applications that donāt tend to get Flatpaks. I admit that I was surprised at first to see Homebrew when I started using Aurora, since I knew it as āthe missing package manager for MacOSā but its inclusion makes perfect sense when you think about it.
MacOS is the First Immutable UNIX
MacOS, you see, is the first immutable UNIX. As much as we in the Linux community donāt like to talk about it, Macs arenāt just POSIX compatibleā they run Certified UNIX(). And Curputino has been moving towards this āimmutableā thing for a long time, until Catalina finally sealed the system folders away completely on a read-only volume. Updates for MacOS also come as snapshots to replace that system volumeā you could certainly call them āatomicā. Since the system volume is locked down, traditional package managers wonāt be able operate. Homebrew was created to solve that problem. It works just as well on a Linux system that has the same lockdown applied to its system folders.
If Homebrew isnāt your cup of tea ā and it seems to not be everyoneās, since I think Universal Blue is the only distro set to ship with it ā you can go more hard-core into containerization with docker or podman. Somewhere in between, you could use something like Distrobox. If you havenāt heard of it, Distrobox is a framework for deploying traditional linux systems inside containers. For devs, itās great for testing, even if you arenāt basing it on top of an immutable distribution. If youāve never worked in the cloud, this may all sound like rube-goldberg gobbbly-gook, (ālinux in a box on my linux!?ā) but once you adapt to it, itās not so bad.
The Year of Immutable on the Desktop?
The question is: do you want to adapt to it? Is cloud-based thinking necessary on the desktop? Well Iād say it depends on who is using the desktop. I would absolutely steer Windows users who are thinking of switching to Linux in the wake of the Windows 10 EOL to a Universal Blue distribution, and probably Aurora since KDE is more windows-y than Gnome. Most of those ex-Windows users are people who just want to use a computer, not play with it. If that describes you, then maybe an immutable distribution could be to your liking.
MacOS has shown that very few desktop users will ever notice if they can access the system folders or not; they are most interested in having a stable, reproducible environment to work in. Thus, immutable Linux may be the way to bring Linux mainstream ā certainly Steam thinks so, with SteamOS. For their use case, itās hard to argue the benefits: you need a stable base system for the stack of cards that is gaming on Linux, and tech support is much simplified for a locked-down operating system that you cannot install packages on. The rising popularity of Bazzite, Universal Blueās gaming-centric distribution, also speaks to this.
There are downsides to this kind of system, of course, and it is important to recognize that. Some people really, really hate containerization because Flatpaks, and other similar options, use more memory, both on disk and in RAM. Of course not everything is available as a Flatpak, or on Homebrew if the system uses that. If you want to use Toolbox or Distrobox to get a distro-specific set of packages, well, of course running a whole extra Linux system in a container is going to have overhead.
From an aesthetic perspective, itās not as elegant as a traditional Linux environment, at least to some eyes, mine included. Those of us who switched to Linux because we wanted absolute control over our computers might not feel too great about the ādo not touchā label implicitly scrawled across the system folders, even if we do get something like rpm-ostree to make changes with. Even with a package manager, there are customizations and tweaks you simply cannot make on a read-only system.Ā For those of us who treat Linux as a hobby, thatās probably a no-go.
For the āLazy Developerā Aurora sells itself to, well, thatās perhaps a different story. Speaking of lazy, Iāve been using Aurora for a few months now, almost in spite of myself. I initially loaded it as the last step on a distro-hopping jaunt to see if I could find a good Windows 10 replacement for my parents. (I think this is it, to be honest.) Itās still on my main laptop simply because itās so unobtrusively out of the way that I can think of no reason to install anything else.
At some point that may change, and when it does I might just overcorrect and do a Linux From Scratch build or try out like NixOS like Iāve been meaning to. Something like that would let me regain the sense of agency I have forfeited to the Universal Blue dev team while running Aurora. (There have been times where I can feel the ghostly hand of an imaginary sysadmin urging me not to mess with my own system.)
After seeing how well containerization can work on desktop, Nix looks extra appealing ā it can do most of what this article talks about with the immutable distros, but without trusting configuration of any facet of the system to anyone else. What do you think? Are the touted benefits to stability, reproducibility, and security worth the hassle of an immutable distribution? Is the grass greener in the land of Nix? If youāve tried one of the immutable Linux distributions out there, weād love to hear what you think in the comments.
From Blog ā Hackaday via this RSS feed
Amazing post!