Is there a way to hide the boot menu ? For example i got 2 ways of booting ubuntu/windows. I want to hide boot and to boot directly to windows. And also it may be reactivated for pressing two keys ? Maybe sounds weird, but sorry. And hope it is not yet an question like this.
1 Answer
It sounds like you want to edit your GRUB boot menu to not wait for your choice, and just boot either a default entry, or the last entry booted.
See Ubuntu's Grub 2 Setup Community Help page for more info, some clips are below.
GRUB 2 builds its menu (
grub.cfg
) by running scripts found in the/etc/grub.d/folder
and the settings in the/etc/default/grub
file. This file is recreated automatically whenever the update-grub command is run.
You could edit /etc/default/grub
and then run update-grub
. These are probably some options you want:
GRUB_DEFAULT=
Sets the default menu entry. Entries may be numeric, a complete menuentry quotation, or "saved"
GRUB_DEFAULT=0
Sets the default menu entry by menu position number. The first "menuentry" in grub.cfg is 0, the second is 1, etc.GRUB_DEFAULT=saved
The information in this section applies to GRUB 1.98 and later. The "saved" entry enables the "grub-reboot
" and "grub-set-default
" commands to set the default OS for future boots.grub-set-default
Run from a terminal, sets the default boot entry until changed.The format is sudo grub-set-default X, with X being the menu entry position (starting with 0 as the first entry) or the exact menu string.
Example:
sudo grub-set-default 3
Example:sudo grub-set-default "Ubuntu, Linux 2.6.32-15-generic"
To obtain the existing menu entry choice number (starting from 0) or the menu entry "string", run:
grep menuentry /boot/grub/grub.cfg
GRUB_SAVEDEFAULT=true
If set to true this setting will automatically set the last selected OS from the menu as the default OS on the next boot.
- No commands need be run to set the default OS.
- Any time a menu entry is manually selected from the GRUB 2 menu, it becomes the default OS.
- This option currently does not work if your /boot directory resides on an LVM partition or RAID.
- For this to work you must also set
GRUB_DEFAULT=saved
.
GRUB_HIDDEN_TIMEOUT=
Wait this many seconds for the user to press a key. During this period no menu is shown unless the user presses a key. If no key is pressed, control is passed to GRUB _TIMEOUT when the GRUB_HIDDEN_TIMEOUT expires. See the note regarding bugs to this feature at the end of this section.
The developers envisioned using this setting with a GRUB_TIMEOUT value of 0. This would give users a period of time (GRUB_HIDDEN_TIMEOUT) to display the menu by pressing a key, after which the system would boot without the menu being displayed (GRUB_TIMEOUT=0).
GRUB_HIDDEN_TIMEOUT=0
No menu is displayed. The system is immediately booted to the default OS.- If the value is set to 0, and if the SHIFT key is depressed during the boot process, the menu will be displayed. This gives the user a method of interrupting an automatic boot which would normally not display the menu.
GRUB_HIDDEN_TIMEOUT=X
X is a positive integer (e.g. 1, 5, 10, etc)The boot process will pause and display a blank screen or the designated splash image for X seconds. At the end of the time period, the system will boot. No menu will be displayed. While GRUB_HIDDEN_TIMEOUT is active, the menu can be displayed by pressing any key.
GRUB_HIDDEN_TIMEOUT=
No value entered after the=
sign. The menu will be displayed for the number of seconds designated by GRUB_TIMEOUT.
GRUB_TIMEOUT=
Sets the time period in seconds (1, 5, etc) for the menu to be displayed before automatically booting unless the user intervenes.
- This instruction begins at the expiration of GRUB_HIDDEN_TIMEOUT.
- Setting this value to -1 will cause the menu to display until the user makes a selection.
So, probably adding/changing these lines in /etc/default/grub
(changing the 0
in GRUB_DEFAULT=0
to whatever your choice is):
GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT=0
Then run sudo update-grub