How do you have the grub appear on a key combination, but have windows boot default.

I'm running ubuntu 11.10 and grub 2.0.

Here is my current /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX=" quiet vga=769"


And here is my /boot/grub/grub.cfg http://pastebin.com/HbDBe8xz

  • 1
    You mean like <press shift> after BIOS post will launch grub menu? Oct 23 '11 at 1:48
  • 1
    Yeah any key combo will do. Oct 23 '11 at 1:51
  • it already exists, if your using grub press shift right after post and keep it pressed. Oct 23 '11 at 2:52
  • have a look here. Oct 23 '11 at 4:05
  • 4
    @brunopereira81 I'm trying to hide the menu so the user has no idea that the grub is installed and use a key combo to display it. Unfortunately the grub always seems to flicker briefly no matter what values I set in /etc/default/grub Oct 23 '11 at 4:19

I think you can do it with the config variables in /etc/default/grub. Don't forget to run update-grub after updating the file.

GRUB_DEFAULT= 3 #Assuming Windows is the third menu entry

As per the documentation for each option:

     The default menu entry.  This may be a number, in which case it
     identifies the Nth entry in the generated menu counted from zero,
     or the title of a menu entry, or the special string `saved'.
     Using the title may be useful if you want to set a menu entry as
     the default even though there may be a variable number of entries
     before it.

     For example, if you have:

     menuentry 'Example GNU/Linux distribution' --class gnu-linux {

     then you can make this the default using:

          GRUB_DEFAULT='Example GNU/Linux distribution'

     If you set this to `saved', then the default menu entry will be
     that saved by `GRUB_SAVEDEFAULT', `grub-set-default', or

     The default is `0'.
     Boot the default entry this many seconds after the menu is
     displayed, unless a key is pressed.  The default is `5'.  Set to
     `0' to boot immediately without displaying the menu, or to `-1' to
     wait indefinitely.

     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.
  • 1
    ... the OP mentioned that Grub2 still displays briefly even with these values defined... Any ideas how to stop this?
    – fossfreedom
    Jan 31 '12 at 21:17
  • Um, he seems to have GRUB_TIMEOUT=10, maybe changing it to 0 could help.
    – roadmr
    Jan 31 '12 at 22:09
  • I think that setting GRUB_DEFAULT to saved is preferable for two reasons: 1) It remembers the last selection; and 2) it doesn't break if the number of menu entries ever changes (which does happen sometimes. Jan 31 '12 at 22:55
  • @roadmr No, 0 does not help. It flashes the GRUB background and no matter what is pressed, it does not bring up the GRUB menu. i.e. It goes to the default OS.
    – Oxwivi
    Feb 1 '12 at 12:34
  • set GRUB_TIMEOUT=5, but edit gksu gedit /etc/grub.d/05_debian_theme , set GRUB background color to black and menu_color_normal to black, so only highlighted items will be visible
    – Denis
    Feb 4 '12 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.