Changing GRUB Settings

GRUB's settings are controlled by the /boot/grub/menu.lst file. You can make changes to that file, to control how GRUB presents its boot-up options.

Setup

Before you begin, you should make a backup of the file, just in case you mess up.

$ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.bak

Then, once you've done that, you're ready to start editing the file itself.

$ sudo gedit /boot/grub/menu.lst

The following sections will give you some of the options you can change.

Default Operating System

By default, GRUB is set to load Ubuntu, unless you manually choose a different operating system. If you wish to change that, so that Windows loads first, find the line that says

default    0

You'll need to change the number from 0 to the number where the Windows option is located. Unfortunately, this might take some trial and error, until you get the right number; when I load my system, I get the following menu:

Ubuntu, kernel 2.6.20-16-generic
Ubuntu, kernel 2.6.20-16-generic (recovery mode)
Ubuntu, kernel 2.6.20-15-generic
Ubuntu, kernel 2.6.20-15-generic (recovery mode)
Ubuntu, memtest86+
Other operating systems:
Microsoft Windows XP Professional

So I had to set the number to 6. Why 6? Well, Windows XP is the seventh item to choose from — including the item which says “Other operating systems,” which does count — but the numbering starts at 0.

Note that Ubuntu sometimes updates the base version of Linux, and when it does, it introduces new menu items into GRUB's boot menu; when this happens, you'll have to go in and edit this file again, to update it with the new number at which your Windows XP operating system resides.

Setting the Timeout Value

The GRUB menu will wait for a little while, and then, if you don't choose anything, will choose the default menu item for you. You can change the amount of time that GRUB will wait, before choosing the default.

Find the line which reads:

timeout    10

This sets GRUB to wait 10 seconds, before choosing the default. You can change that 10 to however many seconds you'd like it to wait.

Hiding the GRUB Menu

If you don't wish the GRUB menu to show up, when you boot the computer, you can “hide” it. Find the line which says

#hiddenmenu

And remove the # character. (The # character means that this line is a “comment,” and is not to be read by the GRUB program when it's reading these settings. By “un-commenting” it, we are making this line active, so GRUB will now see hiddenmenu as a command.)

Pretty Colours

If you wish, you can change the colours that GRUB uses for its menu. Find the line which looks like this:

#color cyan/blue white/blue

First, uncomment the line, by deleting the # character.

There are actually four settings in here; the foreground and background colour for normal menu items, and the foreground and background colour for selected menu items. As specified above, normal menu items will be cyan with a blue background, and selected menu items will be white with a blue background.

You can get further information about what colours are allowed, and how to use them, at the GRUB manual page.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.