SEARCH

How-To Geek

Change the GRUB Menu Timeout on Ubuntu

When your Ubuntu system boots, you will see the GRUB menu if you hit the Esc key, or if you’ve enabled the menu to show by default. The only issue with this is that the default timeout is only 3 seconds. You may want to increase this amount… or you may even want to decrease it. Either one is simple.

Open up the /boot/grub/menu.lst file in your favorite text editor. I’m using gedit:

sudo gedit /boot/grub/menu.lst

Now find the section that looks like this:

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

The timeout value is in seconds. Save the file, and when you reboot you will have that many seconds to choose the menu item you want.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 12/27/06

Comments (17)

  1. Dave

    It would be useful to add that prevent the timer to runing the timeout line should be commented out e.g. #timeout 3.

    I needed to do this and could not find out how to, anywhere on the web, so I experimented, and it worked.

  2. shashin

    I did it but how to make the splash image folder writable, please help me, I can’t paste any xpm image there

  3. ubuntu noob

    Dave,
    I was looking for how to kill the timer and couldn’t find it anywhere either. And just to clarify for the other uber noobs like myself, commenting it out simply means putting a # in front of it. And goto the top of the window and click save when your done. Sorry if I’m over-clarifying, but for the first timers like myself sometimes the most obvious things get glossed over in the forums, and thats all it takes to get hung up.
    I personally was expecting this grub editing to be more like entering cryptic commands, than just scrolling down a page and making changes and clicking save. I popped my terminal cherry with this sudo gedit command which I cut and pasted right of this page, all I had to do was type my password and ad a #….rather anticlimactic for all the terminal anxiety I was imagining.
    Anyway thanks Dave and “The Geek” !

  4. Eric

    Thanks, it helped. Also it’s worth mentioning that setting the timeout to -1 deactivates timeout.

  5. Madhuranga

    Hi everyone..,

    I cant save my menu.lst file. An error pops up saying “Don’t have the permission to save this file”. :(

    I m the only user in the system and i am the admin. Can any one pls tell me how to make that file to be saved.

    Thanx.

  6. dream47

    Madhuranga,

    You can not just openthe menu.lst file and change it. Under Ubuntu you can use the terminal window and enter:

    sudo gedit /boot/grub/menu.lst

    Now you can save the changes you make to the menu.lst file. The reason for this procedure is your own security.

  7. Jack

    dream47,
    thanks for the help, ive been trying to save this over for ages.
    again thankyou.

    Jack

  8. deem

    errr for some reason i cannot edit or change any thing in the terminal lines, i saw everything you guys have said, the times out stuff mine was ”timeout 10” but i cant edit the line.

    Am i in trouble or what

  9. quadraphenia

    On Ubuntu 10.04, run ‘gksudo gedit /boot/grub/grub.cfg’.

    Search for the word “timeout” and at about Line 35, there will be
    “if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi”

    Changing the value 10 to 2 will make grub take just 2 seconds.

  10. shahab

    my menu.lst file is empty !! even though I have a large list of boot options when I boot. any clues??

  11. nc2hike

    Tis a great article. Thanks quadraphenia for the 10.4 update as i was stuck. I hope to make some contributions just need to understand more of the systems base commands

  12. gerti

    @quadraphenia and others
    As to changing Grub 2 configuration-files :
    You really shouldn’t change the generated files, e.g. /boot/grub/grub.cfg, as these changes disappear with the next update. (Read the comment-lines at the top of the file.)
    The files to change are the /etc/default/grub and/or maybe the files in /etc/grub.d; you can use any old editor, that doesn’t “format” the content, i.e. good old vi, emacs, gedit, etc.
    Then run the update-grub command (with root-privileges), e.g. sudo …
    If you want to see the current Grub-loaders cfg-file, run the grub-mkconfig command without any options.

    When I want to change something, I first run the grub-mkconfig command in a terminal window with root-privileges. Then in another terminal, also with root-privileges, makes the changes (i.e. violate, with an useful editor, the pertinent files), runs the update-grub command, followed by grub-mkconfig. Thus it’s easy to compare the before and after result; before risking a reboot, that might go astray (:-))
    Very useful links :
    https://wiki.ubuntu.com/Grub2
    http://ubuntuforums.org/showthread.php?t=1195275

  13. Omid

    Hi,
    But there is no menu.lst file in this directory and I’m using Ubuntu 10.04 and

    sudo gedit /boot/grub/grub.cfg

    worked.

  14. donkey42

    @Omid, that is incorrect

    sudo is for commands running on CLI

    gksu is for commands that run graphical things on GUI

    so the command should be:

    “gksu gedit /boot/grub/grub.cfg”

    as “gedit” is a graphical program and not CLI

  15. donkey42

    @Omid, that is incorrect

    sudo is for commands running on CLI

    gksu is for commands that run graphical things on GUI

    so the command should be:

    “gksu gedit /boot/grub/grub.cfg”

    as “gedit” is a graphical program and not CLI

    but you are correct “menu.list” was on GRUB v1

  16. gintro

    since ubuntu 10.04.
    Editing the /boot/grub/grub.cfg directly is a bad idea,
    since it will be replaced again by the next update (eq new linux headers … etc), and your changes will be gone.

    to make changes permanent:
    edit /etc/default/grub -> ~ sudo nano /etc/default/grub
    look for the GRUB_TIMEOUT variable and change it’s value to the desired seconds –
    0 = boot directly (default os)
    -1 = wait till the user select the desired option

    after this change run: ~ sudo update-grub
    reboot and check the timeout ;)
    and that’s it.

  17. fail

    uh i set timer to 0 and now i cant boot it… Help? 8(

Enter Your Email Here to Get Access for Free:

Go check your email!