Unix (Linux and *BSD)

ID #1004

How can I create a background image for Grub?

Grub is used to select between two or more operating systems installed on your computer. Grub's default background is black with white text, but it is possible to choose the background image of your choice. This tutorial will go through the process of creating your grub background and having Grub to show it next time you start your computer.

Creating the background image

Use a simple logo or a graphic that looks good with very few colors ; don't use a photo, for instance. Launch your favorite tool to create your splash image and save it with only 14 colors and 640x480px. Here's how you can do so in Adobe Photoshop and in GimpShop: Go to "Image > Size" and then "Image > Mode > Indexed colors". Then save your image as PNG if you used Photoshop, or as XPM if you used GimpShop/The GIMP. If your image is in PNG, you'll have one more step to convert your image in XPM: Open your terminal and issue the following command that uses ImageMagick to convert your image:

$ convert splash.png -resize 640x480 -colors 14 splash.xpm

Now that you have your image indexed at 14 colors and resized to 640x480px in the XPM format, let's compress this splash image. Go back to your terminal and issue:

$ gzip splash.xpm

This will create a splash.xpm.gz file suitable for Grub. We now need to copy this file to the Grub directory. Let's do this now:

$ su -
(Type your root password)
# cp splash.xpm.gz /boot/grub/

Make sure your Grub background image is in the Grub directory:

# ls /boot/grub/splash*
/boot/grub/splash.xpm.gz

Configuring Grub to use the new image

Now we only need to ask Grub to use this background image. This is set in Grub's configuration file. Now open this file:

$ vi /boot/grub/menu.lst

And add the following line in the beginning of the Grub configuration file:

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

You need to change (hd0,0) according to the partition where Grub resides. If Grub is already set up, you will find out observing the configuration for your current system in this particular file; more information can be found in the Grub manual.

Save and reboot your computer. Grub should use your image as background now :)

Tags: -

Related entries:

Last update: 2006-09-10 03:10
Author: Charles A. Landemaine
Revision: 1.0

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 4.52 out of 5 (27 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment on this entry

Comment of chris wirawan:
hi, i have a question about where the grub resides. How can I check where it resides (hd0 or others)? and will it be fatal if I put the new image in other place? thank you
Added at: 2007-11-09 11:59