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
Ya, thanks for pointing it out.. it should be set color_highlight .. a small typo ;)
I will probably need some more info to help you out.
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