Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know how I can change the default selected option on the GNU GRUB dual boot screen displayed on system start-up.

I have a Windows 7 and Ubuntu dual boot PC. Currently there is a countdown timer that auto boots into Ubuntu if the time runs out. This is quite annoying since I use Ubuntu seldom.

I do not want to select Windows 7 every time. How can I change the default to Windows 7? See image below of dual boot screen.

enter image description here

share|improve this question
up vote 3 down vote accepted

Fire up a terminal and first type:

 fgrep menuentry /boot/grub/grub.cfg 

This lists all the bootable operating systems on your machine. Now copy the entry you want to be default which is in your case Windows 7 (loader) (on /dev/sda1). Note I have assumed it is the sda1 partition, if not please copy Windows 7 (loader) (on /dev/sda2). Copying in the terminal can be done by Shift+Ctrl+C.

Now, type:

sudo gedit /etc/default/grub

Now, find the line which says GRUB_DEFAULT=0 and replace it with GRUB_DEFAULT=Windows 7 (loader) (on /dev/sda1) or /sda2 if that is the case.

Close gedit and come back to the terminal and type:

sudo update-grub

That's it!

Note: The reason I gave such a long answer in contrast to davidgo's shorter answer is that when you do kernel updates, you'll have those older kernel versions in the lines below so X=5 might mean Windows now but some Ubuntu version later. This ensures no more tinkering even with kernel updates.


share|improve this answer

Under Linux, edit /boot/grub/menu.lst and add / change the line which says "default X" - where X is the option you want to boot by default, so at a guess, X=5 or 6 for you.

Alternatively you can reorder the blocks in this file so the Windows one you want is first in the list.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.