Friday, August 20, 2010

Use the Windows bootloader to boot Windows and Ubuntu

You find GRUB ugly right? Everyone does. It's supposed to be better and cleaner, but it is so restricted and hard to edit. I am here to the rescue! You can easily use the Windows bootloader to boot into Windows or Ubuntu, with no hassle.

I am using Windows Vista Home Premium, and I am sure it works with 7 as well. But still, I can't think why it won't work in Windows XP as well. In my case, I have Ubuntu 10.04 installed on a second partition, and both the operating systems are running properly.

The fix is pretty easy. You just go to this website when running Windows and download EasyBCD. It's a very small and useful app. When this article was written, the latest version was 2.0.2. Now, when the installation is done, run it the program. Now click the button on the left that says 'Bootloader Setup'. Here, under MBR Configuration Options, choose the relevant radio box, depending on which version of Windows you are using. Now click 'Write MBR'. After a few seconds, you're done.

Now, go to Add New Entry. Here, under Operating Systems, select the Linux/BSD tab. Now in the drop-down menu, choose 'GRUB 2' (don't worry, this will cause the GRUB menu to appear when you select this option, but we'll fix that in a minute) and name the option appropriately. Click 'Add Entry'.

Click the top button on the left, that says 'View Settings' and check if the two OSs are in the list. You may now close down EasyBCD and reboot your machine.

Now, if everything went well, you must get the Windows bootloader when you start the computer. You must see the two operating systems, as you named. But, the problem? When you choose your Linux option, you get the GRUB boot menu. You don't want that to happen. So let's change a little setting in Linux, so that the menu is not displayed at all and you boot directly to Linux when GRUB starts.

So, the effect will be this: You start the PC, you see the little splash screen (maybe not), and you see the Windows bootloader. You may choose Ubuntu or Windows and directly boot into it.

For this, we need to change the waiting countdown to 0 seconds for GRUB, so that you can boot directly into Ubuntu, when you choose it from the Windows bootloader.

In Ubuntu (10.04 in my case, as I mentioned earlier), first start Terminal (if you're a beginner, you can find it in Applications -> Accessories -> Terminal. Now, you need to run it as a 'root' user (which is similar to having an elevated window in Windows, except that this is a super elevated user). For this, type in the Terminal window:

sudo -i

Now, it will ask you your password. Type it in (don't worry, nothing's wrong, you won't see anything getting entered into the window and that's normal). Press Enter. Now you'll see 'root@[computer name]:~#' Type in:

cd /etc/default

Then, key in:

gedit grub

What we've done now is that you changed the directory in the Terminal to the folder '/etc/default' and you're now opening the text file 'grub' located there in the app called Gedit at root level. Now, when the text file is open in Gedit, change the line 'GRUB_TIMEOUT=10' to 'GRUB_TIMEOUT=0'.

This will cause the 10 seconds countdown in GRUB to become zero, and you'll boot into Linux as soon as GRUB starts.

Close the file, saving it. Now, in Terminal (open it again and get to 'root' level if you have closed it), type the command:


In a few seconds, the settings will be applied. Now, reboot the computer and see if everything works. You should be able to get into Windows or Ubuntu from the Windows bootloader, and change the settings for the default OS, countdown and other things from EasyBCD, which is installed in Windows.

Update: If the GRUB menu is still displayed, edit the 'grub' file again, and set the timeout to 0.10 instead of a zero. The GRUB menu should not appear now.