Archives For November 30, 1999

This is a step by step beginner’s tutorial shows how to set the default OS or kernel entry in Grub boot-menu in Ubuntu, Linux Mint, Debian or other Linux.

Most Linux today uses Grub2 to provide a menu on start-up, allowing to choose which operating system, which kernel, or recovery mode to boot.

It by default boots the first entry, while user can configure to automatically another menu entries without user interaction. And, here’s how to do the trick in 2 ways: from command line or use a graphical tool.

Continue Reading…

After installing Ubuntu since 22.10 and higher, the dual-boot Windows 10 and other OSes may be disappeared from the startup boot menu. If you run into that 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 and higher 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.

Preview Boot Menu without Reboot

You don’t have to reboot and count in the boot-menu for your desired number. There are 2 ways to preview 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.

The tool works good in Ubuntu 22.04, but NOT for Ubuntu 24.04 in my case somehow.

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/44, meaning users of Ubuntu 22.10, 23.04, Fedora 37/38, 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/38 and other Linux with GNOME 43/44, 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 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/24.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:

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 gnome-text-editor /etc/default/grub

For Ubuntu 22.04 and earlier, replace gnome-text-editor with gedit in command. Or, use nano instead that works in all other Desktop environments.

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.

NOTE: Since Ubuntu 22.04, Grub Customizer is removed from system repository. You need to run command in terminal (Ctrl+Alt+T) to add the developer’s PPA first:

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

Then, refresh system package cache via command:

sudo apt update

Finally, install Grub Customizer either in Ubuntu Software (for 20.04 & earlier) 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!

The font size of startup boot menu is too small or too large? It’s easy to fix by setting an appropriate screen resolution for the Grub boot-menu in Ubuntu.

1.) Tell which video modes your graphics card support.

Before starting to configure the Grub bootloader, you firstly need to know which video modes are supported.

a.) The hwinfo command has an option to display the information. It however show me nothing. You can try it by opening terminal (Ctrl+Alt+T) and run command:

sudo apt install hwinfo && hwinfo --framebuffer

b.) If howinfo does not work, use videoinfo instead which however runs in Grub command console.

Firstly restart your machine. When you’re at Grub boot-menu, press c to get into command console.

Next run command videoinfo to list supported video modes.

Take a picture of the output, or write down your desired resolution, e.g., 1024x768x32 and 1280x1024x32.

Finally run exit to get back boot menu.

2.) Set a custom screen resolution for Grub boot menu:

Now boot into Ubuntu, open terminal from system app launcher, and run command to edit the Grub configuration file:

sudo gedit /etc/default/grub

Next set a screen resolution by changing value of “GRUB_GFXMODE”. For instance, set 1024x768x32 (32 means 32-bit color) via:

GRUB_GFXMODE=1024x768x32,auto

Multiple resolutions can be specified, the default is auto.

Without running command, you can also set it via Grub Customizer under its ‘Appearance settings’ page.

3.) Update grub to apply change:

If changed the solution via Grub Customizer, simply click on “Save” button. Or, open terminal and run command to update grub:

sudo update-grub

That’s all. Enjoy!