- Hack Your Life! - http://www.hackourlife.com -

Change Default Boot Order for Grub 2 in Ubuntu 11.10 Oneiric Ocelot

Ubuntus 11.10 use Grub2. This post discusses the procedure to change the default boot choice for Grub for multi OS setting. If you want to make Windows to boot automatically by default, read on.

With Grub 2 you can no longer edit grub.conf or menu.lst files located in /boot/grub folder. The file to be edited is now “grub” located in /etc/default/ folder, you can edit it by running the following command from terminal (sudo gedit /etc/default/grub). The contents would look like this:

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

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

# Uncomment to disable graphical terminal (grub-pc only)

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)

# Uncomment to disable graphical terminal (grub-pc only)

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo’

# Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux

# Uncomment to disable generation of recovery mode menu entrys

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=”480 440 1″

To change the default boot option, you just need to change the GRUB_DEFAULT parameter. 0 refers to the first entry, so if you want windows to be your default boot option which is, say at, 5th position in the grub menu (see screenshot below)

then you just need to change the GRUB_DEFAULT value to 4 and save the file and close it. If you want to change the Auto Boot preset time then you would need to change the value of GRUB_TIMEOUT parameter, it should be assigned a value in seconds and would determine the delay in seconds before grub boots the default choice, automatically. Now from the terminal run following command and your grub default boot order would be changed when you boot the next time:

sudo update-grub

GUI Approach

Just install the startup manager by using synaptic or running the following command

sudo apt-get install startupmanager

Now launch it by typing following at command line

sudo startupmanager

and you can change the boot order using graphical interface by selecting your choice from the drop-down menu

On reboot Windows 7 should be the default choice and should boot automatically