≡ Menu

How to Change GRUB Splash Image, Background, Font Color on Your Linux

On Debian Lenny (and previous versions of Debian), you might have got tired of seeing a blue box with black background for GRUB when the Linux was booting up. But starting from Debian Squeeze, GRUB adds a background image which looks good (better than the boring background colors).

This article explains how to change the GRUB background image. The steps mentioned below were tested on Debian Squeeze with grub-1.98. But these steps should also work on other similar Linux distros.

Choosing a GRUB Background Image

GRUB 2 can use PNG, JPG/JPEG and TGA images for the background. The image must meet the following specifications:

  • JPG/JPEG images must be 8-bit (256 color)
  • Images should be non-indexed, RGB

By default, if desktop-base package is installed, images conforming to the above specification will be located in /usr/share/images/desktop-base/ directory.

Order of Search for GRUB Splash Images

In grub-1.98, the splash image to be displayed will be searched in the following order.

  1. GRUB_BACKGROUND line in /etc/default/grub
  2. First image found in /boot/grub/ ( more images found, it will be taken alphanumerically )
  3. The image specified in /usr/share/desktop-base/grub_background.sh
  4. The file listed in the WALLPAPER line in /etc/grub.d/05_debian_theme

So you can use any of the above in the order of priority to make GRUB display your own images. The following is the content of /etc/default/grub file on my system.

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

GRUB_BACKGROUND="/usr/share/images/desktop-base/moreblue-orbit-splash.png"

Once changes has been done using any of the above methods, make sure you execute update-grub command as shown below.

# update-grub
Generating grub.cfg ...
Found background: /usr/share/images/desktop-base/moreblue-orbit-splash.png
Found background image: /usr/share/images/desktop-base/moreblue-orbit-splash.png
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
done

Now, when you boot your machine, you will see the customized image in GRUB.

Talking about GRUB, you also might want to password protect your GRUB as we discussed earlier.

Change GRUB Front and Menu Colors

Now we have placed our own image in GRUB. But it will still display the menu and its entries in the default color.

The following are the 3 main GRUB color setting that you can change.

  • menu_color_highlight => The color of the highlighted menu entry and its background within the menu box
  • menu_color_normal => The color of non-selected menu entry and its background within the menu box
  • color_normal => The color of text and background outside the menu box

The syntax for specifying the color is as follows:

menu_color_highlight=fg-color/bg-color

The following colors are supported by grub:

black
blue
brown
cyan
dark-gray
green
light-cyan
light-blue
light-green
light-gray
light-magenta
light-red
magenta
red
white
yellow

Now to change the colors, open “/etc/grub.d/05_debian_theme” and find the following line:

        if [ -z "${2}" ] && [ -z "${3}" ]; then
                echo "  true"
        fi

and, replace them with the following:

if [ -z "${2}" ] && [ -z "${3}" ]; then
    # echo "  true"
    echo "    set color_highlight=red/green"
    echo "    set color_normal=light-cyan/black"
fi

Don’t change the “black” present in color_normal. If changed, the image will not be transparent in the area where the menu is displayed.

After this change, execute “update-grub”, and reboot your system. You will notice the change in the font colors displayed. After making the above mentioned changes on my system, the GRUB screen looked like the following:

Experiment with GRUB Colors

When you are not sure of what colors to choose, and you would like to experiment, then you can do it from the grub command-line itself.

  1. When the grub menu appears, press any key to stop the countdown
  2. Press ‘C’ to get into GRUB command line, and experiment as you wish
  3. grub> set color_highlight=red/green
    grub> set color_normal=light-cyan/black
  4. Now press “ESC”, to see the effect of your changes. If not satisfied, follow the steps once again and try different combinations.
Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • Pierre B. October 3, 2012, 9:36 am

    Thank you for this .

    I must confess i’d be more interested of finding out why i do have to boot first on my dvd-drive in order to get grub2 to load itself correctly ….

    If anyone have a clue, feel free to help me.

  • Lakshmanan Ganapathy October 3, 2012, 10:38 am

    Can you elaborate a bit on what’s your issue? I’m not getting it.

  • Jalal Hajigholamali October 4, 2012, 4:39 am

    Hi,

    Thanks a lot,
    very nice article..

  • Rajesh Kumar V October 4, 2012, 10:40 am

    Hi team,

    First i want to say thanks a lot for the valuable information.

    with this article i learned that GRUB can be password protected.

    Keep Rocking.

    Thanks
    Rajesh Kumar V

  • Tanmay October 5, 2012, 5:05 am

    Very nice article. I have a quick question. So instead of changing lines in default theme files, how can we create our own theme file, and ask grub to use that!?

    Thanks,
    Tanmay

  • Luke October 7, 2012, 9:18 pm

    How do you use grub rescue?

  • Karthigayan October 8, 2012, 6:06 am

    Good one.Thanks .

  • nami October 10, 2012, 1:31 pm

    thank you, but how can i find a 8 bit and non index image from internet ?

  • mishael September 28, 2014, 2:29 am

    Hi
    I read your page,I have some questions about boot logo.
    My OS is Debian 6,Squeezy.
    My boot logo is Inactive ,and I want to active it and make my logo when debain boot , my logo shown instead of text that shown.
    I do somethings but until now cannot find any solution for this Situation, I have no errors.
    please help me.
    thanks
    have good time

  • Bocskai Csaba January 4, 2015, 6:37 am

    Thanks a lot for the helpful info.
    Before reading this I couldn’t set menu text color when using background image.
    Now it’s all set.

  • Anonymous April 1, 2015, 4:55 pm

    I think you should use update-grub2 instead of update-grub…

  • KAPIL KOHLI April 4, 2015, 11:28 pm

    A well written article. Excellent information. I am relatively new to Linux and this is very helpful. People like me who wish to switch over from a Windows environment to a Linux environment survive on information such as this. Thank you for the inputs !!

  • mark June 11, 2015, 12:16 pm

    It was useful for me thanks 😀

  • Alan Kuriakose August 8, 2015, 12:54 am

    Most of the poeple may be able to open the file specified, but impossible to save the changes made. To solve this porblem, open terminal and type the command

    gksudo gedit

    eg:-
    gksudo gedit /etc/default/grub
    is used to open default the file “grub” in gedit in editable format.
    caution:- Any unnecessary or wrong changes made to above file can make your system unbootable.

  • liu liu March 15, 2017, 6:59 pm

    great
    thanks!