Edit default grub option

If you install Ubuntu as a traditional dual-boot with Windows, Ubuntu will make itself the default operating system to boot up (you get a few seconds to switch to Windows with the arrow keys). If you would like to change the boot order, you can do so by editing the Grub boot menu.

Before you edit the appropriate file to change the boot order, notice first the current boot order as it appears when you first boot up your computer. It will probably look something like this.

Ubuntu, with Linux 3.2.0-23-generic-pae
Ubuntu, with Linux 3.2.0-23-generic-pae (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
Windows 7 (loader) (on /dev/sda1)

Numbering for Grub starts at 0 instead of 1. So, in this case, Ubuntu is the 0th entry, recovery mode is 1st, the first memtest is 2nd, the second memtest is 3rd, and Windows 7 is 4th.

Open the terminal and edit /etc/default/grub

sudo vim /etc/default/grub

You should notice GRUB_DEFAULT=0 (which means Ubuntu is the default boot entry, as it is the 0th entry). If you want Windows to boot first and if Windows is the 4th entry (assuming numbering starts at 0), change it to GRUB_DEFAULT=4 Save the file, exit out of the text editor and update grub with the command

sudo update-grub

The next time you reboot, Windows should be the default operating system!

Note: There used to be a graphical program for this called Startup Manager. It no longer appears to exist for Ubuntu 12.04, and it was a bit buggy in 11.10, but if you're using Ubuntu 11.04 or 10.04, you may have some luck with it.

Enter your comment:
189 +7 = 
  • linux/grub/edit_default.txt
  • Last modified: 2019-10-31 09:05
  • (external edit)