This guide assumes that you have already installed Windows and Ubuntu and would now like to tell Ubuntu's default boot loader, grub, to boot Windows instead of Ubuntu by default. Doing so is simply a matter of switching a number in grub's configuration file. Follow these instructions to do it:
- Startup Ubuntu as usual
- Press Alt-F2 (i.e., depress 'Alt' and, without releasing it, press 'F2') for a 'Run Application' dialogue box
- Type 'gksudo gedit /boot/grub/menu.lst' (without the quotation marks)
- When prompted, enter your password. See "Ubuntu Root Access" if you have trouble at this point. You will then be presented with a GEdit window in which the configuration file for grub is reflected.
- Around the 14th line of the file, you will see the entry "default 0".
## default num
[several lines beginning with '#' are here omitted for sake of brevity]
default 0Changing the number determines which line in the boot menu gets started by default. To figure out which one you want, you must go to the end of the file (Ctrl-End), where the menu options are listed. Do not be put off by the technical appearance of what you see. From zero (or 'null'), count the number of "title" entries at the end of this file (after the line which reads "End Default Options"). For sure, there will be two entries for Ubuntu (one for the regular boot process and one for the recovery or rescue process) and one for the memory test module, if it is installed. After the memory test module, your Windows installation should be listed and the position of it in the menu sequence is the number you need to put next to the "default" line at the head of the file.
If you find this confusing, do not fret. Let's take an example. We have Ubuntu installed and the memory testing module. This gives us the following three entries in the menu:
title Ubuntu, kernel 2.6.15-26-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.15-26-386
savedefault
boot
title Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.15-26-386
boot
title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
bootAfter this, we will have a Windows installation listed:
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1So, counting from zero or null, Windows is the third entry.
- Armed with that knowledge, we go back to top of the file and enter "3" into the configuration file.
## default num
[several lines beginning with '#' are here omitted for sake of brevity]
default 3 - Save the file
- Close the application
When you next boot your computer, grub will default to Windows. If it does not, follow the above instructions again and verify the count.