Archives For grub

GNU Grub logo image from Wikipedia.org

After installing Ubuntu 22.10 today in my desktop PC, the dual-boot Windows 10 disappeared from the startup boot menu. If you run into similar issue, here’s the quick tip to fix it.

This is definitely not bug, but a policy change since GNU Grub 2.06. The default boot-loader uses external os-prober tool to discover other operating systems on the same machine. However, the feature is disabled now for security reason due to the manual:

It is disabled by default since automatic and silent execution of os-prober, and creating boot entries based on that data, is a potential attack vector. Set this option to ‘false’ to enable this feature in the grub-mkconfig command.

By reloading the config will prompt your that “Warning: os-prober will not be executed to detect other bootable pertitions“.

Ubuntu 22.04 is the first release uses GRUB 2.06, which however not affected in my case. So I didn’t encounter this issue until trying Ubuntu 22.10 today on dual-boot machine. And, here’s how to fix the the ‘issue’ in 2 ways.

Option 1: Manually re-enable OS-PROBER

As mentioned in the manual, just set the ‘GRUB_DISABLE_OS_PROBER’ option to ‘false’ in Grub configuration will do the trick.

1. First, press Ctrl+Alt+T on keyboard to open a terminal window. When it opens, run command to edit the Grub config file:

sudo nano /etc/default/grub

Ubuntu 22.10 switched to gnome-text-editor which however does not work along-with sudo from command line. So here I use nano command line text editor instead.

2. When the file opens in terminal window, scroll down and add the new line (or change the value if the line already exists):

GRUB_DISABLE_OS_PROBER=false

After that, save changes by pressing Ctrl+X, type y and hit Enter.

3. Finally, run sudo update-grub to reload the change.

Don’t know why, but Windows OS appears in boot-menu again after I did restart computer twice in my case.

Option 2: Use Grub-Customizer (graphical tool)

For those who prefer using a graphical configuration tool, there’s a third-party Grub-Customizer app available for choice.

1. First, you still need to open terminal (Ctrl+Alt+T) and run 3 commands one by one to install the tool from developer’s PPA:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer

2. Search for and launch grub customizer from system start menu or ‘Activities’ overview.

3. When the app opens, navigate to ‘General Settings‘ page, then do:

  • click on bottom right advanced settings option.
  • in next pop-up dialog, click “Add” (or edit if exists) and type:
    • name: GRUB_DISABLE_OS_PROBER
    • value: false

Close advanced settings dialog, and finally click “Save” button in the app to apply change.

This simple tutorial shows how to reboot your machine into another OS or grub boot menu entry directly from Ubuntu.

Say you have Ubuntu dual- or multi-boot with other operating systems, and want to reboot directly into a specific OS when working done in current Ubuntu. Or you want to reboot with another Kernel or maybe recovery mode without any keyboard press while booting. This tutorial may help.

Method 1: Single command to reboot into another OS

Grub, the default boot-loader for many Linux, has a command line tool grub-reboot, which allows to set the default boot-entry for ONLY next boot.

Along with reboot command, it allows to reboot directly into another entry. For example, reboot into the third menu try with command:

sudo grub-reboot 2 && reboot

NOTE: Grub menu entry counts from 0. Number 2 means the 3rd entry.

Tell which number for booting your OS/entry

You don’t have to reboot and count in the boot-menu for your desired number. There are 2 ways to view the menu from in Ubuntu.

Option 1. Preview Grub Menu via Grub-Emu

Press Ctrl+Alt+T on keyboard to open terminal, and run command to install grub-emu:

sudo apt install grub-emu

Then, run grub-emu command in terminal will open up a window for previewing your boot-loader. And, close the terminal will also close the preview window.

Option 2. Use Grub-Customizer

Grub-Customizer is a good alternative, as the preview tool does not work good in my case. To install it, open terminal (Ctrl+Alt+T) and run 3 commands below one by one.

The commands will add the software developer’s PPA repository, update cache and finally install it into your system.

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt update
sudo apt install grub-customizer

After that, search for and open it from either system start menu or ‘Activities’ overview depends on your DE.

As the screenshot shows you, number 2 is for Windows in my case. 1>1 means recovery mode, and 1>2 means the previous kernel entry.

So, run the command below will reboot directly into Windows in my case:

sudo grub-reboot 2 && reboot

To reboot into recovery mode in sub-menu entry (quotation marks required), use:

sudo grub-reboot "1>1" && reboot

And, if you want to use the command in script or bind with a keyboard shortcut, use command:

pkexec grub-reboot 2 && reboot

So, it will pop-up an authentication dialog asks you to type user password, before performing the action.

Method 2: Add Reboot option in top-right system menu

For GNOME 43, meaning users of Ubuntu 22.10, Fedora 37, Arch and Manjaro Linux, there’s an extension to do the job by adding menu entries into system status menu.

By clicking on an entry in the menu, will pop-up password authentication dialog, and then shows you the reboot dialog. When typing correct password and click restart in pop-up dialog, it reboot directly with that entry you just clicked!

How to Install the Extension

For Ubuntu 22.10, first search for and install “Extension Manager” from Ubuntu Software.

Install Extension Manager in Ubuntu 22.04+

Then press Super (the Windows Logo) key to activate overview, search for and open “Extension Manager”. Finally, use the tool to install the “Custom Reboot” extension:

For Fedora 37 and other Linux with GNOME 43, you may go directly to the extension website and use ON/OFF switch to install it.

For Linux users want to configure the boot menu screen, Grub Customizer is always a good choice for beginners.

