What the hell is a Linux?

blue linden explains stuff about Linux in a way you can understand as she installs what is supposedly one of the most complicated versions of it.

· 19 min read
A gigantic, pixelated eye filled with trippy gradients below the text "the hell is a linux?"

This post is for mature audiences, because I swore while writing it. If you're cool with that, feel free to let your seven-year-old kid narrate this during their show-and-tell. I'm sure their teacher will love that, and so will their principal.

Techy people may already know what a virtual machine is, but I'm assuming you don't. Virtual machines are a way of running a simulated computer inside of a real computer. If you've ever watched a YouTuber download and install a virus on their computer, there's a high chance they're using a VM. Virtual Machines are much safer and more convenient than running something on "bare metal." Bare metal is what computer nerds call it when they touch grass, puff their chest up like a chad, plug their USB stick into the computer, and press the power button. Whether it's a server or just your potato laptop from 2009, you're probably running Windows or Linux "bare metal" on it. That means that the operating system has full access to the hardware it's running on.

In the case of the YouTubers downloading viruses on their computers, they don't want that. What if the virus decides to make the computer do something that gets it physically damaged? Well, HA! FOOL! You're in a fucking simulation! We put you in a virtual machine, bozo!

I know that the software I'm going to be running doesn't need full access to my computer. So I have my computer set up a little simulation that the software can play around in, like a sandbox for the snotty seven-year-old mentioned earlier that it has all to itself! I could forever wreck the software on the inside, as the rest of my computer happily chugs along.

I'm starting by downloading an ISO (basically a computerized clone of what would be burned to a DVD or USB stick) from the Arch Linux website and loading it into my virtualization setup. It's basically just plugging a virtual USB stick into a virtual computer and pressing a virtual power button. For the rest of this post I'll be loosely following this guide, which you don't have to read unless you want to install Arch Linux. Just a fair word of warning: If you're a cis guy, doing this is going to make you a woman or at the very least not a guy anymore. I'm sorry. I don't make the rules.

Ah, shoot. It's in BIOS mode, which means I forgot to initialize the virtual machine with a UEFI. I plan to use systemd-boot, which requires a UEFI-compatible system. More on systemd-boot later.

The flashy BIOS boot menu for Arch Linux

...where the FUCK is the option for UEFI? I've done this before, I have a Windows 11 VM because I have to use InDesign for my schoolwork occasionally.

I looked around for a few minutes, then gave up and googled it. God damn it, I need to re-create the VM.

Goodbye, archlinux.

Deleting the virtual machine labeled archlinux in my VM software
DIE DIE DIE DIE DIE DIE DIE DIE D

The hell is a BIOS?

So you may be asking: what's the difference between a BIOS and UEFI? Well, long ago, a century after your mom was born, the Computer People had come up with something interesting. They called it IBM, and through the 1900s it slowly gained power in computer markets across the world. They're super proud of their innovative history, that has been witnessed, well, everywhere! Except Germany in the 1930s, for some odd reason. Strange. I'm sure it's nothing, especially to do with a subsidiary of theirs that made punch card machines at the time.

In the 1970s and '80s, IBM created this thing called the IBM PC. It became a standard for how computers worked at the time, and one of those innovations that became a standard was the BIOS: the Basic Input/Output System. Computers sold until the early 2010s came with various versions of this, with the basic point being to manage input, output and low-level hardware configuration for the operating system. The operating system would tell the BIOS how to boot it, and the BIOS, like a good husband scratching his husband's back (happy Pride Month!) would boot the system using its low-level access to the system's hardware. This required using constructs like a "boot sector" to define how the operating system should be started. This boot sector also contained partitioning information.

Partitions on a hard drive are like cubicles in an office: everyone shares the same overall space and room capacity, but within it, there can be smaller, dedicated spaces where people have relative privacy. They aren't relevant right now.

The thing about BIOS is that it's super limited and kind of finicky, along with the format that it uses to partition its disks, called Master Boot Record, or MBR. Since 2012, Windows has required a different system: UEFI, or "Unified Extensible Firmware Interface."

UEFI is an open standard, unlike BIOS, which was created by IBM and then ripped off by everyone else. UEFI, instead of requiring a boot sector, uses programs stored in the "EFI System Partition," or ESP, to start the system. With it, it brought a new way of partitioning hard drives: the GUID (Globally Unique ID) Partition Table. It assigns each partition a long ID, like 1266f84a-b3b3-4b3c-aa67-bd91dcaa5633 and gives it some other metadata. Unlike MBR, it allows partitioning hard drives larger than 2.2 Terabytes.

