How to Hide Grub Boot Menu in Ubuntu 20.04, 21.10 (Updated)

Last updated on July 17th, 2021

This simple tutorial shows how to hide / disable the Grub boot menu while booting Ubuntu.

You can do the job easily via Grub-Customizer (available in Ubuntu Software) under General Settings tab. However, you need to also disable “look for other operating systems” option.

Any time you want to show the Grub menu, press ESC while booting up will NO longer show dual-boot (multi-boot) systems other than Ubuntu.

NOT OK with Grub-Customizer settings? Re-enable “show menu” and “look for other operating systems” options, save changes, and do following steps one by one.

Hide boot menu by manually editing the config file:

In most Linux including Ubuntu, you can edit the /etc/default/grub file along with scripts under /etc/grub.d to control how the Grub boot menu works.

1.) Firstly, open terminal from system app launcher. Run command to edit the configuration file:

sudo -H gedit /etc/default/grub

For Ubuntu flavors / Linux Mint, replace gedit with your favorite text editor.

When the file opens, you need to set following lines:

  • GRUB_TIMEOUT_STYLE=hidden – Hide the boot menu. Though it still wait a few seconds you set by GRUB_TIMEOUT.
  • GRUB_TIMEOUT_STYLE=countdown – Hide boot menu and show countdown. Even set GRUB_TIMEOUT=0. It counts 3,2,1.
  • GRUB_TIMEOUT = 0 – It will boot the default OS immediately. However, you may set it to 3 or 5 so you can press ESC (F4 or hold Shift) during the time to show the boot menu if need.
  • GRUB_DISABLE_OS_PROBER=true – Disable “/etc/grub.d/30_os-prober” because it overwrite the value of GRUB_TIMEOUT_STYLE. However, it will no longer find other OSes other than Ubuntu.
  • GRUB_RECORDFAIL_TIMEOUT=0 – Set timeout if last boot failed. Without the key, it will show and stop at boot menu waiting user action.

2.) Step 1. will do the job after applying changes. However, it will no longer display other operating systems if any in your machine.

In case you want to boot other OS once in a while. Modify 30_os-prober file instead of disable it via “GRUB_DISABLE_OS_PROBER=true”.

To do so, run command:

sudo gedit /etc/grub.d/30_os-prober

And set quick_boot=”0″. So it will no longer overwrite “GRUB_TIMEOUT_STYLE” value you set in step 1, while also find other OSes on your machine.

3.) Finally apply changes via command:

sudo update-grub

How to restore:

Just undo what you did in step 1 and / or 2 and apply change by running command sudo update-grub.