I’ve written quite a few tutorials about the default boot-loader, which is called Grub, including set default OS to boot, install themes, add kernel parameters for hibernate, custom screen resolution, etc. All of them can be done via Grub-Customizer besides editing the configuration file.

Grub Customizer – Set default entry, menu visibility, & Kernel parameters

Why Grub Customizer Removed from Ubuntu 22.04 Repository:

Grub Customizer is removed from Ubuntu 22.04 repository due to its broken logic issue. See this bug for details

However, there are some customizations that are apparently not doable by simply editing the existing configuration scripts. For those, the program moves all existing conf scripts out of the way, and instead installs “proxy scripts” written in a custom language that basically filter the output of the original scripts…

In general, Grub Customizer works for what it does, but it has logic issue about how it do the customizations that might cause issues (especially for upgrading system). So Ubuntu developer team remove the package from the universe repository.

How to Install Grub Customizer via PPA in Ubuntu 22.04

The software developer has updated the app claimed that the bug mentioned above has been fixed. And, the package has been published in its official Ubuntu PPA.

1. Add Grub Customizer PPA

Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to add the PPA:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer

Type user password when it asks (no asterisk feedback), then hit Enter to continue.

2. Add Grub Customizer PPA

After adding the PPA, you may run the apt command to install the tool in Ubuntu 22.04:

sudo apt install grub-customizer

NOTE: For Ubuntu based system, it may need to run sudo apt update to update package cache first.

Once installed, click on top-left ‘Activities‘ then search for and open the tool.

Configuring boot menu requires root (administrator) permission, so it will ask for password authentication on app start.

In the first tab, you may edit the text to display, add, remove, and/or re-arrange the menu entries.

For dual-boot or multi-boot machine, it’s possible to select which entry as default under General settings page. There are as well menu visibility and kernel parameters options (see the first screenshot).

Just like editing ‘/etc/default/grub‘ files, the bottom-right ‘advanced settings‘ button adds ability to add/edit/remove more rules.

And, ‘Appearance settings’ page offers options to configure text font, background, themes etc. Though, I prefer to install themes directly via source tarball (find Grub Themes here).

After configuration, remember to click ‘save‘ button to apply changes. That’s all.

Boring with the poor boot menu appearance? Try the cool DedSec GRUB theme.

It’s a Grub boot-loader (defaults in most Linux) theme inspired by the fictional hacker group DedSec from Watch Dogs series video game. With it installed, you’ll get the themed background, font, icons, and so forth in the boot-screen:

How to Install DedSec Grub Theme:

The theme project is hosted on Github. User may install it either by the installer script in the source or manually by configuring Grub.

Method 1: Install DedSec theme via the script:

Firstly, search for and open terminal from start menu (Ubuntu may just press Ctrl+Alt+T on keyboard). When it opens, run command to grab the source:

git clone --depth 1 https://github.com/vandalsoul/dedsec-grub2-theme.git

Install git if you don’t have it via sudo apt install git.

After the downloading process finished, go to the source folder:

cd dedsec-grub2-theme

Finally, run the installer and select from the 18 theme-styles to install:

sudo python3 install.py

If everything runs successfully, you’ll see the new boot-menu appearance in next boot!

Method 2: Manually Install DedSec theme:

The installer script seems to always install theme name as ‘dedsec‘. While there are 18 theme styles, you can only get one of them installed at a time.

To get them all, download the package from the link below:

Extract and put the sub-folder(s) (which contains icons, background, and theme.txt file) into “/boot/grub/themes” folder.

Create ‘boot/grub/themes’ folder via sudo mkdir /boot/grub/themes if NOT exist. And open that folder via “sudo nautilus /boot/grub/themes” command as you need root permission to do drag & drop operation.

Finally, apply a Grub theme either via ‘Grub Customizer’ (available in Ubuntu Software):

or manually edit the ‘/etc/default/grub’ file via the command below:

sudo gedit /etc/default/grub

Replace gedit with your favorite text editor or use xdg-open as GNOME 42 will no longer defaults to gedit. And, write new line GRUB_THEME = “PATH/TO/theme.txt”.

Changing the configuration file manually needs to update the grub via the command below:

sudo update-grub

For Fedora, the command will be:

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Since Ubuntu 20.04, it shows your computer manufacturer logo on startup. It’s however easy to remove it, as well display the blank and white boot text message.

The Grub boot-loader offers option to toggle the settings in its configuration file. You can either manually edit the file or using a graphical tool called Grub Customizer.

NOTE: This tutorial will replace startup animation with blank while text message! If you still want the animation screen, see this new tutorial instead.

Option 1. Manually configure Grub bootloader:

Firstly, search for and open terminal from system app launcher. When it opens, run command to edit the Grub configuration file:

sudo gedit /etc/default/grub

For Ubuntu flavors or based systems, replace gedit with your system text editor.

When the files opens, do:

  • Remove quiet and splash from line ‘GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”‘. Keep other parameters if any. In my case, it will be GRUB_CMDLINE_LINUX_DEFAULT=””.
  • (Optional) Enable GRUB_TERMINAL=”console” by removing # at the beginning. NOTE this will disable the boot-menu theme if any.

Finally apply changes by running command:

sudo update-grub

Option 2. Configure Grub via Grub Customizer:

The popular graphical configuration tool offers ability to change the boot parameters.

Firstly, install Grub Customizer either in Ubuntu Software or by running command in terminal:

sudo apt install grub-customizer

Next, launch the tool and navigate to ‘General settings‘ tab. There you can easily remove the ‘quiet’ and ‘splash’ boot parameters. And optionally enable ‘GRUB_TERMINAL=”console”‘.

Click on Save button. Changes will take effect at next boot!