Hide GRUB when booting

Hey, So I am new to Arch-Linux and linux as a whole, and have installed it alongside windows 10 and would like to use Windows as the ‘Primary OS’ until I am more familiar with manjaro, thus what I wanted to do ‘Hide’ GRUB until a Key is pressed which will show the the Grub menu, if the key is not pressed it loads normally into windows, Thus if possible please provide a detailed and easy to understand guide for my request. Thanks in advance.

Hi,

Are you using Arch or Manjaro? Manjaro already hides grub by default.

1 Like

I am using Manjaro and no mine didnt hide the grub menu, and for more Info I installed the bootloader on /(System …) on the same disk as windows but on a different partition windows is on sda1 and manjaro is on sda4

If you have multiple OS in GRUB it will not be hidden, it will not accept 0 second timeout.
If you want Windows as main OS and Manjaro available when you press a key, then put Windows in your BIOS as primary boot option, and then when needed press the appropriate key (probably Fx key, look at your screen when you boot it will be written somewhere in the first seconds of boot or read your motherboard manual) to open the boot menu to select Manjaro when you want (or go into the BIOS and select Manjaro to boot on if available this way).

If Manjaro is the first boot option in your BIOS then it will load GRUB, and as you have multiple OS and GRUB is configured to detect other OS, it WILL show the menu.

You cannot “Hide” GRUB and make it appears with a key press as you can with BIOS/UEFI, but you can achieve near functionality by customizing your GRUB settings:

  • The default choice is always Windows
  • Make the timeout choice to a very short time, like 2s.

Basically, this will give you a user experience close to what you wanted, only that it will display GRUB menu for 2s rather than like a blank screen for 2s. IMO, this is a better user experience than changing your boot order to Windows from BIOS/UEFI settings.

You need to update your /etc/default/grub:

  • To make Windows your default choice, find GRUB_DEFAULT and change its value to Windows menu entry, ex: GRUB_DEFAULT=“Windows Boot Manager (on /dev/nvme0n1p1)”.

    You can find your Windows menu entry name by running grep menuentry /boot/grub/grub.cfg and look for something with Windows after menuentry.

    In my system, it’s Windows Boot Manager (on /dev/nvme0n1p1)", but yours will be likely different.

    You can also use the value after the $menuentry_id_option (which is expanded to –id) rather than the value Windows thing after menuentry; this is actually recommended by the GRUB documentation.

    The default from fresh installation should be GRUB_DEFAULT=saved, which means the default choice is the last OS you choose.

  • To make 2s timeout, find GRUB_TIMEOUT and change its value to 2, ex: GRUB_TIMEOUT=2.

    The default from fresh installation should be GRUB_TIMEOUT=5, which means 5 second timeout.

Run sudo update-grub afterward to update your GRUB settings.

For reference:
https://www.gnu.org/software/grub/manual/grub/grub.html#Simple-configuration

I am confused … why is everyone saying dual-boot breaks hiding grub?
It does not … though it does have some funnyish conditions, such as if you reboot too quickly it will see it as a ‘failed boot’ and automatically unhide grub during the next boot.

GRUB_DEFAULT=saved
GRUB_TIMEOUT=0.0
GRUB_TIMEOUT_STYLE=hidden

Works for me on a multiboot system that includes windoze. Grub is hidden.

(this would have been slightly more complicated in the past when we had multiple grubs, such as grub-classic and grub-fedora … but now we just use grub)

Yes you can make GRUB hidden by 0s timeout, but as I know, there’s no capability to make it appear by a key press.

Untrue again … Esc works.

Hmmm I don’t know this. Good to know.

So I guess it will be something like

GRUB_DEFAULT="Windows ..."
GRUB_TIMEOUT=0.0
GRUB_TIMEOUT_STYLE=hidden

Along with Esc key press.

Because OS Prober forces MENU for timeout_style, and refuses 0 second as a value for timeout.
In the grub.cfg file, you can verify by yourself:

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi

//EDIT: maybe you tricked/broke it by having a 0[DOT]0 value for timeout, so it accepts it, and then it instantly timeouts so you think the timeout_style is set to hidden but it is probably a menu timeout style with a 0 second timeout then. But by default without tricking the system, this is how it works.

1 Like

I think GRUB_TIMEOUT=0 will cause this timeout to be 10s. I also tried 0 in the past and it wasn’t allowed, as what you shown.

So I guess you need GRUB_TIMEOUT=0.0 for 0s timeout from @cscs . Idk, 0.0 is weird.

Dont have it

I do have:

if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=hidden
  set timeout=0.0
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0.0 ; then
  set timeout=0
fi

The OS Prober part @cscs, the OS Prober part.

### BEGIN /etc/grub.d/30_os-prober ###
.....

Check, I’m pretty confident. check also my edit above.

Agreed … but it came form a pacnew, and I was already using 0 … so I checked 0.0 worked, and since it was ‘upstream’ I shrugged and used that.

OK … so I went and made sure that GRUB_DISABLE_OS_PROBER=false was uncommented in /etc/default/grub … run sudo update-grub again, checked for your lines … and its …

set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi

Rebooted.
But still hidden grub.
(reboot again and Esc still works to show grub)

So yeah it should have forced menu style and 10 seconds timeout, but what happens is probably what I edited in previous post, if you didn’t see:

Ummmmmmmm… I messed up and want to reset the grub config to default, how do I do it.

nvm fixed

Windows does load by default no grub menu shown, but when checking if Manjaro works, I tried using the esc key once, and then i spammed it to the best of my ability in another run (All the way from the BIOS screen to when the Windows logo showed up) but didnt get the Grub menu to work, So yea if possible please help.

2 things;

  • It used to be Shift … so maybe try that?
  • windoze doesnt shutdown all the way by default … make sure you do a full shutdown.