Author Archives: Lorenzo Bettini

About Lorenzo Bettini

Lorenzo Bettini is an Associate Professor in Computer Science at the Dipartimento di Statistica, Informatica, Applicazioni "Giuseppe Parenti", Università di Firenze, Italy. Previously, he was a researcher in Computer Science at Dipartimento di Informatica, Università di Torino, Italy. He has a Masters Degree summa cum laude in Computer Science (Università di Firenze) and a PhD in "Logics and Theoretical Computer Science" (Università di Siena). His research interests cover design, theory, and the implementation of statically typed programming languages and Domain Specific Languages. He is also the author of about 90 research papers published in international conferences and international journals.

Linux EndeavourOS Cassini Review

I have already blogged about EndeavourOS, which I use most of the time on all my computers (desktops and laptops). Since EndeavourOS, based on Arch, is a rolling release, I update it almost daily and don’t need to install it from scratch when a new release comes out, like Cassini, released a few days ago. However, I wanted to try this new release by installing it from scratch (of course, using BTRFS).

I’ll first go through the installation, but I can anticipate that, once again, I’m impressed by EndeavourOS. This installation is smooth, with some novelties: you can choose between “grub” and “systemd-boot” now. Moreover, they switched from “mkinitcpio” to “dracut” for the generation of initramfs (this requires a few adjustments if you want to enable hibernation). Most of all, EndeavourOS is pure Arch but with outstanding defaults. Indeed, the KDE and GNOME environments are vanilla ones, with only a few customizations.

This time, I’ll install GNOME (but I’ll briefly say something about the KDE version at the end of this article).

Installation

First, I’m using Ventoy to boot the installer because I keep several Linux ISOs on the USB stick. I first made sure to update Ventoy because I read that the old versions did not work correctly with the latest Arch-based ISOs. Moreover, once I selected the “Cassini” ISO:

I got another menu (that’s something new), where I selected GRUB:

As usual, the first thing to do, once booted into the live environment, XFCE, is set up the network connection. You might also want to change the keyboard layout (Disable system defaults and install your layout, in my case, it’s the Italian layout):

Then, let’s update the mirrors (typically by selecting your state and possibly another one near you) with the “Welcome” application:

Then, let’s start the installer.

I choose the “Online” method because I want to install GNOME instead of Xfce.

I always prefer to install any operating systems in English, so I select “American English”:

The location has been found successfully, and while the language is the one I chose, it proposes to use my Italian locale for dates and numbers:

After setting the keyboard layout, I select the GNOME desktop:

And then, I can select the single packages. Since you choose the packages after selecting the desktop, a few packages, in particular, the ones of the chosen desktop, have already been selected:

Then, I typically unselect “xf86-video-intel”, which is known to give a few problems:

And I select all the packages concerning “Printing Support” (including “HP”) and also the “LTS kernel in addition” (because if anything goes wrong with the latest kernel, I can switch to the LTS one).

Now there’s a big novelty: you can select the bootloader. The default is “systemd-boot”, but I prefer to stay with GRUB (since I know it works for my use cases like booting Timeshift snapshots and booting other distros):

It’s time for partitioning. Since I have another (EndeavourOS) Linux installation and Windows on this computer, I choose Manual partitioning:

First, I specify to mount the existing EFI partition (into “/boot/efi”) without formatting it and ensure the “boot” flag is selected. This way, the installer can properly install GRUB.

Then, I select the (existing) partition I’m going to replace with this installation; I specify to format it as BTRFS and mount it as the root partition:

There’s also an existing EXT4 partition that I use to share common data among my Linux installations, so I select that (without formatting it) and specify my desired mount point:

That’s the final layout of the primary SSD disk:

I also have another HD on this computer with some existing partitions I want to access from the installed system. So I select this other disk from the top drop-down list, and I specify the final mount points:

As usual, there’s the “Users” section, which I will not detail.

Finally, we can have a look at the summary, which looks good to me:

OK, let’s start the installation!

The installation went fine, and it took about 5 minutes. This is an old computer (6 years old), so it was pretty fast.

First impressions

Here we are in the installed system!

As usual, the GRUB menu is beautifully pink and purple:

And here’s GNOME:

You see that these are not the standard GNOME icons. In fact, EndeavourOS provides GNOME with the “Qogir” icons, which look great to me:

Besides that, I seem to understand that’s vanilla GNOME (it does not have “minimize” and “maximize” buttons enabled by default). It’s good that “GNOME Tweaks” is already installed. However, there’s no GNOME extension installed (the first one I installed was “AppIndicator and KStatusNotifierItem Support”). The terminal is the new “GNOME Console”, which I’ll soon replace with the old “GNOME Terminal” (I prefer that one). Standard GNOME applications like “Calendar” and “Contacts” are not installed either. At least, we have the new GNOME Text editor, which replaces the (IMHO) unusable “Gedit”.

There are no standard GNOME wallpapers, just the EndeavourOS one. Of course, you can install other wallpapers using the “Welcome” app. However, I’ll switch to Variety soon.

The Wayland session is enabled by default. It’s OK to me because GNOME and Wayland are usable nowadays.

The BTRFS subvolumes were created as expected, that is, with a separate “@home” and separate subvolumes for “/var/log” and “/var/cache”. Unfortunately, we also have nested subvolumes for “/var/lib/machines” and “portables”, which are known to give headaches if you restore a Timeshift snapshot:

Thus, since I’m not planning to use them, I removed them (this will make the two nested subvolumes disappear), and I recreated them as standard directories (I seem to understand that those two directories must exist; otherwise systemd will recreate them anyway):

So it’s time to start installing my applications and tweak a few GNOME settings.

In particular, since I have both the “linux” and “linux-lts” kernel, the GRUB configuration sets the LTS version as the default. To change that, I edit “/etc/default/grub” and specify

And regenerate the GRUB configuration:

Concerning KDE

I have also tried EndeavourOS KDE on a virtual machine. With Cassini, you get a new custom (and beautiful) Plasma theme, dark and purple (as usual in EndeavourOS).

To summarize

To summarize, EndeavourOS once again proved to be a fantastic Arch-based Linux distribution:

  • Easy to install
  • Arch-based (e.g., not like Manjaro)
  • not bloated with too much software
  • close to the vanilla DEs (at least for the ones I tried, GNOME and KDE)
  • with a wonderful and warm community, by the way 🙂

Happy new Linux year! 🙂

Enabling Hibernation in EndeavourOS (with dracut)

EndeavourOS is an Arch-based Linux distro, so the technique for enabling hibernation for an Arch-based distro should work out of the box. That was true until the new ISO released this December, “Cassini”, where they switched from “mkinitcpio” to “dracut”.

Now, a few things must be adapted to make hibernation work in EndeavourOS, and the automatic tool described in my previous post can no longer be used. However, don’t worry; it’s not hard to enable hibernation. In this post, I’ll describe the steps to enable it.

IMPORTANT: my instructions assume that you have a SWAP partition; for a SWAP file, you’ll have to adapt a few things, but I can’t help since I never use SWAP files.

First, you need to have a swap partition already set up. For example, in /etc/fstab, you should have something like

The UUID is essential, and you should take note of it.

Then, we must tell “dracut” about hibernation so that it generates initramfs accordingly. It is enough to create the file “/etc/dracut.conf.d/resume.conf” with this line:

By the way, a quick way to do that is by running this command:

Then, we regenerate initramfs:

Now, edit your /etc/default/grub and specify resume in GRUB_CMDLINE_LINUX_DEFAULT, with the UUID of your swap partition. So it should be something like (remember that <UUID of your swap partition> must be replaced with the UUID; the “…” refer to existing options):

Save the file and update the grub configuration:

Now, reboot and hibernate should work. You can try that with the following:

You may also want to refer to the older post enabling hibernation in Linux, particularly in Ubuntu, for other mechanisms related to hibernation, like suspend and then hibernate.

Acer Aspire Vero, Unboxing and First Impressions

During the last “Black Friday,” I bought this laptop:

Acer Aspire AV15-51-58J2 39,6 cm (15.6″) Full HD Intel® Core™ i5 16 GB DDR4-SDRAM 512 GB SSD Wi-Fi 6E (802.11ax) Windows 11 Home. (Intel Evo certified, by the way)

I paid 599 instead of 899 euros, that’s a significant discount (especially for its features, mentioned above and detailed in the post)!

This laptop caught my attention a few months ago due to its “eco” and “green” construction choices. You might want to look at https://www.acer.com/us-en/laptops/aspire/aspire-vero to know more about the recycled materials used for its construction. Besides these “green” appealing characteristics, I immediately found the laptop “beautiful” and pleasant at the touch.

In this blog post, I’ll describe my first impressions.

Here’s the unpacking. As you can see, the packaging is made of recycled paper:

The charger is not USB-C, unfortunately. However, it is pretty light. And the only USB-C port CAN NOT be used for charging, but only for data transfer:

And look: one of the containers can be used as a stand for the laptop (excellent!):

Besides the standard papers and a very minimal getting started guide (pretty useless), there are also some ecological stickers 🙂

Also, the inverted “R” and “E” (for the three words “Reduce”, “Reuse”, and “Recycle”) are a slight distinguishing touch (they’re on the keyboard cover as well):

 

And there are lots of ports (right side: USB 2 and headphone Jack; left: one HDMI, two USB 3, one USB-C – only data, no recharging, and an ethernet port, besides the recharging port). To be honest, I did not find the ethernet very comfortable to use, but maybe I need to get used to it.

This means there’s no SD card reader… Too bad!

The back shows that it should be easy to open the laptop (standard screws), though I still haven’t tried that:

Oh, and there are no painted elements on the laptop: there are engraved symbols and writings:

You see that the surface is anything but smooth, but that makes the laptop very pleasant to touch. Probably the best laptop surface I have ever had! Yes, that part is mostly recycled too, which is ecologically good! 🙂

The two lights on the right will tell you when the battery is charging (“red”: charging, “blue”: fully charged) and when the computer is on:

Unfortunately, these are the only LEDs provided by this laptop. This means that unless the operating system tells you something, you cannot know whether the num lock or the capslock is selected.

When you open the laptop (you can also open it with one hand), the screen slightly lifts the back of the laptop so that the ventilation works better.

Let’s turn it on and enjoy the nice booting logo:

The keyboard is backlit, and the light is good enough to use the keyboard comfortably. Unfortunately, after the backlight turns off because you haven’t used it for a while, just using the touchpad will not turn the backlit back on: you have to press a key.

The keyboard is lovely! At least, that’s the best keyboard I’ve used. Yes, better than Mac air, DELL XPS, and LG GRAM. It’s a great pleasure to type on this keyboard. The only bad part of this keyboard is that the “ENTER” key (“Invio” in Italian) is large enough but too close (actually, attached) to the other key (“ù” in the Italian version). But that’s a problem only for the first minutes of usage. I got used to it.

On the contrary, the touchpad is only “OK”. My other above-mentioned laptops have a much better touchpad. Having said that, this touchpad is usable anyway, though a bit tougher in some external points. If you click on the center, you have no problem. The touchpad is probably too smooth, and if your fingers are wet, you will experience some friction.

Another mechanism I had to change immediately was the function keys. As it happens in several modern laptops, by default, a function key does not behave like a function key but as the other functionality provided by the key (e.g., volume adjustment, light adjustment, etc.). Luckily, I almost immediately found the procedure to achieve that (once and for all) on the Acer website:

  1. Enter the BIOS (you must press F2 while the laptop is booting when you see the “Acer” logo; in the BIOS, you can press Ctrl+S to enable hidden and advanced features; that’s not required for what I need to do in this specific case).
  2. Then, in the main tab, you must change the “Function key behavior” to “Function Key”. Save and restart.

