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
.
Hey Ji m, there is an even easier solution…
sudo nano /etc/default/grub
add this line to your grub file:
GRUB_RECORDFAIL_TIMEOUT=0
sudo update-grub
Done!
Big thanks. I couldn’t cope with it. As long as I had a “dual boot” (with M $) everything worked, but a week ago I deleted all the partitions from Bill and despite the correct settings in GRUB – this one was still counting 30 seconds. Thanks again.
This was the only thing to work and took awhile to find, thanks!
I hate when they change stuff like this. Worse yet, make it look like you can change it in one setting but hey gotcha, we got hidden code behind the scenes that nullifys your expectations…
I have installed Ubuntu 20.04 as sole OS on a fresh HD and got stuck with a 30 second grub menu. The changes suggested in steps 1-3 did not change it, but adding the RECORDFAIL line did it for me. Thank you!
Thanks!
This is actually the only GRUB modification that worked!
perfect! thank you very much!
I did fresh install Ubuntu 20.04 on desktop, single boot only and grub stops the bootup. I tried every suggestion above but none worked. I tried ideas from other web sites which didn’t help. Manually typing “exit” works on every bootup.
Sorry, nothing of the above worked for me!
Any other ideas?
To all those wondering what will work:
an old friend’s command is working for me.
——————————-
Hey Ji m, there is an even easier solution…
sudo nano /etc/default/grub
add this line to your grub file:
GRUB_RECORDFAIL_TIMEOUT=0
sudo update-grub
Done!