Skip to content
Blog

How to Customize the GRUB Theme on Fedora

4 min read GRUB, Fedora, Linux

Why I’m writing this

I decided to change the GRUB theme on my Fedora machine. It took me tutorial after tutorial and a whopping 12 restarts to get it right. A lot of the guides out there are written for Ubuntu, and Fedora does a few things differently.

So this is the guide I wish I’d had, written mostly for future me. If it saves you eleven reboots, even better. ✈️

It should work on any recent Fedora (34 and newer), and on RHEL-based distros that use GRUB2 the same way.

What you’ll need

  • A GRUB theme. Gnome-Look has hundreds. If you want a safe starting point, vinceliuice/grub2-themes (Tela, Vimix, Stylish, WhiteSur) is well maintained.
  • A terminal and sudo access.
  • Patience. Follow the steps in order and don’t skip any. ⚠️

Before you start: back up your GRUB config

One command, and you can always get back to where you started:

sudo cp /etc/default/grub /etc/default/grub.bak

Step 0: try grub-customizer first

If you’d rather click than type, try grub-customizer first:

sudo dnf install grub-customizer

It works for plenty of people. If the theme still doesn’t show up when you boot, do it by hand. ⬇️

Step 1: download and install the theme

Download a theme and extract it. Most come as .tar.gz, .tar.xz or .zip:

cd ~/Downloads
tar -xf your-theme.tar.xz

Before you copy anything, look inside the extracted folder. The folder you copy must contain theme.txt directly. Archives often have an extra folder level (Theme/Theme/theme.txt), and GRUB won’t find the theme if you copy the wrong one.

ls ~/Downloads/your-theme
# you should see theme.txt, plus images and fonts

Now copy it into GRUB’s themes folder. Create the folder first if it doesn’t exist:

sudo mkdir -p /boot/grub2/themes
sudo cp -r ~/Downloads/your-theme /boot/grub2/themes/

Replace your-theme with the actual folder name.

Double-check the path. A typo or one folder level too many is the most common reason a theme doesn’t show up. ls /boot/grub2/themes/your-theme/theme.txt should print the file, not an error.

Step 2: edit /etc/default/grub

Open the config in your editor of choice:

sudo nano /etc/default/grub

Your file should look something like this:

GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT="saved"
GRUB_DISABLE_SUBMENU="true"
#GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG="true"
GRUB_GFXMODE="auto"

export GRUB_COLOR_NORMAL="light-gray/black"
export GRUB_COLOR_HIGHLIGHT="magenta/black"
GRUB_THEME="/boot/grub2/themes/<YOUR-THEME>/theme.txt"

The lines that matter:

  • GRUB_THEME: the full path to your theme’s theme.txt. Replace <YOUR-THEME> with your folder name.
  • GRUB_TERMINAL_OUTPUT="console": Fedora sets this by default, and it forces GRUB into plain text mode, so no theme can show. Comment it out with a # like above. This is the one most Ubuntu guides never mention.
  • GRUB_GFXMODE: optional. auto is fine. If the theme looks stretched or tiny, set your resolution, for example "1920x1080".
  • GRUB_TIMEOUT: how many seconds the menu stays up. With a nice theme, you’ll want to see it for a bit.

Save and exit (Ctrl + O, Enter, Ctrl + X in nano).

Step 3: regenerate grub.cfg

GRUB doesn’t read /etc/default/grub directly. You have to generate the real config from it:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

This is the right command for both BIOS and UEFI machines on Fedora 34 and newer.

🚫 Don’t run sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg. Plenty of older guides tell you to, but since Fedora 34 that file is a tiny stub that just points to /boot/grub2/grub.cfg. Overwriting it can leave you with a machine that doesn’t boot.

Step 4: make sure the menu actually shows

Fedora hides the GRUB menu when only one OS is installed and the last boot went fine. So your theme could be installed and you’d never see it. Turn that off:

sudo grub2-editenv - unset menu_auto_hide

Now reboot. 🎉

Troubleshooting

Still a plain text menu. GRUB_TERMINAL_OUTPUT="console" is probably still active. Comment it out and run the grub2-mkconfig command again.

The theme doesn’t load, and the menu looks like the default one. The path in GRUB_THEME is wrong, or theme.txt is one folder deeper than you think. Check with ls as in step 1.

The theme looks stretched, blurry or tiny. Set GRUB_GFXMODE to your screen’s resolution, then regenerate.

No menu at all, straight into Fedora. Run the menu_auto_hide command from step 4, or hold Shift (BIOS) or tap Esc (UEFI) while booting.

Going back to the default

Restore the backup from the start and regenerate:

sudo cp /etc/default/grub.bak /etc/default/grub
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

You can delete the theme folder from /boot/grub2/themes afterwards if you like.

That’s it 😎

It’s all about patience and getting the paths exactly right. If this saved you a few reboots, my mission here is accomplished. Happy theming!

Written by Anit Jha, a DevOps, tools and automation engineer at Apple. Found a mistake? Tell me on X or LinkedIn.

Keep reading

All posts