The laptop comes with Windows 11 Home installed. If you read my blog, you know that I’m not a Windows fan 😉 (I have already installed a few Linux distros in multi-boot, and I’ll blog about that in the future). However, Windows 11 is not that bad (well… it’s still Windows 😉 The theme provided by Acer is, of course, “green,” and I like it:

Of course, there were already several updates to apply, which took about an hour! The Windows installation already comes with Firefox installed and several other software. Unfortunately, this includes Norton security, which I had to uninstall immediately (too heavyweight).

The screen resolution is 1920×1080 60,05 Hz and by default Windows already configures 125% scaling. I had to turn it to 150%. Otherwise, it was too fainting for my eyes to using it.

Power consumption is good. I’m used to LG GRAM, Dell XPS, and Mac air, which provide much better battery time. However, this Acer is not impaired in that respect: they say it should provide about 9 hours of battery time. Of course, it’s less, but I found that by using it pretty intensively, you get 5 hours. In that respect, Acer provides its own application (just search for “Vero” in Windows) for choosing a battery profile:

Note that between the usual “Powersave” and “Balanced,” you have an additional “Eco Mode”.

This program also allows you to set the battery charge limit (to increase battery life):

Moreover, there’s also the program “Acer Aspire Center” with other valuable utilities:

To summarize, my first impressions are great! I like this laptop, and for the price I paid, it has excellent features. Moreover, as I said above, I also find it very beautiful. I appreciate the “green” and “eco” ideas and design choices behind this laptop!

Concerning portability, my Dell XPS 13, LG GRAM 16, and Mac air are, of course, better, but in the end, this laptop weighs less than 2 Kg, so it’s heavier than the others mentioned, but still portable enough.

Stay tuned for more blog posts on this laptop, especially concerning Linux on this laptop 🙂

Installing Arch Linux on a PineBook Pro (external storage)

This post will describe my experience installing Arch Linux on a PineBook Pro on external storage (USB stick in this example). Thus, the Manjaro default installation on the eMMC will not be touched. You should use a fast USB Stick, or the overall experience will be extremely slow. I’m using a SanDisk Extreme PRO, which is fast and feels like an SSD. This USB stick will be erased entirely, so don’t use a USB stick with essential data on it.

The post is based on the instructions found at https://wiki.pine64.org/wiki/Pinebook_Pro_Software_Release#Arch_Linux_ARM.

The installation process consists of two steps:

  • First, install the official Arch Linux ARM distribution; this will not be enough to have many hardware parts working (e.g., WiFi, battery management, and sound).
  • Then, add the repositories with kernels and drivers for the PineBook Pro.

The first part must be performed from an existing Linux installation on the PineBook Pro. I will use the Manjaro installation that comes with the PineBook Pro. The second part will be performed on the installed Arch Linux system on an external drive (a USB stick in this example). Since after the Arch Linux installation, the WiFi is not working, for this part, you need to connect to the wired network, e.g., with an ethernet USB adapter.

Finally, I’ll also show how to install Gnome.

First part

This is based on https://wiki.pine64.org/wiki/Installing_Arch_Linux_ARM_On_The_Pinebook_Pro.

I insert my USB stick, which is /dev/sda. (Use “lsblk” to detect that.) From now on, I’m using this device. In your case, the device name might be different.

From now on, all the instructions are executed as “root” from a terminal window; thus, I first run:

I will do the following steps in a directory of the root’s home:

We need to download and extract the latest release of Tow-Boot for the Pinebook Pro from https://github.com/Tow-Boot/Tow-Boot/releases. At the time of writing, the latest one is “2021.10-005”:

Now we flash Tow-Boot to /dev/sda (replace this with the device you are using).

Remember: this will wipe all the contents of the USB stick. Moreover, make sure you specify the right device, or you might overwrite the eMMC of the computer.

This process creates the partition table for the device, with the first partition for Tow-Boot. This created first partition must not be modified further. In fact, as you see in a minute, when we further partition the disk, we make sure to skip the first partition.

The output should be something like this:

Now, we must create the partitions on the USB stick. The process is documented step-by-step here https://wiki.pine64.org/wiki/Installing_Arch_Linux_ARM_On_The_Pinebook_Pro#Creating_the_partitions, and must be followed strictly:

These are the contents of my terminal where I follow the above-mentioned instructions (since I had already used this USB stick for some experiments before writing this blog post, fdisk detects the existing ext4 signature):

Now we must format the boot and the root partitions. I’m going to use EXT4 for both:

Note that although the second command returns immediately, the EXT4 partition will be formatted in the background and will take some time (even with a fast USB stick).

Now we mount the two partitions:

  1. mount the root partition (the 3rd partition) on “/mnt”
  2. create the boot directory at the root of the mounted system
  3. mount the boot partition (the 2nd partition) on “/mnt/boot”

Now, we download the tarball for the rootfs of our USB stick installation. The instructions are once again taken from the link mentioned above, and they also include the verification of the contents of the downloaded archive:

And we extract the root filesystem onto the mounted root partition of our USB stick:

This is another operation that takes time.

Now, we must create the “/etc/fstab” on the mounted partition. To do that, we need to know the UUID of the two partitions by using “blkid”. You need to take note of the UUID from the output (which will be completely different according to the used external device):

We create the file “/etc/fstab” in “/mnt” accordingly (remember, the UUIDs and the partition types must be specified accordingly). I run “nano /mnt/etc/fstab,” and I append the following contents (I use “noatime” to reduce the number of writes on the external USB stick when used to run the installed OS):

Finally, we need to create the file “/mnt/boot/extlinux/extlinux.conf” (the directory must be created first, with:

Once again, the contents depend on the UUID we discovered above for the root filesystem, so the contents must be adapted accordingly:

We can now unmount the filesystems

And we can reboot into the (hopefully) installed Arch Linux on the USB stick to finish a few operations. Remember that we need a wired connection for the next steps.

Upon rebooting, you should see the two entries (if you let the timeout expire, it will automatically boot the first entry):

After we get to the prompt, we can log in with “root” and password “root” (needless to say: change the password immediately).

Let’s connect a network cable (you need a USB adapter for that), and after a few seconds, we should be online. We verify that with “ifconfig”, which should show the assigned IP address for “eth0”.

Since there’s no DE yet, I suggest you keep following the official web pages (and this blog post) by connecting to the PineBook Pro via SSH so that it will be easy to copy and paste commands into the terminal window of another computer. Moreover, when logged into the PineBook Pro directly, you will see lots of logging information directly on the console (I guess this could be prevented by passing specific options to the kernel, but we’ll install a DE later, so I don’t care about that much). The SSH server is already up and running in the PineBook Pro installed system, so once we know the IP address from the output of “ifconfig”, we can connect via SSH. However, root access via SSH is disabled, so we must connect with the other predefined account “alarm” and password “alarm” (again, you might want to change this password right away):

Once we’re logged in since “sudo” is not yet configured, we switch to root:

We have to initialize the pacman keyring:

The guide https://wiki.pine64.org/wiki/Installing_Arch_Linux_ARM_On_The_Pinebook_Pro ends at this point.

What follows are my own instructions I usually run when installing Arch.

In particular, I configure time, network time synchronization, and timezone (Italy, in my case):

The next step is required for doing gnome-terminal work (and it’s also part of the Arch standard installation instructions):

Edit “/etc/locale.gen” and uncomment “en_US.UTF-8 UTF-8” and other needed locales.

Generate the locales by running:

Edit the “/etc/locale.conf” file, and set the LANG variable accordingly, for example, for the UTF-8 local above:

We could run a first system upgrade

I don’t know if that’s strictly required because we’ll add the additional repository for the PineBook Pro in a minute. However, just in case, it might be better to update the system.

Let’s reboot and verify that everything still works.

The kernel at the time of writing is

NOTE: By the way, I noted that if I want to boot from the USB stick, it’s better to use the right-hand side USB port (which is USB 2) instead of the left-hand side port (USB 3). Otherwise, the system seems to ignore the system on the USB stick and boots directly to the installed Manjaro system.

Second part

As mentioned above, I suggest connecting to the PineBook Pro via SSH. In any case, what follows must be executed as “root” (“su -“).

Let’s now add the additional repositories with kernels and drivers specific to PineBook Pro.

The project is documented here: https://github.com/SvenKiljan/archlinuxarm-pbp, and these are the contents of the additional repository that we’ll add in a minute https://pacman.kiljan.org/archlinuxarm-pbp/os/aarch64/.

Note that this project also provides a way to install Arch Linux directly with these repositories, with a procedure that is similar to the one in the first part. I prefer to install official Arch Linux first and then add the additional repositories, though.

The addition of the PineBook Pro repository to an existing Arch Linux installation and the installation of specific kernel and drivers is documented as a FAQ: https://github.com/SvenKiljan/archlinuxarm-pbp/blob/main/FAQ.md#how-do-i-migrate-from-other-arch-linux-arm-releases-for-the-pinebook-pro.

The addition of the PGP key and the repositories to “/etc/pacman.conf” is done by pasting the following commands (remember, as the user “root”):

Let’s now synchronize the repositories

And let’s install the packages specific to the PineBook Pro (note that we’re going to install the Linux kernel patched by Manjaro for the PineBook Pro):

Of course, we’ll have to answer “y” to the following question:

Let’s reboot and verify that everything still works (again, by connecting via SSH).

Now, we should be using the new kernel:

Before installing a DE, I prefer creating a user for myself (“bettini”) and configuring it as a “sudoer”. (We must install “sudo” first).

Then (by simply running “visudo”), we enable the users of the group “wheel” in “/etc/sudoers”; that is, we uncomment this line:

Then, I try to re-connect with my user and verify that I can run commands with “sudo” (e.g., “sudo pacman -Syu”).

Before going on, I prefer to set up a SWAP file (of 8 Gb). The PineBook Pro has only 4 Gb of RAM, and it is likely to exhaust it. Using ZRAM did not work in my experience with Manjaro, so it’s better to have a SWAP file to avoid system hangs.

I run as root (“sudo su -“):

This takes some time. Then, I add the following line at the end of “/etc/fstab”:

Install GNOME

As usual, I’m still doing these steps via SSH.

I’m going to install GNOME with some fonts, pipewire media session, firefox, and the NetworkManager (I’ll ignore dependencies that cannot be installed, e.g., “gnome-boxes” since I’m not going to use virtual machines on this machine):

It’s more than 500 Mb of packages to install, so please be patient.

Now, I enable the primary services (the login manager for GNOME, the NetworkManager to select a network from GNOME, and the profile daemon for switching between power profiles, e.g., “Balanced” and “Powersave”):

OK, time to reboot.

This time the graphical GDM login manager should greet us, allowing us to get into GNOME and select a WiFi connection.

NOTE: when GDM starts, I always hear a strange noise. It also happens with the pre-installed Manjaro. It must be the sound card that gets activated…

IMPORTANT NOTE: Upon rebooting, the WiFi does not always work (it looks like the WiFi card is not seen at all); that also happens with Manjaro. The only solution is to shut down the computer (i.e., NOT simply rebooting it) and boot it again.

And here’s the GNOME 43 setting on the right top corner showing the connected WiFi and the currently selected power profile “Balanced”:

By default, GNOME starts with the Wayland session. Everything seems to work; touchpad gestures work out of the box (3 finger swipes). Something does not look right in the Wayland session, though. For example, if you run Firefox, you cannot switch to it with Alt+Tab. I prefer to go for the X11 session for the time being (that’s selectable from the GDM’s gear icon on the bottom right corner once you select your user).

Here are a few screenshots of the GNOME activities and the currently installed applications:

The GNOME About dialog:

And of course, once installed, let’s run “neofetch”:

That’s all for now!

In another blog post, I described my customizations to GNOME (installed programs and configurations).

Stay tuned! 🙂

UI Tests in Another Display in Linux

UI tests are delicate since when you run them, you must not interact with the computer, or you will disturb the tests, which will likely fail.

In Linux, you can use Xvfb, but windows will not have a title, which might break UI tests that rely on that. For example, Eclipse SWTBot tests work best if windows have titles.

The solution (I’m still talking about Linux) is to use Xephyr:

  • you start Xephyr by specifying a DISPLAY number
  • you start a Window manager on the same display
  • you run your UI tests on the same display

Now, you can interact with your computer without disturbing the UI tests. That’s very important if you need to debug the UI tests: if they don’t run in another display, the UI tests will likely fail if you switch to the debugger.

IMPORTANT: this works only when you’re on an X11 session (not Wayland).

The name of the package for Xephyr depends on your distribution. For example, in Arch Linux, you install it like that:

Now, from a terminal window, you can start Xephyr (in this example, using the DISPLAY 50) and run a Window manager inside, specifying that it must run with X11.

If you’re on Gnome, you use mutter:

If you’re on KDE, you use kwin:

This is an example in Gnome: I ran the above commands, and then, from the same terminal (where DISPLAY is set to “:50”), I started the Gnome Text Editor, which appears in the Xephyr window:

In the following screenshot, I’m running the Maven build of one of the examples of my TDD Book, which uses AssertJ Swing for the UI tests of a simple Java Swing application (I started another terminal, where I exported the DISPLAY environment variable set to “:50”):

The UI tests (see the “MyAppWindow”) are undisturbed in the Xephyr window, and I can interact with my computer without breaking them.

From Eclipse, e.g., for a SWTBot test, you have to tweak the run configuration in the “Environment” tab:

And these are a few SWTBot tests for my Eclipse project EMF Parsley, which started from Eclipse but running in the Xephyr window:

Happy UI testing! 🙂

Maven profiles that are really active by default

While working on my TDD book, I played with Maven profiles to write the chapter.

If you use Maven profiles, you might want to use an activation strategy to enable the profile under certain circumstances automatically. There’s also a particular option, “<activeByDefault>”, which seems self-explanatory. This must mean that that profile will be constantly active by default unless you explicitly disable it, e.g., with “-P!profileid”.

Here’s a possible minimal example:

By using the maven-help-plugin‘s goal “active-profiles,” we can verify that:

Unfortunately, this will probably never work as we expect. For example, let’s add another profile (without any activation strategy in this example):

If we explicitly enable such a profile, we’d expect the previous one is still “active by default”, but we have a terrible surprise:

As it is documented (https://maven.apache.org/guides/introduction/introduction-to-profiles.html):

This profile will automatically be active for all builds unless another profile in the same POM is activated using one of the previously described methods. All profiles that are active by default are automatically deactivated when a profile in the POM is activated on the command line or through its activation config.

Counterintuitive, but it’s like that, like it or not.

However, the documentation also tells you how to achieve the “really active by default”; it’s a matter of activating the profile when a property is NOT defined. Let’s create another profile following this approach:

And verify that:

The profile we’ve just added will be activated when the system property “skipMe” is not defined. So, it’s really active by default unless you pass to the command line “-DskipMe”.

Note also that the “<activeByDefault>” property is really misleading. In fact, as long as another profile is automatically activated (i.e., not explicitly), the “<activeByDefault>” is useless. In fact, with the profile we’ve just active since it’s really active by default, it also disables, by default, “notReallyActiveByDefault”:

Let’s do some further experiments and add another profile, which is activated when the property “activateMe” is defined:

Let’s define the property on the command line, and we get the expected result:

We can also refine the activation:

If we define that property, the profile will be activated, and if we define that property with another value, it will not be activated (in any case, “reallyActiveByDefault” is still activated):

REMEMBER: You CANNOT activate that profile by defining a property in the POM, though:

If you want, you can temporarily switch the activation with a negated property, similar to what we’ve done before:

And verify the expected result:

That’s the complete example of POM:

However, please remember not to abuse profiles, or the build will easily become hard to maintain.

A first look at XeroLinux

It’s been a long time since I wanted to test this Arch-based Linux distribution, XeroLinux. Finally, I found some time, and I first tested it in VirtualBox, and then I also installed that on one of my laptops.

What XeroLinux is about is summarized on its home page:

A Hobbyist Arch-Based Distro, built using ArcoLinux’s ALCI scripts that is meant to provide you with a stable base, making it simpler to install ArchLinux (Calamares) with a well optimized & Customized KDE Plasma, that you can shape YOUR way, the easy way… !

It’s an Arch-based distribution (not like Manjaro): it’s basically Arch with a few additional repositories that are mainly devoted to one of the main exciting features of XeroLinux, that is, a beautiful (good looking) KDE customized experience. And, although the “beauty is in the eye of the beholder”, XeroLinux KDE DE is indeed amazingly beautiful.

In this (long) post, I will summarize my overall experience of XeroLinux, starting from the installation to daily usage. Maybe it’s because I’m used to Arch, but I really like it!

Installation

The installation process starts, as usual, with a Live ISO. One of the fun things is that when you boot the Live image, the GRUB countdown emits a beep every second 🙂

When you get to the live environment, you can already understand the beauty of the KDE customizations (dock, global menus, blurring, etc.)

You’re then greeted by the XeroLinux Hello program:

If on a virtual machine, you can use one of the two buttons to fix the screen resolution. In general, you might want to “Update Arch Mirrorlist” right away. Then, just “Launch installer”.

The installer is based on the good old Calamares. If you’re already familiar with that, it will be easy! If not, it will not be that hard since the installer will ask you only the basic questions and will install all the default packages without further intervention.

Of course, the “Partitions” section is the critical one.

You probably wipe the whole (virtual) disk in a virtual machine. As usual, you can select a swap partition with hibernate. XeroLinux defaults to XFS, but I prefer BTRFS, which I’ve selected in my installations. As we’ll see later, the default layout of BTRFS subvolumes created by XeroLinux is also good!

When installed on my laptop, where I have several Linux installations, I chose the manual partitioning and manually created a new BTRFS partition while mounting another shared data partition. As usual, if you have an existing EFI partition, you must manually mount it in “/boot/efi”:

After reviewing the summary, it’s time to start the installation:

Do you see that green button on the bottom right? Click it, and you can see the log of the installer:

When the installation finishes, you get a message that the installation log can be found in the installed system:

The name of the LOG file is wrong. I opened a PR, https://github.com/xerolinux/calamares-config/pull/1. In any case, finding the LOG file in the /var/log directory in the installed system is easy.

Note: the first time I tried the installer on a virtual machine, Calamares crashed:

I had to start from scratch. The next time, I updated the mirrors before starting the installation, and the installation went fine. I can’t tell what went wrong the very first time.

The installed system

Let’s start with the impressions about the installed system.

The BTRFS subvolume layout looks good to me, or at least, that’s how I create the subvolumes myself in other distributions:

where, besides the standard @ and @home, we have @log, @tmp and @cache that correspond to the directories in /var, @root is for the /root folder, and @srv for /srv.

These are the mount options of the BTRFS subvolumes (in the /etc/fstab file):

I don’t like the “discard=async” in the file /etc/fstab. Since fstrim is enabled once a week, I prefer not to have “discard=async” so I edited /etc/fstab accordingly. From what I know, the “ssd” should not be necessary since BTRFS should recognize that it’s using an SSD. However, it shouldn’t harm.

Another thing I don’t like is that the journald log is not persisted on reboots. I reported that on the forum, https://forum.xerolinux.xyz/thread-184.html. Apparently, that’s not intended. I can fix this by editing /etc/systemd/journald.conf and changing the line

to the default (you could simply remove the line, but I prefer to comment it to remember that the default is “auto”):

Moreover, I had to delete the file /etc/systemd/journald.conf.d/volatile-storage.conf (which also contains the “Storage=volatile”). Reboot, and now the log stays there even after rebooting.

The home page mentions, “This distro is 90% ArchLinux & 10% custom.” Indeed, these are the additional packages https://github.com/xerolinux/xerolinux_repo/tree/main/x86_64. Besides a few pre-compiled packages (instead of the source versions of the same packages in the AUR repository), there are many packages about theming. I’d tend to say that XeroLinux is “very” Arch, and I like that.

The installed KDE

As I had already anticipated, the KDE desktop environment, customized by XeroLinux, looks really good. It uses many parts from the Lyan theme and Tela icons (I had already blogged about that), however, for the “Application Style”, it uses Lightly instead of Kvantum (as shown in the XeroLinux site and videos, you can easily switch to different themes, actually “rices”, provided by XeroLinux itself). I was already a fan of Lyan and Tela, so I liked the outcome.

You find a dock at the bottom, which is a Latte dock. (By the way, by default, the Latte dock is set to “Dodge Maximized”, which is not ideal for me: I prefer “Dodge Active”.) Also, the top panel is not a standard panel: it’s, again, a Latte panel. They are both transparent (blurred), and you have a global menu, a la macOS. I’m not a big fan of the global menu, but I’ll try to stick with that for the time being. There are a few useful widgets: in the bottom dock, you have the CPU usage, and in the top panel, you have the network usage.

For KDE applications, you don’t need to go to the menu if you use the shortcut “Ctrl + Alt + I,” which opens a global search on the menus of that application (the so-called HUD). For example, here’s the HUD for Dolphin:

Speaking of KDE Desktop effects, you have several effects enabled by default: “Slide back”, “Wobby Windows”, etc. Not the “Magic Lamp” effect, which is one of my favorites, but enabling that is easy.

Moreover, you get “blurred” in most places. It’s eye candy, and I like it 🙂 In that respect, as mentioned on the XeroLinux site, you need a powerful computer to deal with all these effects. On my Dell XPS 13, everything is smooth. Moreover, I don’t see such effects impacting power consumption when on battery.

Look at the blurred effect on the custom Konsole profile (which is set as the default one):

And what about the cool “ls” output? Well, that’s because “ls” is automatically aliased to exa, a modern replacement for ls.

Here are the blurred menus:

Lightly also can blur the Dolphin view, which is enabled by default. Unfortunately, since I’m using fractional scaling, that does not work.

By the way, Dolphin is already configured with the Dropbox plugin enabled. As soon as you install Dropbox, you have overlay decorations on the Dropbox folder.

Moreover, also the KDE drop-down terminal, Yakuake, is already configured and ready to use with F12.

Speaking of searching, the custom “Application Menu” separates search results (files, i.e., “Desktop search”, “Settings”, “Applications”, etc.):

A thing that gave me a few headaches with Kalendar and Korganizer (e.g., for accessing Google Calendar accounts) is that the KWallet subsystem is DISABLED by default (that’s one intentionally). As a consequence, I wasn’t able to access any Google calendar without any feedback. However, it’s just a matter of enabling the KWallet subsystem. By the way, I have no problem with the KWallet subsystem enabled, despite what was described in the XeroLinux forum as the motivation for disabling the KWallet subsystem.

XeroLinux specific features

The Xero Hello program is also very useful! It provides several menus

The “Install Drivers”:

I particularly like the “Post-Install System Configuration”:

For example, it has a menu for switching the shell from BASH to ZSH with Oh My Zsh (including a few common plugins, e.g., completions, suggestions, and source highlight, not to mention the beautiful Powerlevel10k theme). It takes care of cloning Oh My Zsh, and its plugins and sets the shell for the current user:

Speaking of beauty, XeroLinux comes with a very good set of good-looking wallpapers! (see https://github.com/xerolinux/kde-wallpapers/tree/main/usr/share/wallpapers):

The “Update System Now” is also very powerful. It gives you a choice to update Everything (by relying on Topgrade): not only Pacman, AUR, and Flatpak packages but also fuwpd, Oh My Zsh and its plugins (if you installed that), and Docker images (if you have installed Docker).

Final thoughts

I like XeroLinux, and I like its BEAUTIFUL theming! It makes me want to use KDE again 🙂

Most of all, I think it is similar to EndeavourOS, which I also like: it’s basically Arch (not like Manjaro, which I evaluated in the past, but which somehow twisted Arch) with interesting customizations.

Developing Ansible roles on a PineBook Pro with Gitpod

In a previous post, I showed an example of an Ansible role tested with Molecule and Docker using the Gitpod development environment. With such an approach, you develop using Visual Studio code on your browser. Resources and computational power is provided by Gitpod, not by your computer. When your computer is a PineBook Pro, an arm-based laptop with low computational power and just 4 Gb of RAM, using Gitpod makes the difference. Though I guess it’s possible to install Docker on the PineBook Pro, I doubt it’s feasible to efficiently use it for testing Ansible roles with Molecule and Docker.

But with Gitpod, it can be done! Here’s my Firefox browser on a PineBook Pro with an open Gitpod workspace:

I can quickly develop and run Molecule tests or manually enter the Docker containers after running Ansible playbooks on them!

I doubt developong and testing such things completely on a PineBook Pro would be this comfortable and efficient! 🙂

The Overview effect got better in KDE 5.26

I’ve updated KDE to version 5.26, which arrived in Linux Arch. In particular, I’m testing this new version in my XeroLinux installation.

One of the improvements that caught me immediately was how this version’s Overview effect has improved!

In the previous version (KDE 5.25), the Overview allowed to search both in applications and in currently opened windows (besides providing search results for other things such as files, folders, and other options configured in “Plasma Search”). However, opened windows and other search results were all mixed in the dropdown list. Although opened windows were reported slightly different from other results, they were all together. Moreover, open windows were not shown after you started typing in the filter text box. On the contrary, I would have liked some visual filtering for open windows, like in the “Present Windows” effect. For this reason, I was using “Present Windows” most of the time for searching for open windows and KRunner for everything else.

This behavior has changed now: the Overview behaves just like I would have liked. If what you typed in the search text box matches any open windows (name of the application or title of a window), the open windows are filtered, and no other search results are shown. On the contrary, if what you typed in the search text box does not match any open windows, you get the other results! Well done! 🙂

Here are a few screenshots demonstrating this new behavior (I opened a few applications and Firefox on a page containing “KDE” in the title).

This screenshot shows the Overview effect when invoked:

If I press “k”, only Kate, Konsole, and Firefox windows are shown (remember, Firefox has “KDE” in the title):

If I enter “ka”, only Kate is shown:

If I enter “ko”, only the two Konsole windows are shown:

If I enter “kd” or “fi”, then only Firefox is shown:

If I enter “chr”, then since “No matching windows” are found, I get the standard search results:

I hope this behavior of the Overview effect won’t change in future versions because I like it, and, IMHO, that’s how it should be 🙂

Note: as it happened in the past, the Overview effect sometimes crashes when you select a window or something from the search results. As a result, kwin restarts automatically. Sometimes, after an update, this is fixed. Sometimes, the bug shows up again.

As a comparison, this is the old behavior of the Overview. Here’s a screenshot with two applications opened, including a Konsole window:

If I start typing “kon”, I get the full list of search results:

It is true that the open window of Konsole is the first result, but I find this old behavior harder to use: it’s harder to spot the open window.

An Ansible role tested with Molecule in Gitpod

I’m mainly a Java developer and still haven’t found a way to use Gitpod for Java development. Gitpod allows you to spin up fresh development environments from your GitHub projects so that you can code with Visual Studio on the web (that’s just a very reductive definition, so you may want to look at its website for the complete set of features). I honestly prefer to have my IDE (Eclipse) on my computer.

However, I probably found a use case for Gitpod that’s also good for me! I recently started playing and having fun with Ansible to automate all my Linux installations. I’m also test-addicted and want to test my Ansible playbooks and roles automatically. For testing Ansible playbooks and roles, I use the mainstream technology Molecule. Molecule allows you to thoroughly test Ansible tasks by running them against a Docker container. (I’ll blog about my Ansible playbooks, roles, and how I use Molecule shortly.)

Once you have Docker installed on your system, setting up Ansible and Molecule is not hard. However, due to the used technologies, running Molecule tests stresses your computer a bit due to disk usage (because of Docker images and containers; also because Molecule allows you to test Ansible tasks against different Docker images) and due to computational power. Indeed, it would be best if you had a powerful computer to use Molecule. I don’t always have one with such computation power with me; if I have, I might need that with some concurrent development tasks.

That gave me a chance to evaluate Gitpod for the task of testing an Ansible role with Molecule on Gitpod. In this blog post, I’ll detail, step by step, how I set up my Gitpod development environment for this job. The Ansible role used in this example is trivial and is not the post’s goal.

On my computer, I install Ansible and Molecule (with Docker support) with the following pip command:

Then I create an Ansible role ready to be tested with Molecule as follows:

I created a Git repository and pushed that to GitHub: https://github.com/LorenzoBettini/ansible-molecule-gitpod-example.

To access Gitpod easily from a GitHub repository, I installed the Gitpod browser extension.

Now, I can start Gitpod for this repository using the button (as I said, you need to use a browser extension; otherwise, you have to prefix the URL appropriately):

Let’s press the “Gitpod” button. The first time you use Gitpod, you’ll have to accept a few authorizations.

NOTE: in this blog post, I’m using the light theme of Visual Studio in Gitpod.

Once the Visual Studio code was open in the browser, I was welcomed by a “Get Started with Gitpod”:

First, let’s set up the main developer tools in the Gitpod workspace (a Linux OS): Ansible and Molecule. We’ll install them using Python Pip (as I’ve done on my local machine), which is already available in Gitpod.

In the Visual Studio terminal, I run:

The above command will take about a minute to terminate (we’ll get back to this later)

Then, we can verify that molecule (and ansible) are installed:

Now we can run Molecule from within the Gitpod workspace. We can try and run “molecule converge” (though our Ansible role doesn’t do anything at the moment). After that, we can enter the container with “molecule login” (from the generated molecule/default/molecule.yml file, we can see that it’s based on the Docker image “quay.io/centos/centos:stream8“):

Instead of running “converge”, we can let Molecule create the Docker image with “molecule create“. We would still be able to enter the Docker image as above.

Let’s stop the workspace:

(To close a workspace, we could close the workspace browser tabs: within three minutes, the workspaces will be stopped.)

If we get back to Gitpod and create a new workspace (that is, we don’t use the Gitpod dashboard to restart the workspace we have just stopped), we will lose the installed programs ansible and molecule. Let’s make the installation of these tools permanent, so we’ll find them each time we start a Gitpod workspace for this GitHub project.

To do that, let’s run “gp init“. This command will create a new .gitpod.yml file (with some example contents; see the documentation for more details about this file) where we can configure the workspace for our project. This configuration will be stored in the git repository of this project. Once this file is in place, Gitpod will pre-configure our workspace each time we enter Gitpod for the current project.

I’m changing the file as follows:

As written in the documentation:

To test your .gitpod.yml file, you need to commit and push the file to your repository and open a new workspace either by using the Gitpod extension or prefixing your repo URL with https://gitpod.io/#.

If you don’t want to have multiple commits as you’re testing and making changes to your .gitpod.yml, you can make changes from a new branch.

For the moment, let’s commit and push directly to the master or main branch (of course, by using Visual Studio):

Let’s stop the workspace and get back to Gitpod. We will see the output of our “init” command, and Ansible and Molecule will be available.

However, from what I understand, for installing programs that are indispensable during development, instead of using an “init” task, it’s better to provide a custom Docker image with the programs already installed.

To do that, we add this section to the .gitpod.yml file:

Then, we create the file .gitpod.Dockerfile. As soon as the file is created and opened, Visual Studio suggests we install the Docker extension in Visual Studio:

Let’s choose “Install Do not Sync”. Once the extension has been installed, we can use the gear icon and specify to add the extension to the .gitpod.yml file:

The file will be automatically modified with the following new section:

This way, each time we open the workspace of the project or someone else does (e.g., for contributing), the Docker extension will be automatically available.

Let’s implement the Dockerfile by starting from the full Gitpod workspace image (the one we have used so far because it’s the default image) and by installing Ansible and Molecule in the Docker image:

Note: Gitpod suggests using a specific tag instead of “latest” to help the reproducibility of the workspace. For this simple example, we’ll simply use “latest”.

Now that we have a custom Dockerfile for the image of our Gitpod workspace, instead of stopping the workspace and opening a new one, it might be better first to verify whether we can build such an image (remember, in Gitpod, you have docker available after all):

Then, we can enter that image and verify that our desired programs are installed:

Doing such a check before starting a new workspace lets us immediately spot possible problems with our custom image.

You notice that building the Docker image takes a lot of time. That’s because we started from the full Gitpod base Docker image (a big image), which contains support for several languages. We’ll optimize this later.

We remove the “init” task from the .gitpod.yml file. However, we can use a “before” task specific to this project (the pip packages are typical of Ansible and Molecule projects). We have Molecule create the Docker instance (see the molecule.yml file shown above in the screenshot). This will make the Docker image used in our Molecule tests already pulled when we open the workspace:

To summarize, this is the .gitpod.yml file (note that I also added the Gitlens extension, which is very useful for Git repositories):

We can start a new workspace. Now Gitpod knows about our custom Dockerfile and builds that image for us. In particular, whenever we start Gitpod for this repository, Gitpod checks whether the Dockerfile has been updated and rebuilds the image if needed. Thus, building our custom Docker image will take some time only the first time, and if we change the Dockerfile.

When the workspace start, we’ll see Gitpod building our image:

Similarly to when we built our custom Docker image in the workspace, this will take some time because we start from the vast “workspace-full” image.

Maybe we can do better and start from the Gitpod workspace image that provides only Python support. After all, for this project, that’s all we need (we don’t need Java, C++, etc.):

I also took the chance to update Pip itself. In the previous runs, I had seen such a message:

As done before, let’s first check that the image builds fine locally and that, in the end, it contains our required software.

We can start a new workspace. Gitpod realizes that our Dockerfile has changed and rebuilds it. This time, this should be faster.

It took some time, but now we have an IDE for our project on the web. The files we have created can be reused for similar projects. For projects using different languages, the customization will be different.

We can start implementing the tasks for our role. For example, let’s edit the file tasks/main.yml. In this example, we want to install ZSH:

Let’s save, and run “molecule converge” (remember, the Docker image for our molecule test has already been downloaded during the workspace opening). We’ll get an error:

That’s because “sudo”, which is required by our task (“become: true”), is not installed in the Docker image we use for testing (“quay.io/centos/centos:stream8“). We can prepare our instance with a molecule/default/prepare.yml playbook or use another RedHat-based Docker image, which already comes with “sudo”, e.g., “fedora:36”. For this simple example, I’ll go with the latter solution. We change molecule/default/molecule.yml accordingly:

Since we have now changed the Docker image for Molecule tests, we must first “destroy” the current Molecule image (“molecule destroy“) and then try to “molecule converge” (this time, a new Docker image will be downloaded). Now “converge” should succeed. We can also run a complete Molecule scenario with the command “molecule test” (this will also check idempotency and verify possible assertions; currently, we don’t have any assertions).

We can also add a badge to the README of the GitHub repository to quickly jump to Gitpod. That’s useful for contributors who don’t have the Gitpod extension. The markdown code for the badges can be found at https://www.gitpod.io/docs/introduction/getting-started. For this project, I add this markdown code to the README file:

You may want to experiment with other Visual Studio extensions like the “Ansible” extension. If you install that, you’ll get a warning of the shape:

That’s because we haven’t installed the command “ansible-lint”. We can do that with Pip. We should also update our custom Docker image accordingly. I will not do that for this simple example, though.

That’s all for now. I hope you found this post useful to get started with Gitpod 🙂

Timeshift and grub-btrfs in Ubuntu

UPDATED 22/Dec/2022, ChangeLog:

  • 22/Dec/2022: added the flag “-czstd” for defragmentation and compression.
  • 20/Nov/2022: documented the new version of grub-btrfs and its new grub-btrfsd daemon; the configuration for Timeshift is much simpler, but you have to install another package: inotify-tools.
  • 17/Nov/2022: documented that I could also create additional subvolumes and move existing contents from the running system

In this post, I’ll describe the same procedure I described in one of my previous posts but applied to Ubuntu (in particular, Ubuntu Jammy 22.04). I’m not describing an autosnap mechanism when performing package updates in Ubuntu, though you might want to try timeshift-autosnap-apt for that.

If you choose the BTRFS filesystem when you install Ubuntu, you get the two subvolumes “@” for “/” and “@home” for “/home”, which will make Timeshift work since that’s what Timeshift expects to find to take BTRFS snapshots.

However, some adjustments are still worth making to avoid useless data ending in the snapshots and to be able to boot snapshots directly (with the help of grub-btrfs).

Adjust compression

Ubuntu does not mount BTRFS subvolumes with compression. Instead, I prefer to have compression on BTRFS.

To do that, right after the installation, I change /etc/fstab by adding compression and “noatime” to the existing entries for “/” and “/home” (as usual, UUID must be replaced with the UUID of your disk partition):

Save the file, reboot, and perform “defragment” so that the existing data gets compressed:

It’s also best to create /var/lib/portables and /var/lib/machines if not already there

I’m not using these directories, but it looks like systemd creates them automatically as nested subvolumes. Nested subvolumes will force you to do some manual removal after restoring a snapshot and removing old snapshots.

The current situation of subvolumes should be as follows:

Create additional subvolumes

With the current subvolume layout, things like logs and caches will end up in snapshots, giving you problems when you try to boot a snapshot (which we want to be able to do).

Creating a subvolume for the whole /var directory is not ideal because we lost the contents of essential things like /var/lib in the snapshot, so we could not restore a snapshot correctly. Instead, we create subvolumes to mount /var/log, /var/cache, and /var/tmp.

Since we have to move the existing contents of such directories into the new subvolume, it’s better to operate from a Live ISO.

UPDATE 17/Nov/2022: I also tried to create the new subvolumes and move the existing contents in the running system, following the steps described below. It worked! However, I’d still suggest you do the next steps from a Live ISO because you never know 😉

So, let’s boot a Live ISO (e.g., Ubuntu live installation medium).

Switch to superuser (no password required in the live media):

Mount the BTRFS filesystem into /mnt, which should already exist in the live media. We have to mount the partition hosting our existing installation. In my example, it is /dev/sdb10:

You should see the existing subvolumes in the mount directory:

Create the new subvolumes

Here are the new subvolumes:

Let’s move the contents of /mnt/@/var/log to /mnt/@log and the same for /mnt/@/var/cache into /mnt/@cache

The directory /mnt/@/var/tmp/ should be empty, so there’s nothing to move (you may want to check that).

Adjust the fstab of the installed system to point to the renamed subvolumes and mount the new subvolumes as /var/log, /var/cache, and /var/tmp

You will have to use the correct UUID, which is the same as the one for the already mounted volumes (when you copy and paste, make sure you update both the mount point and the subvolume name consistently):

Remember to double-check everything!

Let’s unmount the partition

and we should be able to reboot the system, hopefully without problems

Install Timeshift

We can install it from the Ubuntu repositories with

NOTE: since this is not the latest version, Timeshift will always generate snapshots in the same directory, so there’s no need for the additional fixed mount point as in Arch (see my previous post).

Let’s create a new Timeshift snapshot and browse it with the Timeshift toolbar button “Browse”. We can verify that the directories @/var/log, @/var/cache, and @/var/tmp are empty in the snapshot. The same holds for home (but that was already true thanks to the initial subvolume for home).

Configure grub-btrfs

We have to install grub-btrfs from sources because there’s no official package for Ubuntu. However, after installing the dependencies,

the installation procedure is straightforward:

We now need to configure that to monitor the Timeshift snapshot directory instead of the default one (/.snapshots).

Updated version (20 November 2022)

UPDATE 20/Nov/2022: A new version of grub-btrfsd is available only by installing from sources. What follows is based on this new version. At the bottom of the post, there are still the old instructions, but they’re not valid anymore.

If you see an ASCII splash screen installing grub-btrfs from sources, you’re using the latest version.

Now, let’s make sure grub-btrfs can find Timeshift’s snapshots (remember, we’ve just created one). So let’s run update-grub, and we should see in the end something like the following output:

The last lines prove that grub-btrfs can detect snapshots.

Automatically update the grub menu upon snapshot creation or deletion (20 November 2022)

UPDATE 20/Nov/2022: A new version of grub-btrfsd is available only by installing from sources. What follows is based on this new version. At the bottom of the post, there are still the old instructions, but they’re not valid anymore.

Grub-btrfs provides a daemon watching the snapshot directory and updates the grub menu automatically every time a snapshot is created or deleted.

Important: This daemon requires an additional package:

By default, this daemon watches the directory “/.snapshots” (the default directory for Snapper). Since Timeshift uses a different directory, we have to tweak the configuration for the daemon.

Let’s run:

We must change the line

into

This is required for Timeshift version 22.06 and later because Timeshift creates a new directory named after their process ID in /run/timeshift every time they are started. Since the PID will be different every time, also the directory will be different. Grub-btrfs provides the command line argument –timeshift-auto to correctly detect the current snapshot directory (In previous versions of grub-btrfs, we had to tweak /etc/fstab to deal with that).

Let’s start the daemon:

In the journalctl log, we should see something like (where the date and time have been stripped off):

Let’s start Timeshift. In the journalctl log, we should see something like this:

Let’s verify that if we create a new snapshot, grub-btrfs automatically updates the GRUB menu: in a terminal window, run “journalctl -f” to look at the log, then create a new snapshot in Timeshift. In the log, you should see something like the following lines:

Similarly, if we delete an existing snapshot, we should see something similar in the log.

Remember that it takes a few seconds for grub-btrfs to recreate the grub menu.

Once we’re sure everything works, we can enable the daemon to always start at boot:

The next time we boot, our grub menu will also show a submenu to boot snapshots.

Concerning doing some experiments booting a snapshot and restoring it, please look at my other post.

Old version (with old release 4.11)

UPDATE 20/Nov/2022: These are the older instructions for the previous version of grub-btrfs, where there was no “grub-btrfsd.service” and there was another systemd program (“grub-btrfs.path”).

I leave these instructions here just for “historical reasons”.

The file contents

should be replaced with

Let’s reload and re-enable the monitoring service:

If we have already created a few snapshots, we can run update-grub and verify that new grub entries are created for the found snapshots:

Let’s verify that if we create (or delete) a snapshot, grub-btrfs automatically updates the GRUB menu: in a terminal window, run “journalctl -f” to look at the log, then create a new snapshot in Timeshift. In the log, you should see something like the following lines (where the date and time have been stripped off):

This output tells you that the grub-btrfs monitoring service works!

The next time we boot, our grub menu will also show a submenu to boot snapshots.

Concerning doing some experiments booting a snapshot and restoring it, please look at my other post.

Taming KDE baloo

Quoting from https://community.kde.org/Baloo,

Baloo is the file indexing and file search framework for KDE Plasma, with a focus on providing a very small memory footprint along with extremely fast searching.

Unfortunately, it has a bad reputation for being a resource hog. However, it all boils down to configuring it appropriately (of course, according to your needs), and not only will it be “tamed”, but it will also work fast, using a few resources, and it will be your friend when using KDE.

In this article, I describe how I configure it to be fast and functional without being a resource hog.

I anticipate that I use baloo only for file search, NOT content searching. I don’t think baloo is the best tool under that concern because it updates its index continuously. For content searching, I suggest Recoll. You can configure Recoll to update the index a few times daily, which is typically enough. Moreover, Recoll provides more powerful query mechanisms for content searching than baloo. If you want baloo to index file contents, remember that this requires more resources and time to complete.

First of all, configuring baloo should be the first thing you do after you install KDE and log in to KDE for the first time. At least, it would be best if you disabled it before filling your home folder with all your contents.

Whether baloo is enabled or disabled by default depends on the distribution. Go to System Settings -> Search -> File Search.

In this example, it’s disabled. Let’s check “Enable File Search” and uncheck “Also index file content” (at least, I disable indexing of file contents for the reasons I said above). DON’T PRESS “Apply” yet. Another problem with the default configuration is that it will index all the files in your home folder. That’s probably too much unless you want to search everywhere in your home folder (including temporary files, locally installed binaries, etc.).

In that respect, I prefer to exclude my home folder and provide some subfolders to be indexed. So I use the dropdown menu and exclude my home folder:

Then, I add the folders I want to be indexed with the button “Start indexing a folder…”:

Now, you can hit “Apply”, and after some time, you can see that indexing completes. With an SSD and indexed folders that do not contain many files, it takes baloo just a moment to index the selected folders.

You may also want to learn to use the command balooctl from the terminal to have more control over baloo and retrieve indexing information. For example, here’s an example of the status subcommand and its result on my system after the configuration above and after the indexed directories are filled with my data:

Learning more about baloo configuration to have fine-grained control of its indexing functionality is even better. For example, you can refine the configuration by excluding some files from the specified indexed folders based on their extensions or with regular expressions. As far as I know, you cannot do that from the system setting’s dialog shown above. You have to tweak the configuration file ~/.config/baloofilerc.

The interesting part is “exclude filters=…” where you specify a comma-separated list of regular expression for excluding files or folders. It comes prefilled with some sensible values for exclusions. You can add your own exclusion filters.

After modifying this files, I’d suggest you rebuild the index with this command:

After the index is recreated, many files have been excluded:

You can enjoy baloo file search from the “Search” in the “Application Menu” and from “KRunner” (Alt+space). In that respect, KRunner might take some time before it correctly shows the indexed files after a re-index.

Now, baloo is tamed and you can enjoy its features without losing your resources.

Final thoughts: for you sure, you must make sure things like BTRFS snapshots don’t end in the folders to be indexed, or you will have several problems, including lots of resource usage not to mention duplicate results during the search.

Fixing Docker problems in Fedora

In this post, I’ll describe a few problems with Docker in Fedora and how to fix them. In particular, I’ll try to provide an analysis of the problems and the sources of the solutions.

I’ve experienced a few problems with Docker in Fedora (35 and 36). I first installed docker-ce by following the official documentation: https://docs.docker.com/engine/install/fedora/. Things went smoothly at the beginning with the first Docker images, e.g., the “hello-world”, “ubuntu,” and a few others.

However, I started to experience severe problems with this image “mysql:5.7”: the container took a lot of time to start, and I noted that Docker immediately ate my whole RAM, 16 Gb. If I don’t terminate the process, the computer will likely hang in a minute or less.

This is a docker-compose file to recreate the problem:

Save it to “docker-compose.yaml” and start it with “docker-compose up” and see the problem.

You must install the package docker-compose from Fedora’s repositories to verify the problem. I anticipate that the problem is not due to docker-compose because I have precisely the same problems with the above Docker image even if I run it without docker-compose (e.g., during a Maven build).

There’s no problem with a more recent version of the MySQL image, e.g., “mysql:8.0.27”. However, there’s something wrong with Docker in Fedora because the same docker-compose file using “mysql:5.7” does not give me any problem and works perfectly in other Linux distributions like Ubuntu and Arch.

I also experienced slow performance and ram draining when running an ansible molecule test with one of my ansible playbooks, e.g., running a flatpak installation in a Docker container. Again, only in Fedora.

I reported here https://ask.fedoraproject.org/t/docker-very-slow-in-fedora/23214 without getting any solution.

Here are the solutions I found myself.

Use moby engine (and tweak its configuration)

Instead of using “docker-ce”, I tried moby-engine (https://mobyproject.org/), which provides the same “docker” command line tools. The existing docker-compose works with moby as well. As stated here https://fedoramagazine.org/docker-and-fedora-35/, moby-engine is the “Fedora’s way” (though the official Docker package is said to work as well).

Surprise! the above docker-compose file works like magic: it starts fast and does not eat RAM. Also, my ansible molecule tests work perfectly.

Unfortunately, you run into problems using the excellent Testcontainers library. This problem is due to SELinux (that figures!!!). You can use this example project (taken from my TDD book): https://github.com/LorenzoBettini/it-docker-mongo-example. If you have Java and Maven installed, you can clone the repository, enter the directory “com.examples.school,” and run “mvn verify”. When it comes to Testcontainers tests, you get errors of this shape:

If you temporarily disable Selinux:

The Testcontainers tests will succeed.

However, let’s try to fix this problem once and for all.

To understand why moby-engine’s docker command works while docker-ce’s docker does not I inspected the version of the file /usr/lib/systemd/system/docker.service file provided by the moby-engine’s installation and the version provided by docker-ce’s installation.

These are the interesting parts of the docker.service file that comes with the moby-engine package:

While these are the corresponding parts in the version of the file provided by the docker-ce package:

The main differences are:

  • docker-ce uses a simple command to start the Docker daemon
  • moby-engine passes more arguments and relies on additional arguments (the OPTIONS environment variable) read from the additional file /etc/sysconfig/docker, whose contents are listed here:

First, I like this approach of relying on a separate file, which the user can customize. I understand that updates to the moby-engine package will not overwrite this file.

Thus, to avoid the Selinux problem with Testcontainers, it is enough to remove the “–selinux-enabled” argument in the above file. These are the steps:

  • Stop docker, “sudo systemctl stop docker”
  • Modify the file as follows:

  • Restart docker “sudo systemctl daemon reload && sudo systemctl start docker”

Moreover, disabling SELinux in the above file is also required if you, like me, prefer to have the docker directory (by default, it is /var/lib/docker) in another place (e.g., in a standard partition, which is not BTRFS and which is shared among several Linux distributions on the same computer).

Here’s an example of customization of the above file to tell Docker to use a different root directory:

If you use a different root directory with SELinux enabled, you might get errors when running containers of the shape

Fixing docker-ce

By taking inspiration from the configuration of moby-engine, we can also fix docker-ce by tweaking its configuration.

Of course, stop the Docker service (“sudo systemctl stop docker”) before doing the following steps.

It makes no sense to modify the file /usr/lib/systemd/system/docker.service directly because that will be overwritten by docker-ce package updates (I’m sure about that: I’ve seen it).

Instead, we first create the file /etc/sysconfig/docker (which does not exist in docker-ce installation) by removing a few arguments that would not work in docker-ce:

Then, we create another service file to specify the Docker daemon execution command:

And these are the contents of the created file:

Restart docker “sudo systemctl daemon reload && sudo systemctl start docker”. Everything should now work with docker-ce!

Of course, this approach also works with a specified “–data-root” argument, as seen in the moby-engine example.

Conclusions

On a side note, it might be enough to use only a subset of arguments in the docker-ce configuration taken from moby-engine. However, I think I wasted enough time debugging these problems in Fedora, and for the time being, I’m happy with these existing configurations.

I also want to stress my disappointment about how Fedora makes developers’ lives hard in these situations. I decided to debug these Docker problems and find solutions as a challenge. However, my interest in Fedora and my initial appreciation for this distribution significantly decreased. I won’t stop using it shortly, but I will not use it as my daily driver. For that, there’s Arch! 🙂

VirtualBox in Fedora Linux

I have no problem installing VirtualBox and the related tools and extensions in Ubuntu and Arch. In Fedora, things are a little bit harder.

First, I think it’s better NOT to download binaries distributed by VirtualBox: I’m using Fedora packages that are available from RPM Fusion Free. Thus, first of all, you have to enable such a repository.

Then you run

It’s also best to add your user to the VirtualBox group:

And reboot, of course.

Then, to have additional features, you should install the VirtualBox extension pack. That’s where Fedora gets complicated. Differently from Ubuntu (package virtualbox-ext-pack) and Arch (package virtualbox-ext-oracle), you will not find a corresponding package in the RPM Fusion repositories.

You need to download the file from the VirtualBox website manually, http://download.virtualbox.org/virtualbox/. You must download a file of the shape Oracle_VM_VirtualBox_Extension_Pack-<VERSION>.vbox-extpack where <VERSION> must match the version of VirtualBox you installed. Then, you install it inside VirtualBox with File => Preferences => Extensions.

If the versions don’t match, you will have trouble starting your virtual machines with errors of the shape:

I experienced such a problem and asked on the Fedora forum.

Then, I realized that VirtualBox had been upgraded during a system update, but I forgot to download and install the updated extension pack. You can see the versions don’t match:

I then downloaded the corresponding file http://download.virtualbox.org/virtualbox/6.1.38/Oracle_VM_VirtualBox_Extension_Pack-6.1.38.vbox-extpack. And added it to the “Extensions” preference (selecting “Upgrade”):

That was enough to go back to running my VirtualBox machines.

However, I must admit that the whole procedure for using VirtualBox in Fedora is much more cumbersome and error-prone than in other distributions 🙁 It’s far too easy in Fedora to forget about package upgrades that require manual interventions. In general, I’d like to avoid manual interventions at all 😉

Again woes for KDE and Google Accounts

TL;DR If you want to access your Google Calendars from Korganizer or Kalendar, remember to enable “Enable the KDE wallet subsystem”.

I had already written about the cumbersome procedure to access Google accounts in KDE, and I thought I had learned enough to “easily” set my Google calendars in KDE. I was wrong. Today I tried KDE again (I’m mainly a GNOME user for the moment) in a brand new Arch-based installation. I also decided to try the new calendar application, Kalendar. I managed to add a new calendar by selecting “Google Groupware”:

(By the way, once you selected “Google Groupware”, can you spot any “Add”, “OK”, or any other way to confirm the selection? There’s “Close”, but I’d assume that is for canceling the selection… IIRC, you must double-click on the selection; anyway, that’s odd!)

But then, I couldn’t configure it: I pressed the button “Edit,” and nothing happened!

I mean, no error pop-up. Nothing printed on the console if I ran Kalendar from the command line. Nothing in the journalctl log. NOTHING!

The same happens with Korganizer. The Google Groupware calendar already appeared because Kalendar and Korganizer share the same calendars. The problem is still there: the calendar is not configured and clicking “Modify” led to nothing. No error. NOTHING again!

To cut a long story short: you must enable the wallet subsystem in the KDE system settings:

How could it be possible? In 2022, KDE and its programs cannot cooperate in providing meaningful information when something goes wrong! And in KDE, things often go wrong.

For example, it’s been more than one year since KAddressBook cannot access Google’s address book! https://bugs.kde.org/show_bug.cgi?id=439285.

SSH into a VirtualBox machine

I use VirtualBox a lot for testing purposes, mainly to experiment with a Linux distribution (to see whether it’s worthwhile to install it on bare metal) and to test procedures that might involve some complex (and maybe “dangerous”) operations.

After you install VirtualBox Guest Additions, things like bidirectional copy-and-paste will work. Some distributions seem to enable and install such additions right from the start (e.g., Fedora, if I’m not wrong). However, there are many situations where you’re installing a distribution in a VirtualBox machine. If Guest Additions are not already working, you will not be able to copy and paste anything. For example, the ISO of Arch Linux even comes in textual mode only, and it’s helpful to be able to copy and paste commands.

In such situations, I prefer to SSH into the virtual machine from a local terminal: copy and paste will work (since I’m in a local terminal). Moreover, the keyboard layout will be the one of the local system (the host). Thus, the keyboard layout will be already configured correctly. While in the virtual machine, you’d have to configure the keyboard layout. Finally, you can quickly transfer files via SSH between the host and the virtual machine without configuring shared folders.

Before being able to SSH in a virtual machine, you need two things:

  • An SSH server up and running in the virtual machine (how to do that depends on the specific Linux distribution)
  • Configure port forwarding in the virtual machine: for instance, all connections to a specific port on the host will be forwarded to port 22 (the default SSH port) on the virtual machine.

I could do the second operation through the “Settings” of the machine. That requires a few dialogs and filling a few table cells. However, I prefer to do that with a single command from the host. For example, I create and configure a new virtual machine, let’s say with the name “My Machine”. When it is not running, I run from the host:

Then, when I start the virtual machine, assuming the SSH server is configured in the virtual machine, I SSH into the machine through the local port 2522. Of course, you can choose any free port number on your host. For example, assuming there’s a user foo in the virtual machine, I run:

Let’s see a complete example.

Let’s say I create a virtual machine called “Arch Gnome” for installing Arch Linux. I configure it appropriately. In particular, I “insert” the ISO of Arch Linux into the virtual CD ROM drive of the machine. Before starting the machine, I run from the host:

Start the virtual machine:

Inside the live environment of Arch Linux, the SSH server is already up and running. However, since we’ll connect with the root account (the only one present), we must give the root account a password. By default, it’s empty, and SSH will not allow you to log in with a blank password. Choose a password. This password is temporary, and if you’re in a trusted local network, you can choose an easy one.

Now, we can connect via SSH to the virtual machine through localhost. If you have already connected via SSH to localhost, you might get an error of the shape:

All you have to do is edit the known_hosts file by removing the offending lines and try again. You will have to remove all the lines that start with “[127.0.0.1]:2522”.

Note that we’re using port 2522 because we previously used that for creating the port mapping. Let’s connect to the virtual machine and type the password we have previously specified for the root account inside the virtual machine (Accept the fingerprint, when asked.):

In your local terminal, you see that you get the colors of the virtual machine (now, you’re inside the virtual machine):

The keyboard layout is the one of the host; as usual, you copy and paste the text into the local terminal and run commands in the virtual machine, but more comfortably since you’re in your local terminal. You can also transfer files with “scp”.

For transferring files, you could also configure your file manager to access the “remote” server (the virtual machine) and browse and perform operations on the virtual machine’s file system from your local file manager.

Some benchmarks for building an Eclipse project: Linux, Windows, macOS (M1)

I want to share some benchmarks for building an Eclipse project with Maven/Tycho. I built the project on Linux, Windows, and macOS (in particular, on my Mac Air M1 2020).

I stressed that the macOS environment is an M1, the new Arm-based chip from Apple, which is said to be quite efficient and performant. However, I also used an older Mac Air 2016, so no M1 here.

Concerning Linux and Windows, I used an LG GRAM 16. Both are good machines with powerful processors, 16Gig RAM, and NVMe disk. I ran the same build on a few Linux distributions (Arch, Ubuntu, Fedora) and the results concerning Linux are basically the same.

The Eclipse project is Edelta, https://github.com/LorenzoBettini/edelta, “An Xtext DSL for EMF metamodels refactoring and migration.” It’s quite a complex project with an extensive test suite: unit tests, integration tests (JUnit Plug-in tests), and SWTBot tests. The project also includes a custom Maven plugin, which is also tested. Yes, I’m test-addicted 😉

To avoid the Internet connection influencing the benchmarks, I first run the Maven build once so that Maven downloads and caches all the dependencies. Moreover, I first mirrored the p2 Eclipse artifacts so that the target platform definition is resolved against the local mirror.

LG GRAM 16 (LINUX) Total time: 03:25 min

LG GRAM 16 (WINDOWS) Total time: 04:20 min

MACBOOK AIR M1 Total time: 02:49 min

MACBOOK AIR 2016 Total time: 08:17 min

I must say I was impressed by the best performance shown by the M1 processor!

As expected, on the same machine, Windows performs worse than Linux 🙂

The performance of the old Mac Air is not impressive, but that’s an old machine.

Just for fun, I ran the same build on the PineBook Pro (which runs Manjaro KDE): Total time: 21:27 min. Of course, that’s not usable for intensive development 😉

Finding a type in the classpath of an Eclipse Java project

Recently, I started to contribute and maintain Pitclipse, an Eclipse plugin for running mutation testing with PIT.

We needed a mechanism to detect whether JUnit 5 is in the classpath of a Java project (so that we could run PIT with its JUnit 5 plugin).

The first implementation of such a mechanism was rather cumbersome since it manually inspected the Java project’s classpath entries. Something like that:

That’s rather unclear, and there are lots of paths to test.

I opened an issue for investigating an alternative implementation, https://github.com/pitest/pitclipse/issues/149, and I was thinking of something simpler, along these lines:

We could try to load some classes of the JUnit 5 engine by constructing a classloader using the classpath of the Java project.
Something like (untested):


That’s simpler and cleaner, but we can do better than that 🙂

JDT provides a lot of API for such things. For what we need to do, we can simply rely on IJavaProject method findType:

IType findType(String fullyQualifiedName)
Returns the first type (excluding secondary types) found following this project’s classpath with the given fully qualified name or null if none is found.

So it’s just a matter of creating a reusable method, e.g.,

And we can simply call it by specifying the fully qualified name of a type that we know belongs to JUnit 5 (PR https://github.com/pitest/pitclipse/pull/199):

Now we don’t even have to test several cases: we simply rely on the correctness of the implementation of findType. This is expected to work on Java projects, Maven projects, Gradle projects, etc.

My notes on the Grub incident in Linux Arch

In this post, I’d like to share my thoughts and the solution I adopted to circumvent the terrible incident that happened a few days ago with grub in Linux Arch. The bug affected all Arch-based distributions (not Manjaro, which is not really Arch-based, but for sure EndeavourOS and Arch itself).

You can find the details of the problem online:

If you’re reading this, you’re already aware of the bug, and maybe you’ve been hit by it. Thus, I’m not going into the details of the issue itself.

First of all, although I’ve been enjoying Arch for some time, I must say I was not pleased with the way the Arch team handled the problem (it’s really a severe issue, and having bootable snapshots does not save you from that if you don’t take countermeasures to avoid it or to fix the problem, once you’ve already been hit). After a few days, the Arch team closed the bug, blaming other Arch-based distros because they have hooks that update the grub configuration during package upgrades. The Arch team says that if you use grub the “Arch way,” you have no problem. However, if I understand the details of the issue correctly, as soon as you have a software update that installs a new kernel version, it will also update the grub configuration, and the bug will hit you. (update: no, that’s not the case in Arch, since the kernel image file always has the same name and does not have the version in the name).

Moreover, I have hooks to take Timeshift snapshots before a system upgrade and to generate grub entries to boot the snapshots. Isn’t this the “Arch way”? For sure, it’s a safety mechanism widely adopted. After all, Linux is about choice! 🙂 (update: since, as said above, the kernel image file name is always the same, even, for example, if you update from version 5.19.4 to 5.19.5, having bootable snapshots is even more crucial in Arch).

The issue is said to be fixed by showing a warning during the upgrade of the grub package saying:

Seriously?! That’s just a warning, which is likely to go unnoticed. That’s not a fix; it’s a patch (In the true sense of the word).

However, let’s say that you note that warning and do what it says.

You will have no problem on the next boot, but I found these huge drawbacks (at least for me):

  • The grub installation of the current Arch distribution will replace the default UEFI boot configuration. Of course, you can reorder the boot configurations from the UEFI setup, but that’s an unwanted side-effect if you had already configured things the way you wanted;
  • Related to the previous point, if you have another grub configuration (e.g., of another distro) to boot other distros on the same machine (see, e.g., my blog post on this mechanism), including this Arch installation, it will not work anymore. That’s expected because the other grub does not know anything about the new grub configuration anyway.

Moreover, in my humble opinion, what the grub developers have done in this new version does not make much sense: why do you want to execute a command to generate a boot entry dynamically?! Perform that choice when generating the grub configuration once and for all!

If you’re curious, that’s the difference after the grub update in the file used to generate the culprit entry in the grub.cfg (old file on the left, new file on the right):

So, after restoring my computer with arch-chroot (because I was hit by the bug), instead of their proposed “solution,” I ignored the package update by adding this line to /etc/pacman.conf:

This way, I won’t be hit by the bug again (until, hopefully, grub developers will revert that implementation decision, and Arch developers will provide a new grub package)

Then, I realized that, in the end, I don’t need a grub entry to enter UEFI! I can enter UEFI when starting the computer with a key combination (not to mention that, as I said above, my main grub is not the Arch one, but the Fedora one, as shown in my blog post)! Thus, I updated the grub package (of course, after removing the IgnorePkg entry shown above). Before rebooting (that’s crucial), instead of following the suggestion shown during the upgrade, I simply removed the grub file to generate the culprit configuration for UEFI in the grub.cfg (and, of course, I regenerated the grub configuration afterward):

That’s all! Your grub.cfg will not have an entry for entering UEFI anymore. I don’t need that.

Of course, you have to repeat these operations if Arch releases an update to the grub package without fixing the problem. However, I prefer this solution, which does not have the abovementioned drawbacks.

A first look at Crystal Linux

Crystal Linux is a brand new Linux distro based on Arch. Although it has not been officially released, you can already download an ISO and try that in its current development state.

Quoting from its home page:

Crystal Linux is a brand new Arch Linux based distribution.
Powerful and easy to use.

And, in particular

Why Crystal?
What’s so different about Crystal compared to other distributions?

  • Easy to use package manager
  • Beginner Friendly
  • Easy Btrfs snapshots
  • Easy to install

Since I’ve been using Arch and Arch-based (mainly EndeavourOS) distros for a while, I decided to try it, even if it’s not officially released, to briefly evaluate its current development status.

I downloaded the ISO crystal-live-08-20-22-07-55-x86_64.iso and tested it on a VirtualBox VM.

After the BOOT, you’re greeted by the GNOME desktop. I searched for the installer. I thought I’d find it in the dock, but that was not the case. I searched for an “install” string in the GNOME Activities. Again I got no results. Then, I recalled that Crystal names its installer Jade, and that’s how I found it.

The installer provides several screens to specify the typical information of a Linux installation. I would say that it does that in a very clear way. Here are a few screenshots of the pages of the installer:

Since it’s based on Arch, Crystal can provide a good selection of desktop environments. However, you can select only one:

Another interesting section is the next one, where you can enable Timeshift (recall from the introduction that “Easy Btrfs snapshots” is one of the advertised features):

Regarding partitioning, the Crystal Linux installer shows its “work-in-progress” state: you can only select the disk for the installation and nothing else. As noted in the dialog, it will wipe the whole disk and automatically partition it. Nothing is said about the file system, but I guess it will be a Btrfs filesystem (Spoiler: it is):

However, they are still working on the partitioning program:

Then, you get the summary for a final review. When you’re ready, start the installation:

The installer shows the installation log, which is excellent and helpful. Unfortunately, when the installation finishes, the log is not available anymore. It would be good to have access to that window still, to copy the log somewhere for a later examination.

OK, let’s reboot and see the distribution in action.

Crystal Linux should come with a customized GNOME desktop, Onyx, but that’s not installed by default. So you get a vanilla GNOME session (just like in Arch) with only a few programs installed (so, in this respect, it’s not bloated):

You don’t even have a Text Editor with a GUI (but at least you have Gnome Tweaks):

Of course, you can install whatever you want with pacman or with the Crystal custom AUR helper, amethyst, but beware: the command to run it’s ame; it took me some time to discover that 🙂 The AUR helper amethyst looks nice. Just like “yay”, you run it, and it also executes an update (“-Syu”). Besides that, the command line arguments are the same as pacman and yay, at least, that’s my first impression. Just like yay, amethyst also updates the AUR packages. Moreover, it is also configured to execute “pacdiff” at the end:

Unfortunately, the keyboard layout and the time zone I specified during the installation was not considered. I had to set them again in the GNOME settings.

The default shell is ZSH, which I like. However, it’s not configured at all, with any default. Thus, the first time you open a terminal, you have to do that yourself:

Let’s see how the installer created the partitions:

So we have BTRFS, with the two standard volumes @ and @home, which are suitable for Timeshift. No SWAP partition (swap is not configured at all). Moreover, there’s no compression on the BTRFS subvolumes, while I usually prefer to have compression.

There are also other subvolumes (I guess to exclude from snapshots the virtual machines you might create with Kvm):

Concerning repositories, Crystal is similar to EndeavourOS: it relies on Arch repositories and adds just a few custom repositories that you can also browse at https://repo.getcryst.al/. You can see that there are not so many packages there. Besides the Crystal programs, you also find a few packages you typically install from AUR, like timeshift and timeshift-autosnap.

This allows me to talk about the “Easy Btrfs snapshots.” The Crystal installer has already set up timeshift, timeshift-autosnap (which creates snapshots before package upgrade), and grub-btrfs (which adds “btrfs snapshots” to the grub menu to boot your system on a “snapshot” from the grub menu). (I wrote about these 3 tools previously).

For example, that’s what you see when you perform an upgrade (note the automatic creation of the snapshot and the creation of the grub menus for the snapshot):

In fact, the next time you boot, you also get the grub entry for the snapshots:

Summary

I liked a few things and a few things I did not like, but I enjoyed the installation, and, in general, I have an excellent impression of this new distribution. It’s not for beginners, but it’s easy for users who have already tried a few Linux distributions.

In any case, I found Crystal promising, and I really look forward to the official ISO release!