Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Set Windows as Default OS when Dual Booting Ubuntu

When you install a dual-boot of Ubuntu, one of the frustrating things that you'll immediately notice is that Ubuntu is now set as the default operating system in the Grub loader. There's an easy way to switch back to using Windows as the default.

To make this change, you'll first have to boot into Ubuntu, and then run the following command:

sudo gedit /boot/grub/menu.lst

Find this section of the file:

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

The important line is the last one. You will need to change that number 0 to match the Windows boot section. Typically it's always going to be 4 on a default dual-boot configuration. Change this value to 4, and then save and reboot your machine. You should go into Windows instead of Ubuntu automatically.

Note: The blocks at the bottom of the file match the items in the menu. You can change this value to match whichever item you want as default, just remember that numbering starts at 0.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 01/7/07 and tagged with: Ubuntu, Windows, Ubuntu Tips & Tweaks

Comments (16)

  1. domagoj

    All I needed, thank you!

  2. Nevis

    Funny, I'm struggling with the annoying sequence of Windows booting by default. :-)

  3. john

    hi there everyone. im new in linux and installed ubuntu.
    i just wanted to know what is the syntax of doing that command on how to change the default OS
    thanks

  4. john

    i already got it. thanks i just made a mistake in typing .lst.

  5. murali

    hi,
    I tried editing the file thourgh the file browser, but I couldnt open menu list file with write permission.
    even though i am the only user (owner)

  6. Neil Young

    Hi there…
    I am a newbie to Ubuntu / Kubuntu and linux completely. I've installed Ubuntu as dual boot to Windows XP. The installation went smoothly. I've Windows XP on a Sata HDD and I've install Ubuntu on a IDE (Sec. Master) HDD. In addition to this I've got two Data storage disks ie: 1X SATA HDD & 1X IDE HDD.

    My problem is that when I restart my PC and want to choose to load Windows XP I get a "NTDLR is missing" message and I've to restart. How do I solve this problem?

    Thank you in advance

    Regards
    Neil

  7. Matthew W

    Hi Neil,
    A quick search of ubuntuforums.org reveals that this problem can have several causes. Here is a link to the most common:

    http://ubuntuforums.org/showthread.php?t=450329

    I hope this helps.

    Matt

  8. Nospoon

    Murali - you have to open it via terminal, because normal users (yes, even the owner) do not have full permissions. Full permissions are granted only to root, and the simplest way to do things as root is to launch them with sudo.

  9. murali

    thanks nospoon. got it working a while back.

  10. Lauris Ancupans

    This helped me out. Thanks!

  11. Colin

    When I run the command it brings up a menu.Ist file in a text editor, but its blank and I can't edit anything.

  12. Dan L

    I went through dozens of websites and this is the only and first one that clearly explained how do fix this issue and it worked perfectly. Thanks a ton.

  13. HELP!

    Hello, please help me… I am super new to Linux… I installed Ubuntu on my PC and I am affraid that all of my files are gone. I used to run XP and now I can't find any of my files. Can anyone please tell me how to switch back to Windows just so that I can see my files again???
    Thank you so much,

    Mali

  14. rob

    same for me! can find winxp anymore

  15. fatih

    thanks a lot. very clear explanation. seconds i did it.

  16. Frank H

    Thanks for the response so quick. Works Fine


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.