The reason I'd like to use UEFI is it makes my job easier: modern Linux operating systems (also called distributions, distros or OSes) are designed to run on UEFI systems, and some features don't work on BIOS systems. For example, my personal laptop uses Secure Boot (which makes it harder for people to tamper with my Linux install without going through the approved system update methods) and disk encryption, which makes my data unreadable to anyone without a specific password or hardware key that I have. Neither of those are supported on BIOS.

Below, I'm creating a new virtual machine from the same template as the old one, and making sure that it's using (virtual) firmware that supports UEFI features.

Viewing the newly created VM in my software, now with UEFI firmware
The not-so-flashy boot menu for the UEFI version of Arch Linux
Why did it get all boring? Now I want to go back to a BIOS system.

The reason the old bootloader was so fancy was that it was a completely different program... The old one was syslinux, and the one above is systemd-boot. More on it later, but I'll just say that they work in very different ways.

The hell is a systemd?

System D starting up the installer image

systemd is the system that many Linux-based operating systems use to manage the various different services they need to provide to the user. You may be thinking, well, "What if I'm not running a website or anything? This isn't a server!"

But everything on any of the computers you use is a service - systemd just doesn't hide as much as the "init systems" of other operating systems. An init system is vaguely what it sounds like on the tin - a system that initializes a computer so someone can use it. Linux isn't an operating system itself, it's just the core of one. It's not possible to just run Linux and have a working computer, you need to run something on top of it to accomplish anything. The program that manages your computer's Wi-Fi connections is a service. The program that shows you your desktop is a service, which is usually explorer.exe in Windows, finder.app on macOS, and something like [email protected] if you're using a specific desktop called GNOME on a Linux operating system. The service that handles all of the audio on modern Linux systems is usually either pipewire, jack or pulseaudio.

The thing about systemd is that it was extremely controversial when it came out. It replaced a fragmented landscape of a half-dozen different systems for managing a computer's startup, but with that it brought security, efficiency and compatibility problems. systemd developers often have their own viewpoints on how all Linux systems should work, which they kind of force down everyone's throats. The lead developer of systemd, Lennart Poettering, is infamous for having that kind of self-centered and world-dominating view of the whole Linux ecosystem, and refusing to see things in any way other than his. He now works for Microsoft. But his confidence worked in his favor: the first Linux OS to adopt systemd as its init system did so in 2010. The OS that I'm installing, Arch Linux, did so in 2012. Almost every single major Linux OS had done so by 2014 or 2015. All of the resources going into mainstream Linux "userspace plumbing" development started going into systemd.

Now, what is userspace? As I mentioned earlier, Linux isn't an entire OS. It's something called a kernel. Everything that uses and works with the kernel is the operating system. Linux's responsibilities are to provide the most basic set of tools for managing a system. It knows what a user is, what a folder is, how to interact with your hardware, and a few other things.

Stuff like the desktop, a web browser, and even the audio system on your computer runs in userspace. It's basically everything that sits above the kernel and is able to interact with it. systemd is kind of the highest level of the userspace hierarchy in most systems. But what I said earlier about it just managing "services" on your system is only half-true. That's what systemd, the program, manages. The systemd project as a whole may as well be everything else on top at this point.

Here's an incomplete list of what it also manages, using material from this list:

  • logind: All user logins
  • localed: System language and region management
  • networkd: (on some systems) All system network connections
  • resolved: (on some systems) All system DNS (basically website domain name) lookups
  • systemd-cryptsetup: (on some systems) Encryption of all system files
  • homed: (on some systems) Encryption of specific user data
  • systemd-boot: (on some systems) Booting up and preparing the system to load the Linux kernel
  • systemd-bsod: Showing a Blue Screen of Death when something goes wrong
  • systemd-nspawn: Running specific types of containers and virtual machines
  • timedated + timesyncd: System clock timekeeping
  • tmpfiles: Storing and deleting temporarily needed files
  • udevd: What happens when any device connects or disconnects

systemd developers now call it "Linux's userspace plumbing layer," because it manages so much of userspace.

Ah, right. Arch Linux.

The hell is an installer?

Screenshot of the title and first paragraphs of the installation guide on the Arch Wiki

