sodcalculator

10 Tech How-To

Fix Hidden Grub Boot Menu in Ubuntu

Guide 10-37468 · Updated · Step by step

If your Ubuntu system boots straight into the OS and the GRUB boot menu never appears, the fix is usually to edit the GRUB configuration file so the menu is shown for a set number of seconds. This article explains why the menu hides, how to make it visible again, and how to troubleshoot common problems.

Why GRUB Hides the Boot Menu

GRUB (Grand Unified Bootloader) is the software that loads when your computer starts, letting you choose between Ubuntu and any other operating systems installed. By default, Ubuntu sets GRUB_TIMEOUT_STYLE=hidden and GRUB_TIMEOUT=0 in /etc/default/grub. This makes the menu invisible and boots the default entry immediately. This is intentional for a smooth, fast startup, but it can be frustrating if you need to access recovery mode, a different kernel, or another OS.

How to Show the GRUB Menu Permanently

To make the menu appear every time, you need to edit the GRUB configuration file and then update GRUB. Here are the steps:

  1. Open a terminal (Ctrl+Alt+T).
  2. Edit the file with administrative privileges: sudo nano /etc/default/grub (or use gedit, vim, etc.).
  3. Change or add these lines:
    • GRUB_TIMEOUT_STYLE=menu (or comment it out with #)
    • GRUB_TIMEOUT=5 (or any number of seconds you want the menu to stay visible)
  4. Save the file and exit.
  5. Update GRUB with sudo update-grub.

After a reboot, the menu should appear for the specified time. If you set GRUB_TIMEOUT=-1, the menu will stay until you make a choice.

How to Show the Menu Only When Needed

If you prefer the menu to stay hidden but want to access it occasionally, you can keep the hidden style and hold Shift (for BIOS/Legacy) or press Esc (for UEFI) repeatedly right after the firmware splash screen. This is the default behavior and requires no configuration changes. However, it can be tricky if you miss the timing. Another option is to set GRUB_TIMEOUT_STYLE=menu but keep GRUB_TIMEOUT=0; this shows the menu only if you press a key during the brief window (often 1-2 seconds).

Common Problems and Fixes

Sometimes editing /etc/default/grub doesn’t work as expected. Here are common issues:

  • Menu still not showing: Check if you have a custom GRUB theme or another OS that overwrites the config. Run grep -v "^#" /etc/default/grub | grep -v "^$" to see active settings.
  • GRUB_TIMEOUT_STYLE not recognized: This option was introduced in GRUB 2.02. If you have an older version, use GRUB_HIDDEN_TIMEOUT=0 and GRUB_HIDDEN_TIMEOUT_QUIET=true instead.
  • Changes not applied: Always run sudo update-grub after editing. If you use a Btrfs or LVM setup, the command might need to be run from the installed system, not a live USB.
  • Windows not listed: If you dual-boot, run sudo os-prober to detect other OSes, then update GRUB again.

Advanced: Editing the GRUB Config Directly

If you prefer not to use update-grub, you can edit /boot/grub/grub.cfg directly. However, this file is auto-generated and any changes will be overwritten when the system updates. It’s better to use /etc/default/grub and the scripts in /etc/grub.d/. For a one-off boot, you can press e on the GRUB menu (if visible) to edit the boot entry temporarily.

How to Recover if You Can’t Boot

If the menu is hidden and you need to boot into recovery mode but can’t get the menu to show, use the Shift or Esc trick. If that fails, boot from a live USB, mount your root partition, and edit /etc/default/grub from there. Then run sudo update-grub with the root partition mounted (use chroot if needed). This is a reliable fallback when the system won’t boot normally.

Frequently Asked Questions

How do I make GRUB menu appear every time in Ubuntu?

Edit /etc/default/grub to set GRUB_TIMEOUT_STYLE=menu and GRUB_TIMEOUT=5 (or any number), then run sudo update-grub.

What if I want to boot directly to Windows?

You can set the default boot entry to Windows by changing GRUB_DEFAULT in the same file. For example, GRUB_DEFAULT="Windows Boot Manager" (use sudo grep menuentry /boot/grub/grub.cfg to see exact names).

Why doesn’t holding Shift work on my UEFI system?

On UEFI systems, the key is usually Esc, and you need to press it repeatedly right after the firmware logo disappears. Some systems have a fast boot option that skips GRUB entirely; disable that in the firmware settings.

Can I set GRUB timeout to 0 and still see the menu?

Yes, but only if you press a key during the brief moment GRUB is active. Set GRUB_TIMEOUT_STYLE=menu and GRUB_TIMEOUT=0. This is a common compromise.

Does changing GRUB settings affect system updates?

No, but system updates may overwrite grub.cfg. Your /etc/default/grub settings are preserved, so after an update, the menu will still behave as you configured.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →