How do I set the grub timeout and the grub default boot entry?


Ubuntu and most other Linux distributions now use the GRUB2 boot loader. You can change its settings to select a default operating system, set a background image, and choose how long GRUB counts down before automatically booting the default OS.

We configured GRUB2 on Ubuntu 14.04 here, but the process should be similar for other Linux distributions. You may have customized the original GRUB’s settings by editing its menu.lst file in the past, but the process is now different.

GRUB2 Configuration Basics

GRUB2 doesn’t use a menu.lst file. Instead, its main configuration file is the /boot/grub/grub.cfg file. However, you shouldn’t edit this file by hand! This file is just for GRUB2’s own usage. It’s automatically created by running the update-grub command as root — in other words, by running sudo update-grub on Ubuntu.

Your own GRUB settings are stored in the /etc/default/grub file. Edit this file to change GRUB2’s settings. Scripts are also...

0 0

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...

0 0

Hello AxshunJaxun,

Thnaks for your reply. The problem is not the timeout of grub I don't even come to grub2 by default. I have to press Escape at boot and then choose boot from EFI file and select the grub file manually.

The problem is that the laptop is booting into Win8. Even when I change the boot order of the EFI system. I show now what I do to add grub to my bootorder and how I change it.

As long when my system is unchanged the boot order is as followed:

LinuxBox64x4 / # efibootmgr BootCurrent: 003D Timeout: 0 seconds BootOrder: 3001,2001,2002 Boot0001* Windows Boot Manager Boot0002* Notebook Hard Drive Boot0003* Internal CD/DVD ROM Drive Boot2001* USB Drive (UEFI) Boot2002* Internal CD/DVD ROM Drive (UEFI) Boot3001* Internal Hard Disk or Solid State Disk

Here it is clearly seen that the internal hard drive will boot when starting the pc.

Now I add grub to the boot order:

LinuxBox64x4 / # grub2-install --target x86_64-efi...
0 0

There are also files in /etc/grub.d where you can make changes. I have Ubuntu 10.10 installed and at the top of the /boot/grub/ file is this line:

That boots the first menuentry so you could count down to whichever entry to put the number you want, counting from zero. My experience with editing grub.cfg is that if I run update-grub after editing it and don't have the changes in one of the other grub files in /etc, the changes disappear.

I'm not really clear on your situation. If you have windows and Fedora, why don't you just boot Fedora and make the changes? Are you not able to boot Fedora?

1 members found this post helpful.

All times are GMT -5. The time now is .

0 0
0 0

GUI configuration tools

Following package may be installed:

grub-customizer — GTK+ customizer for GRUB or BURG || AUR grub2-editor — KDE4 control module for configuring the GRUB bootloader || AUR[broken link: archived in aur-mirror] grub2-editor-frameworks — Unofficial KF5 port of grub2-editor || AUR startupmanager — GUI app for changing the settings of GRUB Legacy, GRUB, Usplash and Splashy (abandonned) || AUR

Visual configuration

In GRUB it is possible, by default, to change the look of the menu. Make sure to initialize, if not done already, GRUB graphical terminal, gfxterm, with proper video mode, gfxmode, in GRUB. This can be seen in the section GRUB#"No suitable mode found" error. This video mode is passed by GRUB to the linux kernel via 'gfxpayload' so any visual...

0 0

If you are worried about the warning, I believe you can ignore it, it may be just a notification (can't test here, since I still have an older version of Grub2). Reboot to test if the change took effect.

Also, since it is complaining about non-zero value, and a zero-value is already defaulting to 10 seconds, I think it is (with the new changes in newer version) safe now to set it to zero like you were doing. What I wrote was applicable to the version I am using (and the older ones), maybe it is zero by default for new versions. In any case, it shouldn't hurt if Ubuntu is set as the default OS.

And if you are worried about it detecting XP, I think that can be (should be) ignored as well, since it doesn't matter when the menu is going to bypassed anyway.

However, IF you want (or really need) to disable the detection of XP, just disable the "os-prober" script temporarily -


sudo chmod -x /usr/bin/os-prober

Then run an "update-grub" again....

0 0
Hello everyone,

I have two questions regarding the new grub 2.02 that comes with Kali 2:

1) Configuration of Grub on a Dual Boot Machine:

This is my current /etc/default/grub file:


GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="initrd=/install/initrd.gz" How do I have to edit this file to make it start Windows 7 after 2 seconds by default?
On my old installations (and this one currently as a workaround) I changed the order in /boot/grub/grub.cfg but this time I want to do it 100% correct.
(Also: How can I disable that fancy graphics mode? I managed to change the background image to something different but the font is still terribly small and it REALLY messes up the graphics whilen Win7 is booting. -But that's a different topic I guess )

2) SOLVED! - Booting Kali into Text-Mode via Grub

How do I have to edit the entries in...

0 0

[ ]

[+140] [2012-06-08 10:21:03] izx [


Press Alt+F2, type gksudo gedit /etc/default/grub press Enter and enter your password.

You will see the following contents:


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)


0 0

Although grub can be edited using a software Grub Customizer but if you want more control and do it manually in a text editor, here are the steps:

1. For removing memtest, open terminal and type:

sudo chmod -x /etc/grub.d/20_memtest86+

This can also be done graphically by opening /etc/grub.d, right click on 20_memtest86+ and disabling/unchecking “Allow executing file as program”. User must have administrative permissions to do this action. To get administrative rights, type in terminal:

gksudo nautilus

A new window will open which will have administrative rights. Browse the location from this window and perform reguired operations.

2. To remove grub recovery option, open file /etc/default/grub as administrator and uncomment GRUB_DISABLE_RECOVERY="true" by removing # in front of it. To open this file as administrator, right click on file and select "Open as Administrator".

3. To change default timeout, change the value of...

0 0

x86: Administering the GRUB Configuration by Using the bootadm Command

The following procedures are provided in this section:

On systems that support GRUB Legacy, the GRUB configuration and the GRUB menu is primarily managed by editing the menu.lst file. On systems that support GRUB 2, the grub.cfg file is used. However, this file is not manually edited. Instead, the file is managed by using the boot administration interface, bootadm. The bootadm command can be used to administer most of the tasks that were previously done by editing the menu.lst file. These tasks include administering boot loader settings, the GRUB menu, as well as individual attributes of a particular boot entry.

Note - Because the grub.cfg file can be overwritten without notice whenever changes are made to the boot loader by using either the bootadm command or the beam command, this file should never be directly edited.

The following bootadm subcommands have been modified to...

0 0