Changing default OS in Ubuntu (GRUB)

I have a little Eee-PC that dual-boots Windows 7 and Ubuntu. GRUB takes care of dual booting nicely out of the box. Just one little thing. I want it to boot Windows 7 by default. Coming from a LILO background, I feel confused and not in control. Anyway, this is how to do it:

  $ grep menuentry /boot/grub/grub.cfg
  (some linux lines here...)
  menuentry "Windows 7 (loader) (on /dev/sda2)" {

That is the menuentry that we want to default to.

Now replace a 0 with the above menuentry in grub default file:

  GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"

Finally, run update-grub (as suggested in the above file):

  $ sudo update-grub

If everything went fine your Windows system will now boot as default. Also, when Ubuntu upgrades its kernel (and reconfigures grub), Windows should still be default.

  1. Sweet, this is just what I was looking around for! You just saved me alot of looking around time!

  2. Works for Ubuntu 11.04.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.