The above guide assumes that you aren't using an "install script," which is a program that helps you through installing Arch. I am not using an install script, because I think I may hate myself. But it's not like I'm compiling everything with my bare hands either, I'm taking care of setting up the environment but still letting convenience scripts like pacstrap and genfstab handle the parts that are better to do automatically.

As you can see, the installation environment (on the right) is quite sparse.

Screenshot of my GNOME desktop with a browser on the left and the VM console on the right
results of running "ip link" which doesn't return any connection or address information
No internet??

I thought for a second that I didn't have internet. It turns out I'm dumb and I forgot about the difference between ip addr and ip link.

This is a view of the status display from systemctl, which is the command users use to manage systemd. The installer has a lot of convenient services that make things easier for me, like NetworkManager, which automatically sets up network connections.

results of running "systemctl status" which yields a big tree view of system services
"Lightweight" my ass. The hell is this?

NetworkManager NetworkManaged to get the system online.

the installer pinging bluelinden.art and getting responses back
I'LL SEE YOU ONLIIIIINE

I got the time synchronized by... [checks notes] connecting to the internet.

the result of running timedatectl, which returns the system time in UTC
i love UTC time!!

I changed the font to make text more readable. You're welcome.

setting the partition table type to GPT for my system drive in cfdisk
shoutout to cfdisk. It's like fdisk but with a UI!
adding two partitions to my drive in cfdisk, one of which is a 1GB EFI System partition and the other a 20GB Linux filesystem
I had to partition the virtual drive.

Why am I not doing swap? Because I don't care. Because my laptop has 32 gigabytes of memory. I do not care. In fact, I just increased the allocation given to shitty to 16 gigs. And I renamed the VM to shitty!

I then mkfs.btrfs'd all over the place on /dev/vda2 and mkfs.fat'd /dev/vda1. I don't care if btrfs sucks for VMs. I am using it anyway. Pray I do not use it further. btrfs does not stand for B-tree file system like the LIBERALS would have you believe... it stands for BETTER file system.

Mounting the two new partitions to the installer's filesystem

So I fucked the above commands up, I should have done them backwards. This set me back about an hour, and I'll explain why when I get to installing the bootloader.

The hell is a package manager?

Setting the list of package manager mirrors in the Helix text editor
Mirrors set!

Arch Linux uses a "package manager" called pacman that helps create and update the system. For example, whenever Steam or Discord have to update on your computer, they have a set of scripts that they use to do it easily. pacman does that for every part of an Arch system, including the Linux kernel and systemd. It doesn't occupy any sort of higher plane of existence than those two, because it still runs in userspace. It just knows how to swap those two out and let them know that they should probably be restarted, whether automatically (and invisibly to you, in some cases!) or by you though a manual reboot. The great thing about Linux is that it never forces you to update, unless something will go seriously wrong if you don't.

Traditional package managers use a system of "mirrors" to provide assets and updates to systems. The structure works like this: a package manager created by two computer science students with $5 to their name each gets really popular. They may have the time to continue to develop the manager and make it more efficient, but this isn't 2002 and we aren't on LimeWire anymore as a society. Having regular people download stuff from each other's computers is risky, especially when it comes to things they can execute. So these two poor computer science students go to their university's computer lab and ask them for five gigabytes of storage space and an internet-facing server to host the "repository" on. This repository's job is to let computers download system components and applications from it, and to tell people what it has.

Eventually, that university gets tired of hosting it because it doesn't really provide any benefit that the system administrator can think of of the top of their head, and gives it less space and a lower priority. 18-year-olds from other universities get pissed off because they can't download their stuff anymore, and they petition their computer labs to host a copy so they can download things faster. Eventually, four or five universities in the US, a few in Europe and a few in Africa and parts of eastern Asia start hosting their mirrors, and the poor computer science students have gone on to leave college.

The general advice when picking these mirrors can be complex, because there are a lot of factors that come into play...

I'm bullshitting you. Just pick the closest ones. In the end, as long as they're within the US, it's only a 20% difference in speed if you pick one in Nowhere, Midwest, USA versus one in the middle of New York City that is actively being pissed on by a guy in a suspiciously yellowed Santa costume.

