How to make Windows your default boot-able OS when dual booting

After installing Ubuntu along with Windows Ubuntu becomes the default boot-able Operating System. However You can make Windows the default boot-able OS .

To do this you have to follow the following Commands :

Step 1 .Boot with your Ubuntu OS

Step 2. Open up a terminal and write : $ cd /boot/grub

Step 3. You have to edit the grub.cfg File of this folder.So, give the grub.cfg File write permission by : $ sudo chmod 777 grub.cfg

It will ask for your password . Give the password of your User .

( For the previous Ubuntu versions the grub file’s name is “menu.lst”  , so in that case write : $ sudo chmod 777 menu.lst )

Step 4. Now open the grub.cfg file with an editor . Write on the terminal : $ gedit grub.cfg

( For previous versions write $ gedit menu.lst)

Step 5. In the opened file you will find the list or menus which are shown during  boot time .

Your task is to cut and paste  your Windows boot option lines before the Ubuntu boot option lines . Be very much careful while doing this .

You will get some lines like followings  :

### BEGIN /etc/grub.d/10_linux ###
menuentry “Ubuntu, Linux 2.6.31-14-generic” {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd0,9)
    search –no-floppy –fs-uuid –set 90da62be-64e5-47f2-bc2c-0d9a62acdd82
    linux    /boot/vmlinuz-2.6.31-14-generic root=UUID=90da62be-64e5-47f2-bc2c-0d9a62acdd82 ro   quiet splash
    initrd    /boot/initrd.img-2.6.31-14-generic
}
menuentry “Ubuntu, Linux 2.6.31-14-generic (recovery mode)” {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd0,9)
    search –no-floppy –fs-uuid –set 90da62be-64e5-47f2-bc2c-0d9a62acdd82
    linux    /boot/vmlinuz-2.6.31-14-generic root=UUID=90da62be-64e5-47f2-bc2c-0d9a62acdd82 ro single
    initrd    /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry “Memory test (memtest86+)” {
    linux16    /boot/memtest86+.bin
}
menuentry “Memory test (memtest86+, serial console 115200)” {
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry “Windows 7 (loader) (on /dev/sda1)” {
    insmod ntfs
    set root=(hd0,1)
    search –no-floppy –fs-uuid –set 88569ab2569aa08c
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

The Menu to boot Windows (See the Italic Fonts) is written at the last of the list , that is why you were getting Ubuntu as default boot option. So just cut the whole paragraph for windows boot option(paragraph surrounded by ( ### BEGIN /etc/grub.d/30_os-prober ###  to  ### END /etc/grub.d/30_os-prober ###)and paste it before ubuntu’s boot option .

You will get something like following :

### BEGIN /etc/grub.d/30_os-prober ###
menuentry “Windows 7 (loader) (on /dev/sda1)” {
    insmod ntfs
    set root=(hd0,1)
    search –no-floppy –fs-uuid –set 88569ab2569aa08c
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/10_linux ###
menuentry “Ubuntu, Linux 2.6.31-14-generic” {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd0,9)
    search –no-floppy –fs-uuid –set 90da62be-64e5-47f2-bc2c-0d9a62acdd82
    linux    /boot/vmlinuz-2.6.31-14-generic root=UUID=90da62be-64e5-47f2-bc2c-0d9a62acdd82 ro   quiet splash
    initrd    /boot/initrd.img-2.6.31-14-generic
}
menuentry “Ubuntu, Linux 2.6.31-14-generic (recovery mode)” {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd0,9)
    search –no-floppy –fs-uuid –set 90da62be-64e5-47f2-bc2c-0d9a62acdd82
    linux    /boot/vmlinuz-2.6.31-14-generic root=UUID=90da62be-64e5-47f2-bc2c-0d9a62acdd82 ro single
    initrd    /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry “Memory test (memtest86+)” {
    linux16    /boot/memtest86+.bin
}
menuentry “Memory test (memtest86+, serial console 115200)” {
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

(In case of previous versions do the same at menu.lst file)

Step 6. Save the file and restart your PC