Tag/tag.png

Unsupported Version
This article applies to an unsupported version of Ubuntu. More info...

Changing Default OS

Use this guide if you have multiple partitions and operating systems on your computer and want to change the default operating system that will boot up when you turn on your computer. This guide applies only to systems using grub (aka grub legacy, where menu.lst exists) and not grub-pc (aka grub2, where menu.lst doesn't exist).

The StartUpManager can be used as a graphical alternative to the method described here.

Back Up Grub Settings

Copy this line into the terminal and press enter, it will back up your menu.lst and you can use the backup to restore your default settings.

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup

Open in a Text Editor

Edit the menu.lst file with one of the following commands (depending on what version of Ubuntu you're using):

Ubuntu

gksudo gedit /boot/grub/menu.lst

Kubuntu

kdesu kate /boot/grub/menu.lst

Xubuntu

gksudo mousepad /boot/grub/menu.lst

Finding the Line

  • Find this line in the document that was just opened, it will read like this:

## 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.
...
default     0
...
  • Replace the 0 with the number on the startup list corresponding to the option you want, counting from 0. For example, if you have a list like this one and want to change to Windows XP Home:

title      Ubuntu, kernel 2.6.15-27-amd64-generic
...
title      Ubuntu, memtest86+
...
title      Other operating systems:
...
title      Microsoft Windows XP Home

...you would change the number to 3. It is important to note that each lines such as "Other Operating Systems" should be counted as well.

  • Alternatively you can replace the number with the word 'saved' which will make the default whichever entry was last used. Each entry that should be remembered must have the 'savedefault' keyword, this is the case for the normal Ubuntu entries, but not the recovery alternatives. 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.

  • Save the edited file

Comments

  • Warbo: How does this handle Ubuntu's adding of new kernels to the list? If I remember correctly any new kernels get added to the top of the list, so this would change the order of the entries and make any "default X" line point to the wrong entry. I have always told people to put the non-Ubuntu OS which they would prefer to be default (eg. Windows, Fedora, whatever) above the "Automagic kernels" comment, thus making any of Ubuntu's automatic changes take place below the prefered entry, meaning it is always at the top so is always entry 0. Also, I know there are GRUB lines which can be added which make the last selected OS the default, but I have forgotten them Smile :)

  • PatrickSchulz: Warbo, Ubuntu / update-grub adds the new kernel entries at the top of the lines between

    ...
    ### BEGIN AUTOMATIC KERNELS LIST
    ...
    ### END DEBIAN AUTOMATIC KERNELS LIST
    ...
    Just put the entry for your preferred OS between these lines...
    #
    # Put static boot stanzas before and/or after AUTOMATIC KERNEL LIST
     ... exactly here ...
    ### BEGIN AUTOMATIC KERNELS LIST
  • ..and leave the default parameter at
    ...
    default     0
    ...
    That's it.

Warbo: Yes, that's what I have been telling people to do ("put the non-Ubuntu OS which they would prefer to be default... above the "Automagic kernels" comment"). This is not something I do myself, because I only run Ubuntu and don't apply kernel updates (if you want to see how messed up my boot setup is then look at BootFromUSB Smile :) )

PatrickSchulz: Ooops! I just read the "...selected OS the default, but I have forgotten them :)". Sorry mea culpa... Next time I drop the tomatoes from my eyes before posting Wink ;-)

Ateo: My menu.lst has the comment

 ### BEGIN AUTOMAGIC KERNELS LIST

and not

 ### BEGIN AUTOMATIC KERNELS LIST

A very subtle type that had me searching for about 10 minutes.

Kevin Valentine: I was just forwarding this link to a grub newbie because he wants to make Windows his default boot entry. It's normally the last entry. Instead of having him cut and paste large chunks of text around, I told to additionally set updatedefaultentry=true. The default value is automagically updated when new kernels are added.

  • Artemy: I think the simple way to change the default OS to load will be using "Start-Up Manager" - just select the desired choice in the combo-box "Default operating system"


How to change the default boot order in Ubuntu 10.10:

Step 1) Open a terminal window. ...

  • 2) cd /etc/grub.d

...

  • 3) ls -l

...

  • 4) Notice that there are approximately eight shell files with names that start with a number. These scripts get executed in numerical order.

...

  • 5) sudo mv 30_os-prober 06_os-prober

...

  • This is going to move any non-Linux OS to the top of the list.

...

  • 6) Optional Step: cd /etc/default

...

  • 7) Optional Step: sudo gedit grub

...

  • 8) Optional Step: Look for the string "quiet splash". Change to "splash".

...

  • 9) Optional Step: sudo update-grub

...

  • Removing "quiet" will allow you to see what's happening during boot.

...

  • 10) cd /boot/grub

...

  • 11) sudo mv grub.cfg grubOLD.cfg

...

  • 12) sudo grub-mkconfig -o grub.cfg

...

  • 13) Optional step: gedit grub.cfg

...

  • Examine grub.cfg to be sure non-Lixux OS is at the top of the list.

...

  • 14) Restart Linux to test your work.

...

  • If you have problems rebooting, you can always reboot in recovery mode, and rename grubOLD.cfg to grub.cfg.

...

  • Doug Witmer

GrubHowto/ChangeDefaultOS (last edited 2017-09-03 15:58:02 by ckimes)