Friday, January 14, 2011

How to set Windows as default OS on Ubuntu dual boot

When you install Ubuntu along side the Windows, (i.e. dual boot) you’ll notice that Ubuntu is set as default OS on the GRUB loader. You can set Windows as default OS by changing the default value in Ubuntu’s Grub configuration file. First you’ve to open the Terminal on Ubuntu (Applications --> Accessories --> Terminal), and then run this command, 

sudo gedit /boot/grub/grub.cfg


Now you’ll get a configuration file. Around the 13th line, you can see an entry default=”0”.


Here the value “0” represents the 1st entry i.e. Ubuntu. Usually Windows is the 5th entry in grub configuration file. So its value becomes “4”, because counting starts from 0. Now change the number “0” to “4” and save the file (Ctrl+S).


But be careful when editing the above file. Making any mistakes would result in Grub failure. So do not make any other changes on Grub configuration file. Then restart your system. Now you can see that Windows is selected as default OS instead of Ubuntu.

Note: Please note that the value 4 only works when your system has only two operating systems i.e. Windows and Ubuntu. Value of any OS depends on the number of entries on the Grub. If you have more operating systems, then the value of Windows may change. You can know the value of Windows by counting the number of entries on the grub configuration file. Here is an easiest way to know the value of Windows on the grub. When you start your system, look at the position of Windows on grub loader. If it is the 6th one, then the value of Windows becomes 5, because counting starts from 0. That means the value of 6th entry is 5.

There are some other solutions to set the default OS for those who finds it’s difficult to edit the grub file. There is an application called “Startup manager” in which you can set Windows as default using mouse. This is the safest way to change the default OS, but it needs internet connection. If you have internet connection, then run the following command on Terminal to install “Startup manager”.

sudo apt-get install startupmanager

After the successful installation, you’ll find “Startup manager” on System --> Administration --> Startup manager. Now you can set Windows as default OS on few clicks with “Startup manager”!

(Alternately there is another application called “Grub choose default” to change the default OS. You can install it by running  
sudo apt-get install grub-choose-default on terminal)


-Prasanna SP

3 Comments:

ದುರಹಂಕಾರಿ said...
This comment has been removed by the author.
ದುರಹಂಕಾರಿ said...
This comment has been removed by the author.
ದುರಹಂಕಾರಿ said...

First of all, had any body really bothered you for this particular post? If not, I would say its shame on your part to post this pro-windows article.

And this article also suggests that the user should not update his system to include newer versions of the kernel, for if he does it, once again 'his favorite' ms-windows will not be his default boot choice. the permanent solution is actually a small hack in the folder containing templates for grub, i.e., /etc/grub.d/ :). Read the README file over there to know the hack :).

Post a Comment