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.
I installed Ubuntu Jammy a few months ago, when it was released, on a desktop computer. It was a terrible experience: crashes now and then, and the Wayland session was not working well on some applications. After a week, I uninstalled it immediately and switched to Fedora on that computer.
Then, a new point release came out, 22.04.1. I heard that, in the meantime, many bugs were fixed. I decided to give it another chance. In particular, I decided to install that on an older computer, a Dell m3800, because it comes with an integrated video card and a “terrible” Nvidia card, which is well-known to give headaches to Linux users 😉 In the past, I used Bumblebee on such a computer to keep the power consumption low. However, Bumblebee gave me problems in the past, and I seem to understand that it is not actively maintained anymore. So, let’s try a fresh installation of Ubuntu Jammy and see how it deals with the Nvidia card.
The installation went fine and smoothly. In the end, when rebooting into the new installation, I could verify that the Nvidia drivers were installed automatically and working correctly (meaning no crashes or other issues)!
Since it uses Nvidia, Ubuntu does not show any gear icon on the login screen to switch the graphical session: it’s X11 automatically, and you cannot change it. I guess that’s done because Nvidia does not work correctly in a Wayland session.
Another nice thing is that it detected my huge screen resolution, 3200×1800, and automatically enabled 200% scaling. However, I seem to remember that this is a feature of Gnome itself.
Having said that, I found using the Nvidia drivers really a problem: the computer gets immediately hot, the fans get pretty noisy, and it looks like the battery does not entirely charge even when connected to the AC. It also looks like the battery goes down a bit, even when connected to the AC.
I opened the Nvidia settings. However, it looks like Hybrid mode will not work with this version of the driver.
Of course, when running on battery, the power consumption is too much, and the battery would drain in less than two hours, as reported by powertop. That’s the reported consumption (even when the computer is idle):
33.6 W of power consumption is too much.
Since I’m not using graphical intensive software, I tried to switch to the integrated Intel graphics card. You cannot select this choice in the Nvidia settings because it’s greyed out (you can find many posts on the Internet reporting this problem without a solution). However, we can use the command line:
1
2
3
4
5
6
$sudo prime-select intel
Info:selecting the intel profile
Updating the initramfs.Please wait forthe operation tocomplete:
Done
Let’s reboot, and now the gear icon appears, and you can select the Wayland session since the Nvidia card is not used. By the way, Nvidia settings still have the greyed-out entry for the integrated card, but at least it recognized that’s the one selected:
The power consumption on battery is better (about 15 W, i.e., half), but I seem to understand that the Nvidia card itself it’s still using power since it’s not completely turned off:
At least the computer is not that hot anymore, and the battery seems to charge correctly.
Let’s try to use a tool to turn the Nvidia card off: EnvyControl.
I’ve always been using GIMP for cropping images (for articles, books, etc.), and it works pretty well, but I never thought that you could do the same much quicker with the default image viewer of KDE, Gwenview. In KDE Plasma, I’ve always used Gwenview as an image viewer, but it’s much more:
Gwenview is a fast and easy to use image viewer by KDE, ideal for browsing and displaying a collection of images.
Features:
Supports simple image manipulations: rotate, mirror, flip, and resize
Supports basic file management actions such as copy, move, delete, and others
…
In fact, you just open an image with Gwenview:
Press “Show Editing Tools” and then select “Crop” from the palette:
The box for cropping is ready to be resized:
When you’re done, just press ENTER:
and the image is ready to be saved!
With GIMP, the number of steps is much more significant.
Moreover, with Gwenview, once you cropped and saved the current image, you just press the right arrow to go to the next one. Much faster!
I did not feel ready to go through the manual procedure (but I’ll do that someday), and I heard about the archinstall script, which comes in the Arch official ISO. After watching a few videos and reading a few blog posts, I tried that myself, first on a VM and then on a real machine.
I can anticipate that I liked this installation procedure. Still, it is not perfectly usable in a multi-boot environment, as I’ll say near the end of this post, where I summarize my experience with the installation.
In this post, I’ll first show an installation on a VM (and I suggest you try that one), then briefly describe the installation on a real machine.
If you want to try that, you have to download an official Arch ISO. Once you booted into the live ISO, you must connect to the Internet as described in the official documentation.
Now, it’s time to run the installer:
1
archinstall
And you have access to the main installation menu:
You see, it’s easy to use, especially if you’re familiar with other Linux installation programs.
The first three entries are easy to deal with.
The fourth, “Select harddrives,” requires some care because it’s where you deal with your disk! You have to select the correct drive. In my case:
Since I’m on a VM, I’ll simply choose to wipe everything on that drive and let the installer handle the partitioning automatically. That’s easy in a VM, and that’s what I’ve seen in all demos on the web (but, as I’ll show later, things are more complicated in a multi-boot environment):
Concerning the user accounts, it’s best NOT to set a root password: it’s better to create a user with administrator rights (so that you later rely on the good ol’ “sudo”). An interesting feature of this installation procedure is that it lets you create as many users as possible. On the contrary, typically, other Linux installations only allow you to create a single user.
The other interesting menu entry is the one to choose the profile. I’m choosing “desktop”:
And in particular, I’m choosing GNOME (you see that you have plenty of choices):
Moreover, you can select the graphic drivers:
And the kernels:
Since, for the moment, you could just select from a predefined set of choices, you are given a chance to manually specify additional packages to install (but you have to know them by their name). In this example, I’m installing “firefox”:
It’s also crucial to configure the network for the installed system. If you use GNOME or KDE, I’d say that it’s best to choose “NetworkManager”:
Once you’ve done with all the menu entries, before starting the actual installation, you’re given a chance to save these configurations, which is helpful if you want to use the same configurations on other machines or to do some further customizations:
Now, it’s time to choose “Install”; a countdown starts to abort the installation in case you just remembered you’ve done something wrong:
The installation starts and in a few minutes (where a few packages will be downloaded)…
…you should get to the end of the installation, where, if you want, you can also tweak the installed system before rebooting:
If you choose “no”, you’re back to the live environment:
And you can now reboot to (hopefully) enjoy your installation:
Having installed GNOME, I’m presented with a few options, and I choose the first one, that is, GNOME on Wayland:
You see that the GNOME installation is a vanilla one.
OK, that was a VM, and it was straightforward to install Arch with the installation script. It’s also easy if you plan to install ONLY Arch on your computer (by wiping all the rest).
Things are not working completely fine if you want to install it on a computer with other Linux installations, which you want to keep and be able to boot into. In this case, of course, you cannot wipe the selected hard drive and must do manual partitioning. The installation script is still helpful in that respect (I’m not showing anything in this blog post), but you must be aware of a small problem.
In fact, due to an issue, which, at the time of writing, is still open, specifying to mount an existing EFI partition into “/boot/efi“, which, as far as I know, it’s the standard mount point in most distributions (every distribution I know at least). You must specify a mount point “/boot” and that must be a boot partition (with the boot flag). Of course, that’s what I’ve done myself; I specified the exiting EFI partition (the first partition of the installation drive in my computer) for the mount point “/boot”. However, the installer will treat that directory as if it was /boot/efi in other installations. Thus, it will copy the booting files directly there. As a sad result, the Arch installation will not be detected when rebooted. You will only see an existing installation’s GRUB menu (and running os-prober from an existing installation does not seem to help). Thus, you end up with the Arch installation that you cannot boot.
The only solution I found to boot into the Arch system was to apply the mechanisms shown in my other post and configure the Fedora GRUB with an entry pointing directly to the EFI partition, i.e., according to the post mentioned above, something like the following (remember, on my computer the EFI partition is the first one, and I installed Arch on the partition 13):
1
2
3
4
5
6
7
8
menuentry"Arch"{
insmod part_gpt
insmod btrfs
insmod ext2
rmmod tpm
set root='hd0,gpt13'
configfile(hd0,gpt1)/grub/grub.cfg
}
Or even like that (i.e., without specifying the root partition of the Arch installation at all and just relying on the grub that the installer created directly on the EFI partition):
1
2
3
4
5
6
7
8
menuentry"Arch"{
insmod part_gpt
insmod btrfs
insmod ext2
rmmod tpm
set root='hd0,gpt1'
configfile/grub/grub.cfg
}
Besides this problem, the installation script archinstall is really interesting and still under development.
I’ve always been using the locate command (provided by the mlocate package or by the new plocate package), which quickly searches for files and directories by their names. The command relies on the database built by the command updatedb (which should be run periodically, e.g., by enabling the plocate-updatedb.timer service for plocate).
Unfortunately, by default, it does go well with the BTRFS filesystem and its subvolumes (see, e.g., this bug), resulting in empty results for all searches basically.
Fortunately, the solution is quite simple:
edit the file /etc/updatedb.conf
replace PRUNE_BIND_MOUNTS = “yes” with PRUNE_BIND_MOUNTS = “no”
I have already blogged about EndeavourOS, which I use most of the time on a few 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 Artemis, which was released a few days ago. However, since I wanted to switch from the EXT4 file system to BTRFS (since I started to experiment with this file system and its snapshot capabilities), I took the chance to try this new release by installing it from scratch (of course, using BTRFS this time).
I’ll first go through the installation, but I can anticipate that, once again, I’m impressed by EndeavourOS. This installation feels really fast, maybe due to BTRFS or the new kernel (instead of the LTS kernel, I now use the latest one provided by the distribution) or both. Most of all, EndeavourOS is pure Arch but with outstanding defaults. Indeed, the KDE and GNOME environments are vanilla ones.
Installation
As usual, the first thing to do, once booted in the live environment, which in this case is 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 start the installer.
I choose the “Online” method because I want to install KDE Plasma instead of Xfce.
You have to wait a few seconds (or about a minute) for the installer to download the modules (I always prefer to install any operating systems in English):
Maybe, due to a bug, the location has been found successfully, but the English version proposed is not the right one, so I have to change it to Americ English again:
After setting the keyboard layout (this time for the installed system), it’s time for partitioning.
Since on this computer I have a few Linux installations, including the old version of EndeavourOS I’m going to replace, I choose Manual partitioning (and not “Replace a partition” because that would keep the same file system type, EXT4, while I want to switch to BTRFS).
I Edit the partition, select “Format” (otherwise, I cannot change the File system type), modify the File system (BTRFS), and specify the mount point.
Before going on, we must specify to mount the EFI partition (into /boot/efi) without formatting it and ensure the “boot” flag is selected. This way, the installer can properly install GRUB.
WARNING: on another computer, the installer complained that I did not select a boot partition with at least 300Mb (mine was just 200Mb). Since I knew there was enough space in that partition, I ignored the warning, and the installation went fine.
As for the desktop, I select Plasma.
And then, we can select the single packages. Note that, different from my previous review, you choose the packages after selecting the desktop, so that a few packages, in particular, the ones of the chosen desktop, have already been selected:
In this blog post, I’m not going to install GNOME besides KDE, but I also select the “Printing-Support” and the “Support for HP Printer/Scanner” checkboxes.
As usual, then you have to specify your user’s details, and then it’s time to take a look at the summary:
Let’s start the installation. It might take a few minutes because it’s an “Online” installation, so it has to download several packages.
You can press “Toggle log” during the installation to see the installer’s log.
When it’s done, it’s time to restart the computer.
First impressions
As in the previous blog post, I must note that the Discover icon is still in the taskbar, though the software manager Discover is not installed at all.
Maybe because I selected KDE Plasma only, the Wayland session has not been installed, while in my previous post, I installed both GNOME and KDE. However, I just had to run this command:
Power consumption on the battery is also excellent, but that was true in the past, so nothing changed in that respect.
All in all, this distribution keeps on being awesome.
As I initially anticipated, you have Arch and its vanilla desktop environments, but with useful and reasonable defaults. Moreover, the installation is effortless! 🙂
Thanks to the script hibernator, the procedure is much more straightforward in Arch-based distros (including Manjaro and EndeavourOS).
First of all, make sure you first install the package update-grub.
The package hibernator is available from AUR, but currently, there’s a problem with the build instructions. Thus, we must install it manually. There’s no need to install the script anywhere: it’s just a matter of cloning the script from GitHub and running it once:
Then, before running the script (as a superuser), we must decide where we want the suspend-to-disk to take place: either in a swap partition or in a swap file (please keep in mind that currently, the script cannot handle hibernation into a swap file of a BTRFS partition).
If we want a swap file, the script can create that for us, and we can also specify the size of the swap file. Here’s the quote from the home page of the project
Hibernator accepts desired size of swapfile as arguments. Running hibernator 2G creates 2 Gb swapfil, hibernator 1000M creates 1000 Mb swapfile. The script defaults to 4G if no arguments are given.
If we want a swap partition, we must ensure the partition is already in place and that our /etc/fstab already refers to that (i.e., it mounts it appropriately).
When we’re ready, we just run the script with sudo. The script will update the GRUB command line with the resume option and a resume hook to /etc/mkinitcpio.conf. Finally, it will update the GRUB configuration (with update-grub, that is why you need to install this package beforehand).
Here’s an example of the output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
>sudo./hibernator
Adding the necessary kernel parameters toyour bootloaders
Generating grub configuration file...
Found linux image:/boot/vmlinuz-linux
Found initrd image:/boot/intel-ucode.img/boot/initramfs-linux.img
Found fallback initrd image(s)in/boot:intel-ucode.img initramfs-linux-fallback.img
Adding boot menu entry forUEFI Firmware Settings...
done
Adding resume hook to/etc/mkinitcpio.conf
==>Building image from preset:/etc/mkinitcpio.d/linux.preset:'default'
And that’s all: we just reboot, and hibernation is ready to be used!
Before rebooting, you might want to check that the GRUB_CMDLINE_LINUX_DEFAULT variable in /etc/default/grub has been set with a valid resume entry (if you rely on a swap partition, which has been properly specified in /etc/fstab, it should contain a reference to the UUID of the swap partition):
1
GRUB_CMDLINE_LINUX_DEFAULT="... resume=/dev/disk/by-uuid/<UUID of your swap partition>"
02/Jan/2023: documented that the new version of grub-btrfs is now an official package (you still have to install another package: inotify-tools);
02/Dec/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.
After looking at the very nice videos of Stephen’s Tech Talks, in particular, this one https://www.youtube.com/watch?v=6wUtRkEWBwE, I decided to try to set up Timeshift, Timeshift-autosnap, and grub-btrfs in my Linux Arch installation, where I’m using BTRFS as the filesystem. These three packages allow a timeshift snapshot to be automatically created each time you update your system; moreover, a new grub entry is automatically generated to boot into a specific snapshot.
The video mentioned above is handy, but unfortunately, some recent changes in Timeshift itself broke the behavior of the two other packages. In this post, I’ll try to show how to fix the problem and go back to a working behavior. I’ll also show an experiment using the snapshots so that, hopefully, it’s clear what’s going on in the presence of such snapshots and how to use them in case you want to revert your system.
Install timeshift and timeshift-autosnap
First of all, let’s install timeshift and timeshift-autosnap (the latter depends on the former, and they are both available from AUR; I’m using the yay AUR helper here):
1
yay-Stimeshift-autosnap
The programs will be installed from sources; thus, they will be compiled (it might take some time).
Let’s create a new Timeshift snapshot to make sure it works (the first time, you will have to configure Timeshift; of course, it is crucial that you choose “BTRFS”).
You can configure timeshift-autosnap with the number of snapshots to keep (in this example, I specify 10):
1
2
3
4
5
6
sudo nano /etc/timeshift-autosnap.conf
...
# maxSnapshots defines how much old snapshots script should left.
# Only positive whole numbers can be used.
# Default value is 3.
maxSnapshots=10
Install grub-btrfs (new version, installation from the official repository, 02/Jan/2023)
The new version of grub-btrfs is now available as an official package (Please remove the old AUR version if you still have it installed):
Now, let’s make sure grub-btrfs can find Timeshift’s snapshots (remember, we’ve just created one). So let’s update the grub configuration, and we should see in the end something like the following output:
1
2
3
4
5
6
7
8
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
...
Adding boot menu entry for UEFI Firmware Settings ...
The last lines prove that grub-btrfs can detect snapshots.
We now need to configure that to monitor the Timeshift snapshot directory instead of the default one (/.snapshots).
Automatically update the grub menu upon snapshot creation or deletion (2 December 2022)
What follows is based on the new version of grub-btrfs. At the bottom of the post, there are still the old instructions, which are to be considered stale and left there only for “historical reasons”.
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:
1
sudo pacman -S inotify-tools
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.
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, as shown later in the old section).
Let’s start the daemon:
1
sudo systemctl start grub-btrfsd
In the journalctl log, we should see something like (where the date and time have been stripped off):
1
2
grub-btrfsd[9965]: grub-btrfsd starting up...
grub-btrfsd[9989]: Watching /run/timeshift for timeshift to start
Let’s start Timeshift. In the journalctl log, we should see something like this:
1
2
3
4
grub-btrfsd[10307]: detected Timeshift startup, PID is: 10232
grub-btrfsd[10612]: Watching /run/timeshift/10232/backup/timeshift-btrfs/snapshots for new snapshots...
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:
1
2
3
4
5
6
7
8
9
timeshift-gtk.desktop[10232]: Created directory: /run/timeshift/10232/backup/timeshift-btrfs/snapshots/2022-11-20_17-31-59
grub-btrfsd[10667]: Detected snapshot creation/ deletion, recreating Grub menu
timeshift-gtk.desktop[10232]: Created subvolume snapshot: /run/timeshift/10232/backup/timeshift-btrfs/snapshots/2022-11-20_17-31-59/@
timeshift-gtk.desktop[10232]: Created control file: /run/timeshift/10232/backup/timeshift-btrfs/snapshots/2022-11-20_17-31-59/info.json
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:
1
sudo systemctl enable grub-btrfsd
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 the next section.
IMPORTANT: If you have several Linux distributions on your computer and you use a multiboot system like the one I blogged about, and this distribution is not the main one, you will have to manually tweak the entry in your main distribution’s GRUB menu. See the linked blog post near the end.
Some experiments
Let’s do some experiments with this configuration.
Here’s the kernel I’m currently running:
1
2
>uname-a
Linux lg-arch5.18.7-arch1-1#1 SMP PREEMPT_DYNAMIC Sat, 25 Jun 2022 20:22:01 +0000 x86_64 GNU/Linux
So it created a snapshot before updating the system (in particular, it installed a new kernel version). Let’s reboot and verify we are running the new kernel (5.18.8 instead of 5.18.7):
1
2
>uname-a
Linux lg-arch5.18.8-arch1-1#1 SMP PREEMPT_DYNAMIC Wed, 29 Jun 2022 23:03:08 +0000 x86_64 GNU/Linux
Let’s reboot and select from GRUB the latest snapshot (remember, the one before applying the upgrade), so timeshift-btrfs/snapshots/2022-07-02_15-35-53 (snapshots are presented in the grub submenu from the most recent to the oldest one). We do that by pretending that the update broke the system (it’s not the case), and we want to get back to a working system before the update we have just performed.
You see that the “Authentication Required” dialog greets us, and in the background, you can see the notification that we “booted into Timeshift Snapshot, please restore the snapshot”:
The password is required because it’s trying to run Timeshift:
In the screenshot, you can see that we are now using the older kernel since we booted in that snapshot, where the update has not yet been performed. We have to restore the snapshot manually; otherwise, on the next boot, we’ll get back to the updated system version and not in the snapshot anymore.
So, let’s restore the snapshot:
You see, Timeshift has created another snapshot ([LIVE]). We now reboot normally (that is, using the main grub entry, NOT the snapshot entries).
Once rebooted normally, we can verify again that we are running the old kernel:
1
2
>uname-a
Linux lg-arch5.18.7-arch1-1#1 SMP PREEMPT_DYNAMIC Sat, 25 Jun 2022 20:22:01 +0000 x86_64 GNU/Linux
Let’s have a look at Timeshift, and we can see the last snapshot is an effective one, not a LIVE one:
Yes, we are now in a system where the update above has never been applied.
Let’s try to rerun the update command (we don’t effectively execute the update, it’s just an experiment):
1
2
3
>yay
->/var/lib/pacman/db.lck ispresent.
->There may be another Pacman instance running.Waiting...
Why? Because the snapshot had been created automatically by timeshift-autosnap before applying the updates while the package manager was running, its lock is still there.
Let’s remove the lock and try to rerun the update:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
>sudo rm/var/lib/pacman/db.lck
>yay
::Synchronizing packagedatabases...
core isup todate
extra isup todate
community isup todate
::Starting full system upgrade...
resolving dependencies...
looking forconflicting packages...
warning:insufficient columns available fortable display
The output is similar to the one shown above (unless there are even more new updates in the meantime, which might happen in a rolling release), but something is missing:
1
Total Download Size:274,61MiB
Why? Because the downloaded packages in the cache are NOT part of the saved snapshot, they are still present in the current system, even though we restored the snapshot. Why are the cached packages still there, but the lock has been restored with the snapshot? That’s due to the way subvolumes are specified in the /etc/fstab:
You see, the cache of downloaded packages and the logs are NOT part of the snapshots, while /var/lib (including the pacman lock) is part of the snapshots.
Let’s now revert the snapshot: we select the one with “Before restoring…”.
Again, we are now in a LIVE situation, and Timeshift tells us again to reboot to make it effective.
Let’s reboot (by using the main grub entry).
We’re back to the updated system, and there’s nothing to update (again, unless new updates have been made available in the meantime):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
>uname-a
Linux lg-arch5.18.8-arch1-1#1 SMP PREEMPT_DYNAMIC Wed, 29 Jun 2022 23:03:08 +0000 x86_64 GNU/Linux
If we’re happy with the updated system, we can also remove those two snapshots (remember that grub-btrfs monitors the snapshots so that it will update its grub submenu entries):
I hope you find this blog post helpful, and I hope it complements the beautiful video of Stephen’s Tech Talks mentioned above.
Old version (with old release 4.11 of grub-btrfs)
UPDATE 02/Dec/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 first problem is that timeshift has recently changed the strategy for creating snapshots. Instead of creating them in /run/timeshift/backup/timeshift-btrfs/snapshots, it now creates them in /run/timeshift/<PID>/backup/timeshift-btrfs/snapshots, where <PID> is the PID of the Timeshift process. Each time you run Timeshift, the directory will be different, breaking grub-btrfs (which expects to find the snapshots always in the same directory).
Fortunately, there’s a workaround: we add an entry to /etc/fstab in order to mount explicitly the path /run/timeshift/backup/timeshift-btrfs/snapshots:
where, of course, <UUID> has to be replaced with the same UUID of the physical disk partition.
Reboot, and then Timeshift will also put the snapshot in that directory (besides the one with the PID, as mentioned above). You can try to create a snapshot to verify that (this also allows us to use the Timeshift wizard so that we specify to create BTRFS snapshots).
Let’s make sure the mount point is active (and note the unit name)
1
2
3
4
5
>systemctl list-units-tmount
UNIT LOAD ACTIVE SUB DESCRIPTION
...
run-timeshift-backup.mount loaded active mounted/run/timeshift/backup
...
Let’s now install grub-btrfs
1
sudo pacman-Sgrub-btrfs
We need to configure that to monitor the Timeshift snapshot directory instead of the default one (/.snapshots).
Let’s reload and re-enable the monitoring service:
1
2
sudo systemctl reenable grub-btrfs.path
sudo systemctl start grub-btrfs.path
If we have already created a few snapshots, we can run update-grub (or, if you have not installed the package update-grub, use the command “grub-mkconfig -o /boot/grub/grub.cfg”) and verify that new grub entries are created for the found snapshots:
1
2
3
4
5
6
7
8
9
10
11
12
13
>sudo update-grub
Generating grub configuration file...
Found linux image:/boot/vmlinuz-linux
Found initrd image:/boot/intel-ucode.img/boot/amd-ucode.img/boot/initramfs-linux.img
Found fallback initrd image(s)in/boot:intel-ucode.img amd-ucode.img initramfs-linux-fallback.img
...
Detecting snapshots...
Found snapshot:2022-06-3018:07:08|timeshift-btrfs/snapshots/2022-06-30_18-07-08/@|ondemand|N/A
Found snapshot:2022-06-3018:06:17|timeshift-btrfs/snapshots/2022-06-30_18-06-17/@|ondemand|N/A
Found snapshot:2022-06-3016:00:01|timeshift-btrfs/snapshots/2022-06-30_16-00-01/@|daily|N/A|
Found3snapshot(s)
Unmount/tmp/grub-btrfs.3u9wTHZNNW..Success
done
We can also restart the system and prove that we can access the GRUB submenu with the generated entries for the snapshots.
After the recent release of KDE Plasma 5.25, this version landed a few days ago in Arch-based distros like EndeavourOS (the one I’m writing from).
Although I’m mostly a GNOME user, I also have a few distributions installed where I’m using KDE Plasma.
The new features that impressed me most are related to eye candies 🙂
First, the “Present Windows” effect now looks the same as the new “Overview” effect. If we compare the “Present Windows” effect in the previous version (5.24):
with the new one:
we can see a significant improvement: in the earlier versions, the windows not selected were too dark, making it hard to distinguish them. This behavior relates to an old bug (10 years old): https://bugs.kde.org/show_bug.cgi?id=303438. This bug has been fixed by rewriting this effect “to use the same modern, maintainable backend technology found in the Overview effect.”
I use this effect a lot (I also configured the “Super” key to use this effect, simulating what happens in Gnome for its “Activities” view), and I use the filter to filter the open windows quickly. So I appreciate this usability change a lot!
One detail I do not like in this new version of “Present Windows” is that the filter textbox remembers the entered text. Thus, the next time you use it, the presented windows are already filtered according to the previously entered text. I’m not sure I like this.
The other cool thing introduced is the automatic accent color! Accent colors were introduced a few versions ago in Plasma, but now you can have Plasma automatically adjust the accent color from the current wallpaper:
If you use a wallpaper changer mechanism (like the one provided by Plasma), possibly by downloading new wallpapers (like Variety), you will get nice accent colors during the day. Here are a few examples produced running Variety to change the wallpaper:
Maybe it’s not an important feature, but, as we say in Italy, “Anche l’occhio vuole la sua parte” 😉
The last new feature that positively impressed me is that now KRunner also shows Java files (and probably other programming languages related files) when you search a string. Previously, although “Baloo” (the file indexing and file search framework for KDE) knew about these files, KRunner was only showing .txt files and a few others, but not Java files.
Concerning Wayland, one thing I noted is that if I start a Plasma Wayland session using a brand new user, it automatically scales the display in case of an HDPI screen. Wayland usability in Plasma has not improved since my last experiments (see KDE Plasma and Wayland: usability).
If you update to Xtext 2.27.0 and have compiler tests for your Xbase DSL that assert the output of the compilation, you’ll get lots of failures after the update.
I am guilty of that 😉
Well, for a good reason, at least 🙂
Now, the Xbase compilation mechanism does not generate useless empty lines anymore (before, it added lines with two spaces). Your compiler tests will fail because the output is different.
I personally fixed my tests in my DSLs by simply using the Find/Replace mechanism of Eclipse with this substitution pattern (there are two space characters between the tab character and the newline character):
If you have deep nesting in your compilation output, you might have to repeat this substitution with more than two characters, but this should not be required unless you generate nested classes or something like that.
With the above substitution a test like the following one:
will become like the following one (you see the difference: no empty line with two characters between the two generated constructors:
Pacman is the package manager in Linux Arch and Linux Arch-based distributions.
I’ve been using EndeavourOS for some time, and I enjoy it. EndeavourOS is pretty close to vanilla Arch. I also experimented with pure Arch (more on that in future blog posts). However, the output of pacman in EndeavourOS is much more excellent and “eye candy” than in Arch. However, it’s just a matter of configuring /etc/pacman.conf a bit in Arch to have the “eye candy” output.
These are the options to enable in the [options] section in that file (the ParallelDownloads does not have to with the output, but it’s a nice optimization):
1
2
3
4
Color
VerbosePkgLists
ParallelDownloads=5
ILoveCandy
Without these options, this is the output of pacman (e.g., during an upgrade):
And this is the output with the options above enabled:
Besides the colors, you can spot c’s for the progress representing “Pacman,” the video-game character, eating candies (that’s the aim of the option ILoveCandy)… waka waka waka! 🙂
The colors are also helpful when searching for packages:
Maybe this is well-known to macOS users, but it wasn’t clear to me as a Linux user.
As a Linux user, I’m used to using Alt+Tab to switch between different windows. But I also use the shortcut to switch between different windows of the same application. In Gnome, the shortcut is Alt+<the key above Tab>, which is cool because it works with any keyboard layout. In KDE it is Alt+backtick (`), which has to be changed in Italian keyboards, like mine to Alt+\. Indeed, in the Italian keyboard layout, the key over tab is \.
In macOS it’s the same as in KDE: the shortcut is bound by default to ⌘+`, which of course it’s unusable in Italian keyboards (you should use a complex combination of keys only to insert the backtick ` character). You then have to configure the shortcut “Move focus to next window”, which is quite counterintuitive to me (I had always thought that it wasn’t possible in macOS to switch between windows of the same application if not by using the touchpad gesture or by pressing the down key after using the standard switcher):
Change it to something suitable for your keyboard layout. For the Italian layout I change it to ⌘+\:
I had tested KDE Plasma with Wayland in the past, and the main problem I was experiencing, which made it unusable to me, was that I had to scale the display. I could scale the display, but the main problem was that, while KDE applications looked nice, the GTK applications looked blurred. This problem is still there, as you can see from this screenshot (here, I scaled the display to 150%):
You can see that the System settings dialog and Dolphin (in the background) look nice, but the EndeavourOS Welcome app and Firefox (in the background), which are GTK applications, look blurred!
Thus, I tried another way: I went back to 100% Display and tried to work on the Font HDPI scaling, though Plasma discourages doing that (it suggests using the display scaling). I tried with both 120 and 140 the result is satisfactory, as you can see from these screenshots:
IMPORTANT: You have to log out and log in to apply these changes. At least, I had to do that in my experiments.
There’s still one caveat to solve: GTK4 applications, like Gedit (the Gnome text editor) and Eye of Gnome (the Gnome image viewer), which, in this version of EndeavourOS, are already provided in their 42 version (using libadwaita). These applications are not considering font scaling. To solve that, you have to install Gnome Tweaks and adjust the “Scaling Factor” from there. Then, everything works also for those applications (Gedit is the one with “Untitled Document 1,” and Eye of Gnome is the dark window in the foreground):
With the Wayland session in Plasma, you can enjoy the default touchpad gestures (which, at the moment, are not configurable):
4 Finger Swipe Left –> Next Virtual Desktop.
4 Finger Swipe Right –> Previous Virtual Desktop.
4 Finger Swipe Up –> Desktop Grid.
4 Finger Swipe Down –> Available Window Grid.
Moreover, the scrolling speed for the touchpad can be configured (while, on X11, I wasn’t able to):
There are still a few strange things happening: the splash screen has the title bar and window buttons if you start Eclipse! 😀
I’ll try to experiment with this configuration also in other distributions.
Now that Gnome 42 has been released and available in most Linux distributions, I started experiencing problems with the Dropbox icon in the system tray.
First of all, I have no problem with Ubuntu 22.04, which comes with the extension “AppIndicator and KStatusNotifierItem Support” https://extensions.gnome.org/extension/615/appindicator-support/. Moreover, I think the problem is not there because, while Ubuntu 22.04 ships Gnome 42, it still ships Nautilus in version 41.
In Fedora and EndeavourOS, I usually install the same extension in the Gnome DE, and it has been working quite well.
Unfortunately, with Gnome 42 (provided by Fedora 36 and currently by EndeavourOS), I started experiencing problems, even with the extension above installed and activated.
If you had already installed Dropbox in your Gnome 41 DE and upgraded to Gnome 42 (e.g., you upgraded Fedora 35 to Fedora 36 after installing Dropbox), the icon is clickable. Still, you get a context menu always saying “Connecting…”
At least you can access “Preferences…”.
However, suppose you had never installed Dropbox in that Gnome 42 environment. In that case, the icon in the system tray appears (again, after installing the above extension), but no matter how you click on that, no context menu appears at all. That’s a disgrace because you cannot access Dropbox preferences, like “selective sync” (you have to use the command line, as I suggested in the previous post).
Instead of the extension “AppIndicator and KStatusNotifierItem Support” (disable it if you had already activated that), you can use the extension “Tray Icons: Reloaded,” https://extensions.gnome.org/extension/2890/tray-icons-reloaded/. Install it, activate it, logout and login, and now the context menu works as expected:
Remember that this extension does not seem to support all system tray icons. For example, Variety does not seem to be supported.
At least you can use this extension to set up Dropbox (e.g., selective sync) and then go back to the previous extension!
Fedora 36 has just been released, and I couldn’t resist trying it right away. I had already started using Fedora 35 daily (though I have several Linux distributions installed), and I’ve been enjoying it so far.
Before upgrading my Fedora 35 installations, I decided to install Fedora 36 on a virtual machine with VirtualBox.
These are a few screenshots of the installation procedure.
As usual, you’re greeted by a dialog for installing or trying Fedora, and I went for the latter.
The installation procedure is available from the dock:
To be honest, I’m not a big fan of the Fedora installer: compared to other installers like Ubuntu and EndeavourOS or Manjaro, I find the Fedora installer much more confusing. Maybe it’s just that I’m not used to such an installer, but I never had problems with Calamares in EndeavourOS or Manjaro, not even the very first time I tried Calamares.
For example, once a subsection is selected, the button “Done” is at the upper left corner, why I would expect buttons at the bottom (right).
I appreciate that you can select the NTP server time synchronization (at my University, I cannot use external NTP servers, and in fact, the default one is not working: I have to use the one provided by my University). Unfortunately, this setting does not seem to be persisted in the installed system. UPDATE 12/May: Actually it is persisted: I thought I’d find it in the file /etc/systemd/timesyncd.conf but instead it is in /etc/chrony.conf. Well done!
Since I’m installing the system on a VM hard disk for the partitioning, I chose the “Automatic” configuration. On a real computer, I’d go for manual partitioning. Even in this task, the Fedora installer is a bit confusing. Maybe the “Advanced Custom (Blivet GUI)” is more accessible than the default “Custom” GUI, or, at least, it’s much similar to what I’m accustomed to.
Finally, we’re ready to start the installation.
Even on a virtual machine, the installation does not take that long.
Once rebooted (actually, in the virtual machine, the first reboot did not succeed, and I had to force the shutdown of the VM), you’re greeted by a Welcome program. This program allows you to configure a few things, including enabling 3rd party repositories and online accounts and specifying your user account.
Then, there is the Gnome welcome tour, which I’ll skip here.
Here is the information about the installed system. As you can see, Fedora ships with the brand new Gnome 42 and with Wayland by default:
Fedora uses offline updates, so once notified of updates, you have to restart the system, and the updates will be installed on the next boot:
The installation is not bloated with too much software. Gnome 42 new theme looks fine, with folder icons in blue (instead of the old-fashioned light brown). Fedora also ships with the new Gnome Text Editor. Differently from the old Gedit, the new text editor finally allows you to increase/decrease the font size with Ctrl and +/-, respectively. I cannot believe Gedit did not provide such a mechanism. I used to install Kate in Gnome because I was not too fond of Gedit for that missing feature.
Instead, Fedora does not install the new Gnome terminal (gnome-console) by default. I installed that with DNF, and I wouldn’t say I liked it that much: with Ctrl +/-, you can zoom the terminal’s font, but the terminal does not resize accordingly. For that reason, I prefer to stay with the good old Gnome terminal (gnome-terminal).
First impressions
First of all, although I tried this installation in a VM, Fedora 36 seems pretty responsive and efficient. I might even say that the guest Fedora 36 VM looked faster than my host (Ubuntu 22.04). Maybe that was just an impression 😉
Since I chose the Automatic partitioning, Fedora created two BTRFS subvolumes (one for / and one for /home) with compression, and a separate ext4 /boot partition:
However, after installing Dropbox, while the icon shows on the system tray, clicking on that Dropbox icon (left or right-click or double-click) does not make the context menu appear, making that unusable. I seem to understand that it is a known problem, and maybe they are already working on that. For the time being, if you need the Dropbox context menu for settings like “selective sync,” you’re out of luck. However, you can use the dropbox command-line program for the settings. In that case, I first ignore all the folders and then remove the exclusion for the folders I want to have in sync.
For example, I only want “Screenshot” and “sync” from my Dropbox on my local computer, and I run:
On a side note, I find the Dropbox support for Linux a kind of an insult…
I look forward to upgrading my existing Fedora 35 installations on my computers, and maybe I’ll get back with more impressions on Fedora 36 on real hardware.
I had previously written about mirroring Eclipse p2 repositories (see this blog tag), but I’ll show how to do that with Tycho and one of its plugins in this post.
The goal is always the same: speed up my Maven/Tycho builds that depend on target platforms and insulate me from external servers.
I will show how to create a mirror of a few features and bundles from a few p2 repositories so that I can then resolve a target definition file against the mirror. In the POM, I will also create a version of the target definition file modified to use the local mirror (using Ant). Moreover, I will also use a Tycho goal to validate such a modified target definition file against the local mirror. The overall procedure is also automatized in the CI (GitHub Actions). This way, we are confident that we will create a mirror that can be used locally for our builds.
First of all, let’s see the target platform I want to use during my Maven/Tycho builds. The target platform definition file is taken from my project Edelta, based on Xtext.
As you see, it’s rather complex and relies on several p2 repositories. The last repository is the Orbit repository; although it does not list any installable units, that is still required to resolve dependencies of Epsilon (see the last but one location). We have to consider this when defining our mirroring strategy.
As usual, we define a few properties at the beginning of the POM for specifying the versions of the plugin and the parts of the p2 update site we will mirror from:
The mirror will be generated in the user home subdirectory “eclipse-mirrors” (<destination> tag); we also define a few other mirroring options. Note that in this example, we cannot mirror only the latest versions of bundles (<latestVersionOnly>), as detailed in the comment in the POM. We also avoid mirroring the entire contents of the update sites (it would be too much). That’s why we specify single installable units. Remember that also dependencies of the listed installable units will be mirrored, so it is enough to list the main ones. You might note differences between the installable units specified in the target platform definition and those listed in the plugin configuration. Indeed, the target platform file could also be simplified accordingly, but I just wanted to have slight differences to experiment with.
If you write the above configuration in a POM file (a <packaging>pom</packaging> will be enough), you can already build the mirror running:
1
mvn package
Remember that the mirroring process will take several minutes depending on your Internet connection speed since it will have to download about 500 Mb of data.
You can verify that all the specified repositories are needed to create the mirror correctly. For example, try to remove this part from the POM:
Unable tosatisfy dependency from org.eclipse.epsilon.picto2.3.0.202104221823
toosgi.bundle;net.sourceforge.plantuml0.0.0.;
Unable tosatisfy dependency from org.eclipse.epsilon.picto2.3.0.202104221823
toosgi.bundle;org.apache.commons.csv0.0.0.;
Unable tosatisfy dependency from org.eclipse.epsilon.emg.engine2.3.0.202104221823
toosgi.bundle;org.apache.commons.math30.0.0.]
Those requirements are found in the Orbit p2 repository, which we have just removed for testing purposes.
Unfortunately, I found no way to make the build fail in such cases, even because it’s just a warning, not an error. I guess this is a limitation of the Eclipse mirroring mechanism. However, we will now see how to verify that the mirror contains all the needed software using another mechanism.
We create a modified version of our target definition file pointing to our local mirror. To do that, we create an Ant file (create_local_target.ant):
Note that this also handles path separators in Windows correctly. The idea is to replace lines of the shape <repository location=”https://…”/> with <repository location=”file:/…/eclipse-mirrors”/>. This file assumes the original target file is example.target, and the modified file is generated into local.target.
If this goal also succeeds, we managed to create a local mirror that we can use in our local builds. Of course, in the parent POM of your project, you must configure the build so that you can switch to local.target instead of using your standard .target file. (You might want to look at the parent POM of my Edelta project to take some inspiration.)
Since we should not trust a test that we never saw failing (see also my TDD book 🙂 let’s try to verify with the incomplete mirror that we learned to create by removing the Orbit URL. We should see that our local target platform cannot be validated:
Alternatively, let’s try to build our mirror with <latestVersionOnly>true</latestVersionOnly>, and during the validation of the target platform, we get:
1
2
3
4
5
Error:Cannot resolve target definition:
Error:Software being installed:org.eclipse.epsilon.picto.feature.feature.group2.4.0.202203041826
'osgi.bundle; org.antlr.runtime [3.1.1,3.5.3)'but it could notbe found
In fact, we mirror only the latest version of org.antlr.runtime (4.7.2.v20200218-0804), which does not satisfy that requirement. That’s why we must use with <latestVersionOnly>false</latestVersionOnly> in this example.
Besides Windows (which I rarely use) on my computers, I have a few Linux distributions. Grub 2 does a good job booting Windows and Linux, especially thanks to os-prober, in autodetecting other operating systems in other partitions of the same computer. However, there are a few “buts” in this strategy:
Typically, the last installed Linux distribution, say L1, installs its own grub as the main one, and when you upgrade the kernel in another Linux distribution, say L2, you have to boot into L1 and “update-grub” so that the main grub configuration learns about the new kernel of L2. Only then can you boot the new kernel of L2. Of course, you can change the main grub by reordering the EFI entries, e.g., by using the computer’s BIOS, but again, that’s far from optimal.
Not all Linux distributions’ grub configurations can boot other Linux distributions. For example, Arch-based distros like EndeavourOS and Manjaro can boot Ubuntu-based distros, but not the other way around (unless you fix a few things in the grub configuration of Ubuntu)! Recently, I also started to use Fedora. I found out that os-prober in Ubuntu and EndeavourOS does not detect the configurations correctly to boot Fedora: recently, Fedora switched to “blscfg” (https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault), and as a result, Ubuntu and EndeavourOS create grub configurations that do not consider the changes you made in Fedora’s /etc/default/grub.
That’s why I started to experiment with grub configurations. I still have a “main grub” in a Linux installation, which simply “delegates” to the grub configurations of the other Linux installations. This way, I can solve both the problems above!
In this blog post, I’ll show how I did that. Note that this assumes you use EFI to boot.
I have Windows 10, Kubuntu, EndeavourOS, and Fedora on the same computer in this example. I will configure the grub installation of Fedora so that it delegates to Windows, Kubuntu, and EndeavourOS without relying on os-prober.
This is the disk layout of my computer so that you understand the numbers in the grub configuration that I’ll show later (I omit other partitions like Windows recovery).
1
2
3
4
5
6
/dev/nvme0n1p1650MEFI System
/dev/nvme0n1p3139GMicrosoft basic data
/dev/nvme0n1p720GLinux swap
/dev/nvme0n1p887,9GLinux filesystem FEDORA
/dev/nvme0n1p1068,9GLinux filesystem ENDEAVOUROS
/dev/nvme0n1p1170,2GLinux filesystem KUBUNTU
The key point is modifying the file /etc/grub.d/40_custom. I guess you already know that you should not modify directly grub.cfg, because a system update or a grub update (e.g., “update-grub”) will overwrite that file.
The file /etc/grub.d/40_custom already has some contents that must be left as they are: you add your lines after the existing ones. For example, in Fedora, you have:
Shell
1
2
3
4
5
#!/usr/bin/sh
exec tail-n+3$0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
If the other distribution has already a valid /boot folder with installed GRUB, grub.cfg, kernel and initramfs, GRUB can be instructed to load these other grub.cfg files on-the-fly during boot.
The idea is to put in /etc/grub.d/40_custom an entry for each Linux distribution, pointing to the grub.cfg of that distribution after setting the root partition. Thus, the path to the grub.cfg must be intended as an absolute path in that partition. If you look at the partition numbers above, these are the two entries for booting EndeavourOS and Kubuntu:
Shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
menuentry"EndeavourOS"{
insmod part_gpt
insmod btrfs
insmod ext2
rmmod tpm
set root='hd0,gpt10'
configfile/boot/grub/grub.cfg
}
menuentry"Kubuntu"{
insmod part_gpt
insmod btrfs
insmod ext2
rmmod tpm
set root='hd0,gpt11'
configfile/boot/grub/grub.cfg
}
NOTE: the “rmmod tpm” is required to avoid TPM errors when booting those systems (“Unknown TPM error”, “you need to load the kernel first”). It happened on my Dell XPS 13, for example. Adding that line (i.e., not loading the module “tpm”) solved the problem.
Remember that the path assumes that the /boot directory is not mounted on a separate partition. If, instead, that’s the case, you probably have to remove “/boot”, but I haven’t tried that.
In this entry, the root must correspond to the EFI partition, NOT to the partition of Windows.
Save the file and regenerate the grub configuration. In other Linux distributions, it would be a matter of running “update-grub,” but in Fedora, it is:
1
sudo grub2-mkconfig-o/boot/grub2/grub.cfg
Now reboot, and you should see the grub menu of Fedora and then, at the bottom, the entries for EndeavourOS, Kubuntu, and Windows. Choosing “EndeavourOS” or “Kubuntu” will NOT boot directly in these systems: it will show the grub menu of “EndeavourOS” or “Kubuntu.”
If you upgrade the kernel on one of these two systems, their grub configuration will be correctly updated. There’s no need to boot into Fedora to update its grub configuration 🙂
If you want to configure the grub in another Linux distribution, please remember that Fedora stores the grub.cfg in /boot/grub2 instead of /boot/grub, so you should write the entry for Fedora with the right path. However, if you plan to boot Fedora with this mechanism, you should disable “blscfg” in the Fedora grub configuration, or you will not be able to boot Fedora (errors “increment.mod” and “blscfg.mod” not found).
Now that we verified that it works, we can remove the entries generated by os-prober. In /etc/default/grub add the line:
On a side note, due to the way Fedora uses grub (https://fedoraproject.org/wiki/Changes/HiddenGrubMenu), without os-prober, you will not see the grub menu unless you press ESC. After the timeout, it will simply boot on the default entry. To avoid that and see the grub menu, just run:
1
sudo grub2-editenv-unset menu_auto_hide
And the grub menu will get back as usual.
Then, you can also remove os-prober from the other Linux installations since it is useless now.
These were the original grub menus of Fedora and EndeavourOS before applying the modifications described in this post:
Pretty crowded!
This is the result after the procedure described in this post (note that from the Fedora grub menu, you select EndeavourOS to land its grub menu and Kubuntu to land its grub menu):
Much better! 🙂
If you need to boot an installation in a BTRFS filesystem (which also includes the /boot directory and the grub.cfg), things are slightly more complex. In fact, BTRFS installations are typically based on subvolumes. The root subvolume is typically denoted by the label “@”. This must be taken into consideration when creating the menu entry.
For example, I’ve also installed Arch on my computer using BTRFS, and the root subvolume is denoted by “@”. The menu entry is as follows:
1
2
3
4
5
6
7
8
9
menuentry"Arch"{
insmod gzio
insmod part_gpt
insmod btrfs
insmod ext2
rmmod tpm
set root='hd0,gpt13'
configfile/@/boot/grub/grub.cfg
}
Note the presence of “/@” in the configfile specification.
That’s not all. If the GRUB configuration specified in configfile has submenus, for example, automatically generated by grub-btrfs, you also must define the prefix variable appropriately (in fact, grub-btrfs generates entries relying on such a variable):
Press the “+” button to create a new virtual machine, and we select the first entry since we have downloaded an ISO.
Here, we select the ISO and let the manager detect the installed OS. Otherwise, we can choose the OS manually (the manager might not catch the OS correctly in some cases: it happened to me with ArcoLinux, for example).
Then, we allocate some resources. Since I have 16GB and a quad-core, I give the virtual machine 8GB and two cores.
Then, we allocate storage for the machine. Alternatively, we can select or create a custom image file in another location. By default, the image will NOT occupy the whole space physically on your disk. Thus, I will not lose 60GB (unless I’ll effectively use such a space on the virtual machine). The file will appear of the specified size on your drive, but if you check the free disk space on your drive, you will note that you haven’t lost so many Gigas (more on that in the next steps).
In the last step, we can give a custom name to our machine and customize a few settings before starting the installation by selecting the appropriate checkbox (we also make sure that the network is configured correctly).
If we selected “Customize configuration before install,” by pressing “Finish,” we get to the settings of our virtual machine.
In this example, I’m going to change the chipset and specify a UEFI firmware:
We can also get other information, like the path of the disk image:
And we can click “Begin Installation.” After the boot menu, we’ll get to the live environment of the distribution ISO we chose:
You can also specify to resize the display of the VM automatically if you resize the window and when to do that. (WARNING: this will work correctly only after installing the OS in the virtual machine since this feature requires some software in the guest operating system. Typically, such a software, spice-vdagent, is automatically installed in the guest during the OS installation, from what I’ve seen in my experiments.)
And we can start the installation of the distribution (or try it live before the actual installation), as usual. Of course, the whole installation process will be a bit slower than on real hardware.
I’ll choose the “Automatic” choice for disk partitioning since the disk image will be allocated only to this machine, so I will not bother customizing that.
While installing, you might want to check the disk image size and the effective space on the disk:
After a few minutes, the installation should be complete, and we can reboot our virtual machine
And upon reboot, we’ll get to our new installed OS on the virtual machine:
In the primary Virtual Machine Manager window, you can see your virtual machines, and, if they are running, a few statistics:
In the virtual machine window’s “View” menu, you can switch between the “Console” view (that is, the virtual machine installed and running OS) and the “Details” view, where you can see its settings, and change a few of them.
Note that now the automatic resize of the machine display and the window works: in the screenshot I resized the window (made it bigger) and the display of the machine resized accordingly.
When you later restart a virtual machine from the manager, you might have to double-click on the virtual machine element and possibly switch to the “Console” view.
After installing the OS, you might want to check the image file and the actual disk usage again. You will find that while the image file size did not change, the disk usage has:
What I’ve shown in this blog post was one of my first experiments with KVM and the Virtual Machine Manager. To be honest, I still prefer VirtualBox, but maybe that’s only because I’m more used to VirtualBox, while I’ve just started using virt-manager.
That’s all for now! Stay tuned for further posts on KVM and virt-manager, and happy virtualization! 🙂
I’ve been using this laptop for some months now (see my other posts). In Windows, you can easily set the battery charge limit to 80% using the LG Gram control center. In Linux, I did not find any specific configuration in any system settings in any DE (not even in KDE Plasma, where, for some laptops, there’s support for setting the battery charge limit).
Writing 80/100 to /sys/devices/platform/lg-laptop/battery_care_limit sets the maximum capacity to charge the battery. Limiting the charge reduces battery capacity loss over time.
This value is reset to 100 when the kernel boots.
So you need to write ’80’ in that file. I do that like that:
After that, you can see that when charging reaches 80%, the laptop will not charge the battery anymore. Depending on the DE, either you see the charging notice disappear or the charging stuck at 80%. The DE might even tell you that it still needs some time until fully charged, but you can ignore that. That notice will stay like that, as shown in these two screenshots (KDE Plasma), taken at different times:
Note that in the quotation shown above, you also read
This value is reset to 100 when the kernel boots.
If you reboot, the value in that file will go back to ‘100’, and charging will effectively continue. Note that this also holds if you hibernate (suspend to disk) the laptop since when you restart it from hibernate, you’ll boot it anyway, so that will reset the value in the file. However, if you put the laptop to sleep, the value of the file will not change.
Above I said that you need kernel 5.15. I think the feature described above was introduced even before, but in kernel 5.13, that does not seem to work: no matter what you write in that file, the change will not be persisted. In my experience, this only works starting from kernel 5.15.
With kernel 5.15, it works for me in EndeavourOS, Manjaro, and Kubuntu.
I’ve been using Linux EndeavourOS (the latest version, “Atlantis neo”) for a few days now, and I love it!
I mainly use Ubuntu and Kubuntu, but I recently enjoyed Manjaro, an Arch-based distro. I still haven’t tried to install the pure Arch distribution, but I learned about EndeavourOS, an Arch-based distro, which is pure Arch. For sure, it’s more Arch than Manjaro since EndeavourOS uses the Arch repositories, plus a small EndeavourOS repository. On the contrary, Manjaro heavily relies on its independent repositories (which also contain software packages not provided by Arch). So, they’re both rolling releases, but EndeavourOS is Arch but with a much simpler installation procedure.
I’ll first briefly recap the installation procedure and then do a short review.
Installation
The installation starts with an XFCE desktop and a dialog where you can set a few things, including the screen resolution in case you need to:
Now it’s time to connect to the Internet, e.g., with a WIFI (the setting will be remembered in the final installation so that you will not have to re-enter the WIFI username and password).
Then, we can start the installer:
I prefer to choose “Online” so that I can select a different desktop environment (I don’t use XFCE, which is the only choice if you perform the “Offline” method):
One of the exciting aspects of the EndeavourOS installation process is that it automatically shows a terminal with the log. This terminal can be helpful to debug possible installation problems.
The installer is Calamares, which you might already know if you used Manjaro.
I’m going to show only the interesting parts of the installation.
The partitioning already found the main SSD drive.
Since I have a few Linux installations already on this computer, I choose to replace one of them with EndeavourOS.
In particular, I select the Manjaro Linux (21.2rc) checkbox to replace that installation (see the “Current:” and the “After:” parts):
Since I chose the “Online” installer, I can now select the software to install. Note the printing support software:
I also decide to install both KDE and GNOME (maybe I’ll blog in the future about the coexistence of the two desktop environments). That’s another exciting feature of EndeavourOS: it lets you install as many desktop environments as you want right during the installation. Other distributions typically only provide ISOs for specific desktop environments (the so-called “spins”).
If you expand the nodes in the tree, you can see the installed software for each DE. I can anticipate that for both KDE and GNOME, the installed programs are not so many.
Time for looking at the summary, and then we’re good to start the installation, which takes only a few minutes on my computer.
Review
As I have already anticipated, I’m enjoying this distribution so far.
I mainly use the KDE Plasma desktop. Plasma looks like it is very close to vanilla Plasma in this distribution. It does not come with many preinstalled KDE software, but all the necessary KDE applications are there.
I had to install a few additional KDE applications I like to have. The corresponding packages are plasma-systemmonitor, kdeplasma-addons (for other task switchers), and kcalc.
Of course, pacman is already installed, but you also have yay already installed.
Since I like the GUI front-end pamac, I had to install that manually:
1
yay-Spamac-all
Remember that, besides an EndeavourOS repository, everything else comes from the official Arch repositories.
EndeavourOS ships with the latest Linux kernel 5.15, and on my computers, it works like a charm.
The “Welcome” application automatically appears when you log in, and it provides a few helpful buttons: for updating the mirrors, the packages, and configuring package cache cleaning:
For updating the software packages, yay will start in a terminal window. Indeed, EndeavourOS defines itself as a “terminal-centric distro.”
Speaking about software updates, you get a system tray notification when they are available:
But unfortunately, clicking on that does not do anything: you have to update the software manually (e.g., by using the above-mentioned “Welcome” app).
Another minor defect (if I have to find defects) is the empty icon on the panel: it refers to the KDE “Discover” application, which is not installed by default. That is confusing, and probably the installation should have taken care of not putting it there by default.
Besides that, I enjoy the KDE Plasma experience provided by EndeavourOS.
Concerning GNOME, again, the installed software is minimal, but you get the essential software, including Gnome Tweaks. No specific GNOME extensions are provided, but you can install them yourself. In the end, it’s vanilla GNOME.
All in all, I guess I’ll be using EndeavourOS as my daily driver in the next few days!
I hope you try EndeavourOS yourself and enjoy it as much as I do 🙂
That’s the third post on installing Linux on a USB drive!
Remember that the idea is to have a USB drive that will work as a portable Linux operating system on any computer.
In the first post, How to install Linux on a USB drive using Virtualbox, the USB drive with Linux installed could be used when booting from a computer with “Legacy boot” enabled: it could not boot if UEFI were the only choice in that computer.
In the second post, How to install Linux on a USB with UEFI support, I showed how to install Linux on the USB drive directly, without using VirtualBox, while creating a UEFI bootable device. However, you had to be careful during the installation to avoid overwriting the UEFI boot loader of your computer.
In this post, I’ll show how to install Linux on a USB drive, with UEFI support, using VirtualBox. In the end, we’ll get a UEFI bootable device, but without being scared of breaking the UEFI boot loader of your computer, since we’ll do that using a virtual machine.
The scenario
First of all, let’s summarize what I want to do. I want to install Linux on a portable external USB SSD. I don’t want a live distribution: a live distribution only allows you a little testing experience, it’s not easily maintainable and upgradable, it’s harder to keep your data in there. On the contrary, installing Linux on a USB drive will give you the whole experience (and if the USB drive is fast, it’s almost like using Linux on a standard computer; that’s undoubtedly the case for an external SSD, which are pretty cheap nowadays).
I’m going to use VirtualBox installed on a Dell XPS 13 where I already have (in multi-boot, UEFI), Windows, Ubuntu, Kubuntu, and Manjaro GNOME
I’m going to install Ubuntu 21.10 into an external USB SanDisk SSD (256 Gb)
then I’m going to install on the same external USB drive also EndeavourOS (an excellent distribution I’ve just started to enjoy) along with the installed Ubuntu
I have already downloaded the two distributions’ ISOs.
I’ve installed VirtualBox in Ubuntu following this procedure
By the way, since the second distribution will take precedence over an existing UEFI configuration on the USB, it’s better to start with Ubuntu and then proceed with EndeavourOS (Arch based). While an Arch GRUB configuration has no problem booting other distributions, Ubuntu cannot boot an Arch-based distribution. Of course, the second distribution’s GRUB menu will let you also boot the first one. We could solve the booting problem later, but I prefer to keep things easy and install them in the above order.
In the screenshots of the running virtual machine, the USB SanDisk is /dev/sda.
I will boot a virtual machine where I set the ISO of the current distribution as a LIVE CD. I’m going to use a different virtual machine for each distribution. Maybe that’s not strictly required, but since the two OSes are different (the first one is an Ubuntu OS, while the second one is an Arch Linux), I prefer to keep the two virtual machines separate, just in case.
Create the first virtual machine and install Ubuntu on the USB drive
I’m assuming you’re already familiar with VirtualBox, so I’ll post the main screenshots of the procedure.
Let’s create a virtual machine.
We don’t need a hard disk in the virtual machine since we’ll use it only for installing Linux on a USB drive, so we’ll ignore the warning.
.
Now it’s time to configure a few settings.
The important setting is “Enable EFI” to make our virtual machine aware of UEFI, and the booted Live OS will also be aware of it. As we will see later, the booted Live OS will correctly install GRUB in a UEFI partition.
We also specify to insert the ISO of the distribution (Ubuntu 21.10) so that when the virtual machine starts, it will boot the Live ISO.
Let’s start the virtual machine, and we will see the boot menu of the Live ISO.
We choose to Try Ubuntu, and then we plug the external SanDisk in the computer, and we make the virtual machine aware of that by using the context menu of the USB connection icon and selecting the item corresponding to the USB hard disk (in your case it will be different)
After that, the Ubuntu Live OS should notify about the connected disk. We can start the installation, and when it comes to the disk selection and partition, I chose to erase the entire disk and install Ubuntu:
Of course, you can choose to partition the hard disk manually, but then you’ll have to remember to create a GPT partition table, and you’ll also have to create the FAT32 partition for UEFI manually. By using “Erase disk and install Ubuntu,” I’ll let the installer do all this work.
You can see the summary before actually performing the partition creation. Note that we are doing such operations on the external USB drive, which, as I said above, corresponds to /dev/sda.
Now, we have to wait for the installation to finish. In the end, instead of restarting the virtual machine, we shut it down.
Let’s restart the computer with the USB drive connected. Depending on the computer setup, you’ll have to press some function key (e.g., F2 or, in my Dell XPS 13, F12, to choose to boot from a different device). Here’s the menu in my Dell XPS 13, where we can see that the external USB (SanDisk) is detected as a UEFI bootable device. It’s also detected as a Legacy boot device, but we’re interested in the UEFI one:
We can then verify that we can boot the Ubuntu distribution installed in the USB drive.
By the way, I also verified that, without the USB drive connected, I can always boot my computer: indeed, the existing UEFI Grub configuration is intact (remember, I have Windows, Ubuntu, Kubuntu, and Manjaro GNOME; the grub menu with higher priority is the one of Manjaro):
Create the second virtual machine and install EndeavourOS on the USB drive
Let’s create the second virtual machine to install on the same USB drive EndeavourOS, along with the Ubuntu we have just installed.
To speed up things, instead of creating a brand new machine, we clone the previous one, and we change a few settings (basically the name, the version of Linux, which now is Arch, and finally we change the Live ISO):
Let’s start the virtual machine and land into the EndeavourOS Live system
As before, we have to connect the USB drive to the computer and let the virtual machine detect that (see the procedure already shown in the first installation section).
We start the installer and choose the “Online” version so that we can choose what to install next (including several Desktop Environments). The installer is Calamares (if you used Manjaro before, you already know this installer).
When it comes to the partitioning part, we make sure we select the SanDisk external drive (as usual, /dev/sda). Note that the installer detects the existing Ubuntu installation. This time, we choose to install EndeavourOS alongside:
And we use the slider to specify how much space the new installation should take:
Let’s select a few packages to install (a cool feature of EndeavourOS)
And this is the summary before starting the installation:
Once the installation has finished, we shut down the virtual machine and reboot the computer with the USB drive inserted. This time we see the EndeavourOS grub configuration, including the previously installed Ubuntu. Remember, these are the installations in the USB drive (as usual, note the /dev/sda representing the USB drive):
And now we have a USB drive with two Linux distributions installed that we can use to boot our computers! However, some drivers for some specific computer configurations might not be installed in the Linux installation of the external USB. Also, other configurations like screen resolutions and scaling might depend on the computer you’re booting and might have to be adjusted each time you test the external USB drive in a different computer.
I hope you enjoyed the tutorial!
Happy installations and Happy New Year! 🙂
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.