Thursday, July 23, 2009

Change the default OS after installing Ubuntu

if you have installed Ubuntu you will notice that the default OS in booting is Ubuntu Kernel
so if you want to change the default OS, it is so easy just follow these steps.

what we will do that we will open a text file called menu.lst and edit some lines in it so it is recommended to make a backup from that file first then we will edit what we want in that file

First: (backup)
so to make a backup (copy) from menu.lst before editing using the following command
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup

this command made a copy from this file and rename it to menu.lst_backup

Second: (open menu.lst in the Text Editor)

open terminal and than write this command
sudo gedit /boot/grub/menu.lst 


enter your password and then it should open like this












find this line
#
# 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

...

default 0 means that the default OS is number 0 order in the following lines, it is in your case "Ubuntu"

to change the default you have two options
1- point the default to the OS you want to be the default
2- reorder text lines so that your default OS will be in 0 order

to do this find this lines in the text file you opend

title      Ubuntu 8.04.3 LTS, kernel 2.6.24-24-generic
...
title Ubuntu, memtest86+
...
title Other operating systems:
...

title Microsoft Windows XP Home
every title take an order from 0, so in the case above Ubuntu 8.04 is number 0
and Microsoft Windows XP is number 3

using first option
you just change defult 0 to the number of your OS and in this case is 3
defult 3

you now just finished you can save and close the file
but as you see the first option is too easy but i did not recommended it because
adds a new kernels to the list(i.e: after update) and in the top of list so your default OS will not be in order 3

to solve this problem you can just do the second option

using second option
just cut lines about your preferred OS and paste before this line
### BEGIN AUTOMATIC KERNELS LIST

and leave default 0

ok thats all you can now restart and see the changes you made