How to change Grub2 splash images

These days I have been experimenting a lot with Grub2, its amazing. It far more flexible, dynamic and powerful than the old grub legacy. You might not know that grub2 was actually developed from scratch, its not a patch for grub legacy and the developers sure did a great job. In this article, I will tell you how to change the grub2-menu look: background, fonts nd a lot more , and the best part is its really easy!! .

The steps that I am going to mention are performed on Ubuntu 9.10, Karmic Koala, but the method is applicable on all the distros with grub2 as the bootloader. I have explained alternative solution for non-ubuntu distros if there is an exception.

Download the grub2 splash images package

I believe this package is only available for Ubuntu and Debian(I may be wrong) but other linuxers shouldn't get disappointed coz the best part of being a linuxer is that there is always a way around the problems :). Actually here its not even a problem, this package its just a bunch of some images(in xga image formats) . You can select any image you wish to be your grub splash image, read the end of this article to find about the right method to do so.

Change the splash images

But for the time being we will consider the images available in this package. Run this command to download the images.

[shredder12]$ sudo apt-get install grub2-splashimages

This will download the splash images in the folder /usr/share/images/grub/.

Now, we need to edit the file /etc/grub.d/05_debian_theme. Open it in any editor as root.

[root]$ gedit /etc/grub.d/05_debian_theme

Look for a line similar to the following

for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; do

If you haven't edited this file before then this line should be somewhere around the 16th line. The above line means that search for the image "moreblue-orbit-grub.png/.tga." in

/boot/grub
/usr/share/images/desktop-base

Since our files are in the folder /usr/share/images/grub we will select an image from the collection and modify this line to edit the file. There will be the following modifications.

  • We will replace "moreblue-orbit-grub." with our file name say "image.", make sure that you type the "." after the file name.
  • We will add /usr/share/image/grub in the folder's list.

These modification will make sure that now the image we have mentioned is looked in its folder /usr/share/images/grub.

Now, update the grub. Run the following command.

[root]$ grub-mkconfig -o /boot/grub/grub.cfg

or, ubuntu users may just run

[shredder12]$ sudo update-grub

the output of this grub update will look something like this.

Updating /boot/grub/grub.cfg ...
Found Debian background: image.tga
Found linux image: /boot/vmlinuz-2.6.27-7-generic
Found initrd image: /boot/initrd.img-2.6.27-7-generic
Found memtest86+ image: /boot/memtest86+.bin
done

Now, reboot and you will see a new and cooler looking grub menu .

P.S. In this above example I have used the images in the grub2-splashimages package so there is no issue with resolution or image format. If you want to use a custom image then continue reading to do it properly.

Change the Grub Menu Fonts

Open the file 05_debian_theme as root and look for the lines similar to the following.

set color_normal=black/black
set color_highlight=magenta/black

In a default 05_debian_theme file these lines will somewhere around 39-40th line. Let us understand the terminology used.

Please note that, the first black in colour_normal denotes the font colour and the other black denotes the background colour. Here black doesn't mean that you screen will be filled with black colour, it means that the screen will be blank (a blank screen is black), no background.

The magenta in colour_highlight denotes the changed font colour and black denotes the menu entry background when the menu entry gets highlighted.

Consider the following config.

set colour_normal = white/black
set colour_highlight = green/yellow

I will be using this configuartion with the a blue background image as the grub splash screen and the grub2 finally looks like this.

P.S.- Please make sure that when you are using a background image keep the background colour ie. the 2nd entry in colour_normal to be black(blank screen) otherwise some other background colour will just ruin the pic.

Following is the list of different colours that we can use.

Colours that are we can use are black (blank/transparent), dark-gray, light-gray, white, brown, yellow, red, light-red, blue, light-blue, green, light-green, cyan, light-cyan, magenta, light-magenta.

Change the default resolution

The default resolution of Grub2 is 640 x 480. So, if you are using high resolution image then some of its parts might not get showed in the screen, they will get cut off. But you can easily change the default resolution. Open the file /etc/default/grub

[root]$ gedit  /etc/default/grub

and, look for this line

#GRUB_GFXMODE=640x480

Remove the hash and fill in resolution of your choice.

Update grub and you are all set to go.

[root]$ grub-mkconfig -o /boot/grub/grub.cfg

How to change any other image into the appropriate format

This can be easily done using GIMP (GNU image manipulation program). All you have to do is open the image in GIMP and then save the image as .tga or .png and then you can use it as splash images.

So, isn't grub2 great !! You can do so many things. If you know some more cool stuffs that can be done in grub2, please leave them as a comment. I would love to add them here.

8 Comments

Linuxer anònim (not verified)
December 4th, 2009 02:18 am
Hi! Thanks for the article. I found it very useful. BTW. I think there's a copy&paste typo: set colour_normal = green/yellow should be: set color_highlight = green/yellow Take care.
December 4th, 2009 02:59 am

Ya, thanks for pointing it out.. it should be set color_highlight .. a small typo ;)

Eruaran (not verified)
December 6th, 2009 08:34 am
Doesn´t work.
December 8th, 2009 02:31 pm

I will probably need some more info to help you out.

gen7ux (not verified)
December 18th, 2009 08:27 am
if it isn't working then recheck the path, eg line 16 should read for example: for i in {/boot/grub,/usr/share/images/desktop-base,/usr/share/images/grub}/BonsaiTridentMaple.{png,tga} ; do please note the 's' at the end of 'images' ie not 'image' shredder12 wrote: .We will add /usr/share/image/grub in the folder's list. this is the most likely source of the error in the otherwise excellent description of how to modify grub2.
gen7ux (not verified)
December 18th, 2009 08:33 am
damn, i forgot to say thanks shredder12.
Anon Linuxer (not verified)
December 24th, 2009 12:47 pm
Thanks for the tricks ... I know this isn't a "theme" question, but how about setting the default kernel selection? For example if you had multiple kernel images installed, the newer ones experimental, but you wanted an older kernel, lower down on the list, as the default....
December 24th, 2009 09:08 pm

You can do it by setting the value of the variable GRUB_DEFAULT in the /etc/default/grub. Use the exact menu entry as the value of GRUB_DEFAULT eg GRUB_DEFAULT="Ubunu, Linux 2.6.31-14-generic". Run update-grub and on boot your selected menu entry will be booted as default.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.