How do I set Windows to boot as the default in grub

How do I set grub so that in my dualboot with Windows and Ubuntu Linux.
The two ways are:

  • Boot which ever operating system you booted last time, the “saved method”
    This is the one I use. It lets me decide which one I going to use and will allow me to reboot into that system, handy when I’m updating.
  • Boot a specific operating system by default.
    The answer to your exact question.


Finding the menuentry to set as the new default
grep menuentry /boot/grub/grub.cfg
Editing the /etc/default/grub file
Type in the terminal sudo nano -B /etc/default/grub and your password if asked. The nano editor will open.
A. Saved method – In my preferred way, I made the following changes from the standard grub file.
I changed the value of GRUB_DEFAULT to saved:
GRUB_DEFAULT=saved
I enabled the SAVEDEFAULT functionality by adding the following line:
GRUB_SAVEDEFAULT=true
B. Specific menuentry – In the way you are asking for
Change the value of GRUB_DEFAULT to the name of the Windows system you want to always boot. The name of the corresponding Grub menuentry can be found as described in the previous section.
I wanted to have Window XP always set as default at boot, I would set GRUB_DEFAULT to “Windows NT/2000/XP (loader) (on /dev/sda1)”:
GRUB_DEFAULT="Windows NT/2000/XP (loader) (on /dev/sda1)"
You could also set GRUB_DEFAULT to the line number in the menu entry list (with 0 being the first), but when the kernel in Ubuntu is updated grub adds the new kernel to the top of the list, you would have to change the number, since Windows is the last one in the menu entry list. You can see this in my menu entry list.
Update the boot configuration
Now you have to run update-grub to update the system generated grub.cfg file in the /boot/grub/ directory.
Type into your terminal sudo update-grub and your password if asked.
Done.