Grub2 – Set Windows as default OS in Dual Boot with Ubuntu
When you dual boot Ubuntu along Windows, you’ll notice that GRUB loader treats Ubuntu as it’s default booting option. If you are a regular Windows user, you may find this annoying. But wait, what if you can change it? Yes! You can change it with some simple tweaks in Ubuntu.
There are several methods to accomplish this. In this Tutorial, I’ll show you two often used methods.
Method 1: Using a Third Party Application
There is a graphical tool Grub-Customizer that helps you change boot order. It does not come pre-installed in Ubuntu, so you have to install it before using.
Before proceeding, make sure you are connected to the Internet. Now follow these steps –
1. Open Terminal (Hot Key: Ctrl+Alt+T) and type the following commands one by one:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
You may have to enter your root password after the first command.
NOTE: If you get any error “unable to locate package” after the first command, then follow these steps –
Open System Settings and Click on Softwares & Updates
On the window that opens, under the tab Ubuntu Software make sure all the Check Boxes are marked
Under the “Other Software” tab, mark all the boxes
Click Close. On the next window, click Reload
Wait until updating finishes.
2. After it is installed, launch Grub-Customizer by the following command in Terminal –
3. Once it starts, you’ll see something similar to this –
4. Select Windows entry and then use the up arrow button to take it to the Top position. Save and Exit.
Now Reboot and You’ll find Windows as the default choice for GRUB loader.
Method 2: Modifying the Configuration File
You can change the GRUB boot order by modifying the settings in the file /etc/default/grub.
1. Open Terminal (Hot Key: Ctrl+Alt+T) and type the following command –
A list of Menu entries from GRUB will appear –
Select the last entry, in the above case ‘Windows 7 (loader) (on /dev/sda1)’ and copy it (Do Not Forget the Quotes)
2. Now open the /etc/default/grub file. To do this, type the following command and hit enter-
sudo gedit /etc/default/grub
This will open the grub file gedit text editor.
3. Find out the line GRUB_DEFAULT=0.
4. Replace the 0 (zero) with the previously copied text from step 1.
5. Save and Exit
6. Update the grub settings by entering following command in the terminal –
7. Restart to see the effect
NOTE: I have used Ubuntu 14.04 LTS to demonstrate the above. If you are using any different version of Ubuntu, the above screenshots may vary.