Sie sind auf Seite 1von 6

Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

How do I set the grub timeout and the grub default boot entry?
up
vote93do
wn vote
38

In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see
at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)?

favorite

boot dual-boot grub2

shareimprove this question

edited Jul 19 at 6:46

asked Jun 8 '12 at 10:10

meteors
6381718

Can you give more information. What do you mean with "grub time" and what is your default os. In your grub menu
what are the different lines? Julien Chau Jun 8 '12 at 10:16

1 grub time means the countdown time when i have to select the os at the BIOS starting screen. I'm sorry but I don't
know exactly what that os selection menu is called so I posted it as grub time. meteors Jun 8 '12 at 13:23

add a comment

3 Answers
activeoldestvotes
up
vote108do
wn vote
accept ed

Press Alt+F2, type gksudo gedit /etc/default/grub press Enter and enter your
password.
You will see the following contents:

GRUB_DEFAULT=0

GRUB_HIDDEN_TIMEOUT=0

GRUB_HIDDEN_TIMEOUT_QUIET=true

GRUB_TIMEOUT=10

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

GRUB_CMDLINE_LINUX=""

You can change the default from 0 to any number, corresponding to the entry in
the Grub bootup menu (first entry is 0, second is 1, etc.)

You can change the "hidden timeout" (no menu); and also display the
countdown (TIMEOUT_QUIET=false)

You can force the grub menu to show by commenting out the
two GRUB_HIDDEN lines with a # at the beginning of the line
And set the grub menu timeout (default is 10 seconds)

Make your changes, press Ctrl-S to save and Ctrl-Q to exit.

Important: Open a terminal with Ctrl-Alt-T and type sudo update-grub to


apply the changes you just made.
Reboot and you should see your timeout/default entry change.

Linked Question:

How do I set Windows to boot as the default in the boot loader?

shareimprove this answer

edited Apr 7 '13 at 21:34

answered Jun 8 '12 at 10:21

izx
fossfreedom

80.1k17186244

117k25262313

as compare with mine you have given clearly . nice job @izx . Raja Jun 8 '12 at 10:22
Thanks, @Raja, but grub/grub2 was the main difference. If you had the correct grub2, I would have happily edited
your answer instead of making another one :) izx Jun 8 '12 at 10:24
actually i am college PC(XP) , so no information . just typed what i remember Raja Jun 8 '12 at 12:33
thank you your answer worked but can u please explain me the second and third point(the hidden timeout and grub
hidden lines) what are they meant for. meteors Jun 8 '12 at 13:34
What's Alt+F2 supposed to do? I'm nervous about shortcuts that I might not be able to back out from.
15:55
show 3 more comments
up
vote18do
wn vote

If you read the file that you are editing in the example above (/etc/default/grub), you will
notice that the very first couple lines instruct you to run update-grub after making
changes in order to update the actual file that grub reads to "get its instructions"
(/boot/grub/grub.cfg). Note that you must actually run it with the sudocommand first as
you need root privileges to actually run the command (which is why the poster above
said to type sudo update-grub). This will cause the changes you made to be written
to /boot/grub/grub.cfg. The very next couple lines tell you that you can read the full
documentation of options in that file (again, /etc/default/grub) by typing info -f grub -n
'Simple configuration'.
That said, set GRUB_TIMEOUT to -1 if you want to set the "grub time" to be indefinite.
In other words, it will never automatically boot. You will have to make a selection.
Finally, to answer your question, here are the descriptions of those "grub hidden lines"

straight from the above-referenced documentation:


GRUB_HIDDEN_TIMEOUT
Wait this many seconds for a key to be pressed before displaying
the menu. If no key is pressed during that time, boot
immediately. Unset by default.
GRUB_HIDDEN_TIMEOUT_QUIET
In conjunction with `GRUB_HIDDEN_TIMEOUT', set this to `true' to
suppress the verbose countdown while waiting for a key to be
pressed before displaying the menu. Unset by default.

I hope this helps!


shareimprove this answer

edited Apr 23 '14 at 23:02

answered Aug 7 '12 at 0:32

belacqua

Sean

11.5k105893

18112

Excellent answer. John S Gruber Aug 10 '12 at 5:36


@Sean that was cool. beginer Aug 19 '14 at 17:51
add a comment
up
vote7dow
n vote

You can use an application called Grub Customizer. It is much more easier.
You can install it by:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

There is an How-To Geek article about it, How to Configure the Linux GRUB 2 Boot
Menu the Easy Way. Also, there is a solved thread on the Ubuntu Forums, Change boot
order in GRUB 2 that mentions this tool.
Here are some screen shots of this software:

shareimprove this answer

answered Jan 2 at 7:42

Kolappan Nathan
280216

This needs an update related to the dual levels of current grub menu. Hannu Aug 21 at 9:48
add a comment