We have seen before a simple application for changing the default OS at boot, you can check it here. In this guide we will see how to edit manually the Grub 2 boot loader configuration file to change the default OS you want to boot first.

Before we start this guide, you need first to know the number assigned to your default OS from the Grub 2 boot menu. To do this, restart your computer and hold down the Shift key to bring up the boot screen. It will be something like this:

The first line will be assigned a value, the second will be 1 and so on. So In our example we will make Windows 7 as the default OS at boot which is assigned the number 4.

Getting Started

1. Under Ubuntu (11.10/11.04/10.10), open the terminal (Ctrl-Alt-T) and run this command to edit the Grub config file:

sudo gedit /etc/default/grub

2. Locate now this line:


3. The "0" value means the boot loader will boot from the first OS displayed in the Grub boot menu. For our example, we need to change it to 4 so that it boots by default into Windows 7. The code will be like this:


4. Save your file and exit, then run this command to update your Grub boot loader:

sudo update-grub

5. Reboot now your computer to see the difference. The system will now boot by default into Windows 7 for our example.

That's it!

Post a Comment