pacstrap is a script that takes a list of packages (in my case, base (the bare minimum necessary to run the system, including systemd), linux (the Linux kernel), linux-firmware (various firmware components so Linux knows how to work with my computer's hardware), and helix, a text editor similar to Vim.

Installing a boatload of packages using pacstrap, about 900MiB worth, including systemd and the like.

Here, I'm telling the system to remember what disk partitions it's currently using by having genfstab put it into a format that systemd can understand.

running genfstab on the mounted filesystem

Before I bring this Arch monstrosity to life, I need to do some small things on the inside to give myself a non-horrible experience when I boot it up. Below, I'm "entering" the system and telling the installer OS that it should behave like the newly birthed, slimy baby of an Arch Linux install.

running arch-chroot on the mounted filesystem

Below, I'm setting the language that the system will use for things like command help text and system messages.

setting the locale to US English with a UTF-8 character encoding

Now I'm setting the system's hostname (what it calls itself, and what other computers on the network can use to reach it) to shitty.

setting the system hostname to shitty in the Helix editor

The hell is a filesystem?

I installed the bootloader to the EFI System partition. The bootloader in this case is systemd-boot. I mentioned earlier that I had screwed up - it turns out that mounting filesystems on Linux is like an onion; it will make you cry. It is also made of layers, which is convenient for this simile. When you mount a partition on your hard drive, for example /dev/vda2 to a folder on your computer, like /mnt (short for "mount"), you're taking the contents of that partition in whatever file system (which is the format in which a partition turns a file-and-folder hierarchy into something that can be stored on a little metal disk or computer chip) it happens to use and placing it on top of whatever was there before.

installing the bootloader with "bootctl install"

Let's use a genderless person (happy Pride Month!) wrapped in blankets as the representation here.

The bottom-most blanket is bright blue. It's completely opaque, and nothing is really inside of it, besides the human. You can't be inside the human (on this site), but you can be inside of that blanket! The one above it is green and only covers the area that is near their left leg. As an outside person, you can't go below that blanket and see the blanket underneath it under normal circumstances. What you see is a blue blanket with a green patch.

But what if you swap their order? Put the green blanket on their leg, then wrap them in the bright blue blanket. Now, you can't see the green, even though you know it's there. The tricky part is that there's definitely still a blanket there and you wouldn't be able to tell there was a green one there at all, because in Linux file systems have to be mounted on top of each other, just like blankets on top of this hypothetically smoking-hot nonbinary person in real life (happy Pride Month!).

One would expect for there to be a hole in the blue blanket, no? But there isn't. You have to remember to put the green blanket on top of the blue blanket if you want to make sure this absolutely fabulous nonbinary person (happy Pride Month!) has their favorite green blanket visible.

Basically, I mounted /dev/vda1 to /mnt/boot, which is the standard mount point for the EFI system partition, before I mounted /dev/vda2 to /mnt. I should have done it the opposite way. I put the little green blanket on before the blue blanket, and now this AWOOGA-inducing nonbinary person (happy Pride Month!) is unhappy with me because I messed up their blankets :(

I ended up fixing the mountpoint problem off-camera.

re-running pacstrap
weird errors from pacstrap, saying something failed to execute correctly
WHY????

See, now I was getting frustrated. What the hell is an initcpio? It turns out that it's just one of the things that Linux needs to start up. It's a more technical term for something called a RAMdisk, which is a filesystem that lives in your computer's short-term memory (called Random Access Memory) that gives the Linux kernel a place to start the rest of your OS. For some reason that I'm still not aware of, it wasn't generating properly.

"mkinitcpio -P" fails, saying it couldn't find a kernel image that didn't exist

Besides the shell frowning at me, presumably for messing up the incredible nonbinary person's (happy Pride Month!) blankets, the reason this failed, which took me half an hour to figure out, was that I didn't run arch-chroot /mnt before I tried to build the RAMdisk.

successfully generated initcpio image
nvm i forgot to arch-chroot into the mounted system lol

After I did so it was happy. A chroot environment basically puts you in an area where you think you're in control of the entire system, but you really aren't. You've been given your own little filesystem playground to fuck off into. It's not nearly as elaborate as a virtual machine, and it lets you use a regular system from a recovery or installer environment like this one.

a list of partition UUIDs and disk information from "fdisk -x"
Getting my root partition's UUID to configure systemd-boot

The hell is a bootloader?

Here, I had to configure systemd-boot after rebooting only to find out that Arch Linux wasn't listed as a bootable option. I just had to give it the components it needed to start Linux, like the initrd (RAMdisk with extra steps), the kernel and the UUID of the root drive, taken from the GUID partition table from earlier.

setting the systemd-boot config to allow booting Arch
there we go
about to reboot
moment of truth
actually rebooting after the previous call failed due to being in a chroot
oops, now moment of truth.

Here, it looks like the UUID doesn't actually exist...?

system failing to boot because it timed out waiting for the UUID i specified in my configuration
well shit, i guess i mistyped it.

So I changed it to just be the partition identifier because I don't give a shit about the long-term stability of this computer.

setting it to use /dev/vda2 as its root instead of the UUID

I disabled the installer drive in the VM's settings, and then rebooted.

disabling the installer disk in the VM settings before rebooting
have to disable this before rebooting.

Here I am! The font got all small again because I didn't bother to install the extra fonts that the installer came with.

logged-in root prompt on the newly installed machine
FINALLY.

The hell is the internet?

I tried to install neofetch, which is what Arch people use to brag about their computers, but I ran into a problem: I didn't have internet. The installer came preconfigured with NetworkManager. This didn't. I tried to use systemd-networkd, but it turned out that it would need manual configuraiton. Yuck. I don't care about this system, so I'll be running it with NetworkManager. That's what my laptop uses anyway.

pacman failing to connect to the internet, me trying to start "systemd-networkd"
enabling systemd-networkd for fun and profit!

So I headed back to the installer and installed NetworkManager...

adding NetworkManager to the new system via pacstrap, worked successfully
pacstrap'd and then mkinitcpio -P'd.

...Shut down the VM...

shutting down the installer
so exited !!!

...Forgot about case-sensitive unit names...

me messing up the capitalization of NetworkManager and then starting it correctly

...And brought my system online!

showing my VM's internal IP address via "ip addr". and that it was online

I then installed a desktop environment named GNOME and rebooted.

pacman installing gnome, gdm and gnome-extra
it's pronounced Guh-Nome!

The hell is a desktop?

blank graphical login prompt, empty username, Arch Linux logo below
that was easy!

Arch makes it surprisingly easy to install GNOME and its display manager (the part that handles screen layouts and logging in via a fancy login screen) as compared to Ubuntu and the like. Gold star!

Here's the GNOME desktop on shitty.

the GNOME Overview screen with a dock and row of workspaces

neofetch'd. It's like a cool-looking system information screen.

GNOME running neofetch in a terminal as root@shitty, with a big Arch Linux logo

This is what it looks like running a VM running GNOME alongside the rest of my apps, my laptop also running GNOME.

my laptop running GNOME, with the VM running GNOME as a window in the overview view

GNOME has its own app store.

the GNOME app center showing previews of installable apps
the App Store works!

I was going to power it off, and then I had an idea...

me about to click the power off button in GNOME

The hell is an rm -rf / --no-preserve-root?

me typing "rm -rf / --no-preserve-root"

I've always wanted to do this. Never, ever do this to any computer you own, and especially not to someone else's. This will require a full reinstall of the operating system, and literally everything will be wiped out.

Too bad!

a dozen messages stating that rm couldn't remove some things in the /proc directory
more messages stating that rm couldn't remove some things in the /proc directory, unable to remove /efi, dumped back at root prompt

Trippy stuff:

terminal saying that "ls" wasn't a real command
terminal refusing to clear the screen, or shut down because the commands weren't found
systemctl also not being a real command

systemd is dying.

desktop background and all dock icons vanished, along with the control center in the top right

Images start to disappear, and if I actually cared about this system I'd be panicking right now.

me searching for something in the search box in the Overview, but no results.

No results? Aww, maaan...

gnome run command text box, reboot command not found

I force rebooted it and then...

dumped into an EFI recovery shell after rebooting
goodnight :)

This is what happens after you wipe out your bootloader. There will literally be nothing left. Your computer will not know what to do, so it will dump you into an EFI shell and hope you can make it out alive. At this point your system is unrecoverable. All that is left to do is delete the VM.

my cursor hovering over the Delete VM button
my cursor hovering over the confirm delete VM and associated storage files button
me about to select "Yes" on "are you sure"

Yes. Thank you for your service. I applaud you for your effort.

It's like Arch was never installed.

Please consider subscribing.

me running Neofetch on my NixOS laptop, with a big snowflake logo, and identity blue@boo
long live NixOS.

I'll just keep on using my NixOS setup, thanks.

Happy Pride Month!

Microblog