Grub It is that menu that appears on our computer and that allows us to choose which distro (or operating system) we want to use at that moment. That is, many of you will see in Grub several options for Ubuntu, Debian, ArchLinux or another distro, as well as the option to start with Windows (in case you have it installed).
By default they will enter through the 1st option, generally through the most updated kernel that they have in their distro, in my case by default it enters through Debian kernel v3.2.0-4-686-pae regardless of whether you have other kernels or other operating systems, then the question:
How to configure our computer so that by default it accesses NOT by the first option but by the one we want?
Although there are graphical applications that do this, here I will show you how to do it using only the terminal.
First we must know what options we have, for this in a terminal we write the following:
grep menuentry /boot/grub/grub.cfg
Our options will appear, something like this:
As you can see, every line that starts with «menentry" it is an option. Let's say that I want to set by default so that my system always accesses (by default I repeat) through Windows XP, located in / dev / sda1.
For this we must edit another file, in this case we must edit: / Etc / default / grub
To do this in a terminal we write the following:
sudo nano /etc/default/grub
su through which they will be asked for the root password, and then they will be able to execute: nano /etc/default/grubYou will see something like this:
As you can see in the image, I pointed out GRUB_DEFAULT = 0 which is the line that indicates the option by which it will be accessed by default. That is, suppose that I want my laptop to always enter Windows XP by default (option number 9, as indicated in the first image) then that line should be: GRUB_DEFAULT = 8
Also in the next line it says: GRUB_TIMEOUT = 5, this refers to the waiting time, the seconds that Grub2 will wait before opening the default option, that is, the seconds they have to use the Up and Down arrow keys to change the option that will be accessed.
Once this has been changed, we simply have to execute:
sudo update-grub
This will update what new they did, make the changes effective.
And that's it, we're done 
This tutorial was a bit long for me, but it doesn't mean that changing Grub2's default input is complex, it's actually quite simple.
Anyway, nothing more to add about it.
regards
/ code