Normally, GRUB 2 uses the first entry on the boot menu to start by default. This is fine since most of the time Ubuntu adds the latest version of the kernel to the top of the list. This choice is controlled in the configuration file /etc/default/grub using the “GRUB DEFAULT” line which normally has the value “0″. “0″ is an index number for the first item in the boot menu.
If Windows is on the machine then it would quite often be “5″ but after a period of time as the kernel updates the list of entries in the GRUB2 boot menu grows. The entry for Windows will no longer be “5″.
It is possible to have GRUB automatically boot Windows by specifying the text line instead of the numeric index.
sudo gedit /etc/default/grub
I changed the “GRUB_DEFAULT” line to:
GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"
In my case I changed GRUB_DEFAULT to reflect the partition arrangement on my Acer netbook. The Windows partition is on the second partition on /dev/sda. I copied the line which refers to Windows exactly as it appears in /boot/grub/grub.cfg. There is a large amount of stuff in that file but the Windows line should appear after the “### BEGIN /etc/grub.d/30_os-prober ###” section but before “### END /etc/grub.d/30_os-prober ###”.
In my case it was:
menuentry "Windows 7 (loader) (on /dev/sda2)"
After making the change in /etc/default/grub you would need to save it and then update the GRUB configuration by executing the following:
sudo update-grub
As a self respecting Ubuntu user you may wonder why anyone would want to do this. In my case I have a new netbook with a chipset not fully supported yet. I have also set things up this way for Windows users who have allowed me to install Ubuntu for them to try out and use as a backup operating system.













