How to set GRUB timeout to 0 on Ubuntu 18.04












6















I tried to update my grub config file to timeout to 0 value, so OS starts quickly. I modified /etc/default/grub configuration file on my Ubuntu 18.04 and then ran:



sudo update-grub


and it didn't work. I also ran:



sudo grub-mkconfig
sudo update-grub


but they didn't work.



I searched a lot on the web to solve this issue, but all guides say to run the update-grub command to update grub by /etc/default/grub config file.
I don't know if is Ubuntu 18.04 that handles grub files in a different way, but I cannot update my grub with my parameters.



This is my /etc/default/grub file:



# 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_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"









share|improve this question




















  • 3





    Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did.

    – Organic Marble
    May 14 '18 at 12:04











  • Do you have other distributions installed (dual boot)?

    – mook765
    May 14 '18 at 12:22











  • it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius

    – Bob91
    May 14 '18 at 12:27













  • I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765

    – Bob91
    May 14 '18 at 12:35






  • 1





    Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks.

    – David Foerster
    May 15 '18 at 13:48
















6















I tried to update my grub config file to timeout to 0 value, so OS starts quickly. I modified /etc/default/grub configuration file on my Ubuntu 18.04 and then ran:



sudo update-grub


and it didn't work. I also ran:



sudo grub-mkconfig
sudo update-grub


but they didn't work.



I searched a lot on the web to solve this issue, but all guides say to run the update-grub command to update grub by /etc/default/grub config file.
I don't know if is Ubuntu 18.04 that handles grub files in a different way, but I cannot update my grub with my parameters.



This is my /etc/default/grub file:



# 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_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"









share|improve this question




















  • 3





    Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did.

    – Organic Marble
    May 14 '18 at 12:04











  • Do you have other distributions installed (dual boot)?

    – mook765
    May 14 '18 at 12:22











  • it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius

    – Bob91
    May 14 '18 at 12:27













  • I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765

    – Bob91
    May 14 '18 at 12:35






  • 1





    Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks.

    – David Foerster
    May 15 '18 at 13:48














6












6








6


2






I tried to update my grub config file to timeout to 0 value, so OS starts quickly. I modified /etc/default/grub configuration file on my Ubuntu 18.04 and then ran:



sudo update-grub


and it didn't work. I also ran:



sudo grub-mkconfig
sudo update-grub


but they didn't work.



I searched a lot on the web to solve this issue, but all guides say to run the update-grub command to update grub by /etc/default/grub config file.
I don't know if is Ubuntu 18.04 that handles grub files in a different way, but I cannot update my grub with my parameters.



This is my /etc/default/grub file:



# 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_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"









share|improve this question
















I tried to update my grub config file to timeout to 0 value, so OS starts quickly. I modified /etc/default/grub configuration file on my Ubuntu 18.04 and then ran:



sudo update-grub


and it didn't work. I also ran:



sudo grub-mkconfig
sudo update-grub


but they didn't work.



I searched a lot on the web to solve this issue, but all guides say to run the update-grub command to update grub by /etc/default/grub config file.
I don't know if is Ubuntu 18.04 that handles grub files in a different way, but I cannot update my grub with my parameters.



This is my /etc/default/grub file:



# 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_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"






boot grub2 18.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '18 at 10:00









Melebius

5,09652040




5,09652040










asked May 14 '18 at 12:03









Bob91Bob91

3811311




3811311








  • 3





    Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did.

    – Organic Marble
    May 14 '18 at 12:04











  • Do you have other distributions installed (dual boot)?

    – mook765
    May 14 '18 at 12:22











  • it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius

    – Bob91
    May 14 '18 at 12:27













  • I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765

    – Bob91
    May 14 '18 at 12:35






  • 1





    Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks.

    – David Foerster
    May 15 '18 at 13:48














  • 3





    Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did.

    – Organic Marble
    May 14 '18 at 12:04











  • Do you have other distributions installed (dual boot)?

    – mook765
    May 14 '18 at 12:22











  • it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius

    – Bob91
    May 14 '18 at 12:27













  • I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765

    – Bob91
    May 14 '18 at 12:35






  • 1





    Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks.

    – David Foerster
    May 15 '18 at 13:48








3




3





Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did.

– Organic Marble
May 14 '18 at 12:04





Please edit your question and include your modified grub config file. Otherwise we're just trying to guess what you did.

– Organic Marble
May 14 '18 at 12:04













Do you have other distributions installed (dual boot)?

– mook765
May 14 '18 at 12:22





Do you have other distributions installed (dual boot)?

– mook765
May 14 '18 at 12:22













it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius

– Bob91
May 14 '18 at 12:27







it didn't work mean that my grub timeout is still set to 10 sec as by default @Melebius

– Bob91
May 14 '18 at 12:27















I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765

– Bob91
May 14 '18 at 12:35





I have windows in the same ssd and other distros installed on other hdd, but last month i had fedora 27 (instead of ubuntu 18) and it worked when i changed grub config file, so i think the other distros aren't the causes of this behavior @mook765

– Bob91
May 14 '18 at 12:35




1




1





Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks.

– David Foerster
May 15 '18 at 13:48





Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks.

– David Foerster
May 15 '18 at 13:48










6 Answers
6






active

oldest

votes


















9














In /boot/grub/grub.cfg file there is a condition, almost at the end of the file, that sets the timeout to 10 if the timeout is set to 0. In other words, if you set the timeout to 0 in your /etc/default/grub and then update grub, the condition above reset it to 10 seconds.



if [ "${timeout}" = 0 ]; then
set timeout=10
fi


However, /boot/grub/grub.cfg is a read-only file and I cannot remove that condition. I made some tests with different values of the timeout in /etc/default/grub. I tried with 1ms (0.001), 0.1s and 1s and I found out that values below 1 (like 0.1 and 0.001) work in the same way and almost like timeout set to 0.






share|improve this answer

































    2














    Uncomment GRUB_HIDDEN_TIMEOUT=0 and run update-grub again.






    share|improve this answer
























    • it doesn't work

      – Bob91
      May 15 '18 at 14:14











    • GRUB_HIDDEN_TIMEOUT=-1

      – kuhajeyan
      Nov 20 '18 at 16:33











    • GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

      – Manish
      Feb 2 at 10:01



















    2














    Like the other answers say, uncomment GRUB_HIDDEN_TIMEOUT and run update-grub. Then comment out the



    if [ "${timeout}" = 0 ]; then
    set timeout=10
    fi


    section in /boot/grub/grub.cfg. In vim you can just override the read-only property with an exclamation point :x!. Or you can run



    sudo chmod +w /boot/grub/grub.cfg
    sudo vim /boot/grub/grub.cfg
    sudo chmod -w /boot/grub/grub.cfg


    to temporarily have write permission while editing the file.






    share|improve this answer



















    • 1





      You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

      – Bob91
      May 24 '18 at 16:37






    • 1





      That is true, the file is overwritten on update, as I experienced recently.

      – asantas93
      May 25 '18 at 17:20



















    2














    In my case, the problem was that my system didn't support "recordfail" which caused a separate block to get added to the grub.cfg which defaults to a timeout of 30 seconds. The relevant code in /etc/grub.d/00_header:



    if [ "$recordfail_broken" = 1 ]; then
    cat << EOF
    if lsefi; then
    set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
    if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    fi
    fi
    EOF


    The fix is simply to add a value for GRUB_RECORDFAIL_TIMEOUT in /etc/default/grub and run update-grub again. For example:



    GRUB_CMDLINE_LINUX_DEFAULT=""
    GRUB_CMDLINE_LINUX=""

    # Adjusted timeout for system which doesn't support recordfail
    GRUB_RECORDFAIL_TIMEOUT=2

    # Uncomment to enable BadRAM filtering, modify to suit your needs
    # This works with Linux (no patch required) and with any kernel that obtains
    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
    #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"





    share|improve this answer































      1














      You can set GRUB_TIMEOUT to 0.



      The part overwriting timeout value is written in ajust_timeout function in the top of /etc/grub.d/30_os-prober.



      ajust_timeout () {
      ...
      if [ "${timeout}" = 0]; then
      set timeout=10
      fi
      ...
      }


      So, you can set the value by editing the file and comment out if-block.






      share|improve this answer

































        1














        You can set GRUB_TIMEOUT to -1.




        Ex:GRUB_TIMEOUT="-1"







        share|improve this answer


























        • 'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

          – Vijay
          Feb 20 at 14:10














        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036091%2fhow-to-set-grub-timeout-to-0-on-ubuntu-18-04%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        9














        In /boot/grub/grub.cfg file there is a condition, almost at the end of the file, that sets the timeout to 10 if the timeout is set to 0. In other words, if you set the timeout to 0 in your /etc/default/grub and then update grub, the condition above reset it to 10 seconds.



        if [ "${timeout}" = 0 ]; then
        set timeout=10
        fi


        However, /boot/grub/grub.cfg is a read-only file and I cannot remove that condition. I made some tests with different values of the timeout in /etc/default/grub. I tried with 1ms (0.001), 0.1s and 1s and I found out that values below 1 (like 0.1 and 0.001) work in the same way and almost like timeout set to 0.






        share|improve this answer






























          9














          In /boot/grub/grub.cfg file there is a condition, almost at the end of the file, that sets the timeout to 10 if the timeout is set to 0. In other words, if you set the timeout to 0 in your /etc/default/grub and then update grub, the condition above reset it to 10 seconds.



          if [ "${timeout}" = 0 ]; then
          set timeout=10
          fi


          However, /boot/grub/grub.cfg is a read-only file and I cannot remove that condition. I made some tests with different values of the timeout in /etc/default/grub. I tried with 1ms (0.001), 0.1s and 1s and I found out that values below 1 (like 0.1 and 0.001) work in the same way and almost like timeout set to 0.






          share|improve this answer




























            9












            9








            9







            In /boot/grub/grub.cfg file there is a condition, almost at the end of the file, that sets the timeout to 10 if the timeout is set to 0. In other words, if you set the timeout to 0 in your /etc/default/grub and then update grub, the condition above reset it to 10 seconds.



            if [ "${timeout}" = 0 ]; then
            set timeout=10
            fi


            However, /boot/grub/grub.cfg is a read-only file and I cannot remove that condition. I made some tests with different values of the timeout in /etc/default/grub. I tried with 1ms (0.001), 0.1s and 1s and I found out that values below 1 (like 0.1 and 0.001) work in the same way and almost like timeout set to 0.






            share|improve this answer















            In /boot/grub/grub.cfg file there is a condition, almost at the end of the file, that sets the timeout to 10 if the timeout is set to 0. In other words, if you set the timeout to 0 in your /etc/default/grub and then update grub, the condition above reset it to 10 seconds.



            if [ "${timeout}" = 0 ]; then
            set timeout=10
            fi


            However, /boot/grub/grub.cfg is a read-only file and I cannot remove that condition. I made some tests with different values of the timeout in /etc/default/grub. I tried with 1ms (0.001), 0.1s and 1s and I found out that values below 1 (like 0.1 and 0.001) work in the same way and almost like timeout set to 0.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 16 '18 at 13:11









            Melebius

            5,09652040




            5,09652040










            answered May 16 '18 at 13:02









            Bob91Bob91

            3811311




            3811311

























                2














                Uncomment GRUB_HIDDEN_TIMEOUT=0 and run update-grub again.






                share|improve this answer
























                • it doesn't work

                  – Bob91
                  May 15 '18 at 14:14











                • GRUB_HIDDEN_TIMEOUT=-1

                  – kuhajeyan
                  Nov 20 '18 at 16:33











                • GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

                  – Manish
                  Feb 2 at 10:01
















                2














                Uncomment GRUB_HIDDEN_TIMEOUT=0 and run update-grub again.






                share|improve this answer
























                • it doesn't work

                  – Bob91
                  May 15 '18 at 14:14











                • GRUB_HIDDEN_TIMEOUT=-1

                  – kuhajeyan
                  Nov 20 '18 at 16:33











                • GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

                  – Manish
                  Feb 2 at 10:01














                2












                2








                2







                Uncomment GRUB_HIDDEN_TIMEOUT=0 and run update-grub again.






                share|improve this answer













                Uncomment GRUB_HIDDEN_TIMEOUT=0 and run update-grub again.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 15 '18 at 11:43









                hiigaranhiigaran

                1,612520




                1,612520













                • it doesn't work

                  – Bob91
                  May 15 '18 at 14:14











                • GRUB_HIDDEN_TIMEOUT=-1

                  – kuhajeyan
                  Nov 20 '18 at 16:33











                • GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

                  – Manish
                  Feb 2 at 10:01



















                • it doesn't work

                  – Bob91
                  May 15 '18 at 14:14











                • GRUB_HIDDEN_TIMEOUT=-1

                  – kuhajeyan
                  Nov 20 '18 at 16:33











                • GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

                  – Manish
                  Feb 2 at 10:01

















                it doesn't work

                – Bob91
                May 15 '18 at 14:14





                it doesn't work

                – Bob91
                May 15 '18 at 14:14













                GRUB_HIDDEN_TIMEOUT=-1

                – kuhajeyan
                Nov 20 '18 at 16:33





                GRUB_HIDDEN_TIMEOUT=-1

                – kuhajeyan
                Nov 20 '18 at 16:33













                GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

                – Manish
                Feb 2 at 10:01





                GRUB_HIDDEN_TIMEOUT=-1 worked on Ubuntu 18.10.

                – Manish
                Feb 2 at 10:01











                2














                Like the other answers say, uncomment GRUB_HIDDEN_TIMEOUT and run update-grub. Then comment out the



                if [ "${timeout}" = 0 ]; then
                set timeout=10
                fi


                section in /boot/grub/grub.cfg. In vim you can just override the read-only property with an exclamation point :x!. Or you can run



                sudo chmod +w /boot/grub/grub.cfg
                sudo vim /boot/grub/grub.cfg
                sudo chmod -w /boot/grub/grub.cfg


                to temporarily have write permission while editing the file.






                share|improve this answer



















                • 1





                  You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

                  – Bob91
                  May 24 '18 at 16:37






                • 1





                  That is true, the file is overwritten on update, as I experienced recently.

                  – asantas93
                  May 25 '18 at 17:20
















                2














                Like the other answers say, uncomment GRUB_HIDDEN_TIMEOUT and run update-grub. Then comment out the



                if [ "${timeout}" = 0 ]; then
                set timeout=10
                fi


                section in /boot/grub/grub.cfg. In vim you can just override the read-only property with an exclamation point :x!. Or you can run



                sudo chmod +w /boot/grub/grub.cfg
                sudo vim /boot/grub/grub.cfg
                sudo chmod -w /boot/grub/grub.cfg


                to temporarily have write permission while editing the file.






                share|improve this answer



















                • 1





                  You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

                  – Bob91
                  May 24 '18 at 16:37






                • 1





                  That is true, the file is overwritten on update, as I experienced recently.

                  – asantas93
                  May 25 '18 at 17:20














                2












                2








                2







                Like the other answers say, uncomment GRUB_HIDDEN_TIMEOUT and run update-grub. Then comment out the



                if [ "${timeout}" = 0 ]; then
                set timeout=10
                fi


                section in /boot/grub/grub.cfg. In vim you can just override the read-only property with an exclamation point :x!. Or you can run



                sudo chmod +w /boot/grub/grub.cfg
                sudo vim /boot/grub/grub.cfg
                sudo chmod -w /boot/grub/grub.cfg


                to temporarily have write permission while editing the file.






                share|improve this answer













                Like the other answers say, uncomment GRUB_HIDDEN_TIMEOUT and run update-grub. Then comment out the



                if [ "${timeout}" = 0 ]; then
                set timeout=10
                fi


                section in /boot/grub/grub.cfg. In vim you can just override the read-only property with an exclamation point :x!. Or you can run



                sudo chmod +w /boot/grub/grub.cfg
                sudo vim /boot/grub/grub.cfg
                sudo chmod -w /boot/grub/grub.cfg


                to temporarily have write permission while editing the file.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 23 '18 at 14:49









                asantas93asantas93

                211




                211








                • 1





                  You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

                  – Bob91
                  May 24 '18 at 16:37






                • 1





                  That is true, the file is overwritten on update, as I experienced recently.

                  – asantas93
                  May 25 '18 at 17:20














                • 1





                  You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

                  – Bob91
                  May 24 '18 at 16:37






                • 1





                  That is true, the file is overwritten on update, as I experienced recently.

                  – asantas93
                  May 25 '18 at 17:20








                1




                1





                You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

                – Bob91
                May 24 '18 at 16:37





                You are right, but i think everytime you update grub (manually or when there are any os upgrade) the /boot/grub/grub.cfg will recreated with the condition above.

                – Bob91
                May 24 '18 at 16:37




                1




                1





                That is true, the file is overwritten on update, as I experienced recently.

                – asantas93
                May 25 '18 at 17:20





                That is true, the file is overwritten on update, as I experienced recently.

                – asantas93
                May 25 '18 at 17:20











                2














                In my case, the problem was that my system didn't support "recordfail" which caused a separate block to get added to the grub.cfg which defaults to a timeout of 30 seconds. The relevant code in /etc/grub.d/00_header:



                if [ "$recordfail_broken" = 1 ]; then
                cat << EOF
                if lsefi; then
                set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
                if [ x$feature_timeout_style = xy ] ; then
                set timeout_style=menu
                fi
                fi
                EOF


                The fix is simply to add a value for GRUB_RECORDFAIL_TIMEOUT in /etc/default/grub and run update-grub again. For example:



                GRUB_CMDLINE_LINUX_DEFAULT=""
                GRUB_CMDLINE_LINUX=""

                # Adjusted timeout for system which doesn't support recordfail
                GRUB_RECORDFAIL_TIMEOUT=2

                # Uncomment to enable BadRAM filtering, modify to suit your needs
                # This works with Linux (no patch required) and with any kernel that obtains
                # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
                #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"





                share|improve this answer




























                  2














                  In my case, the problem was that my system didn't support "recordfail" which caused a separate block to get added to the grub.cfg which defaults to a timeout of 30 seconds. The relevant code in /etc/grub.d/00_header:



                  if [ "$recordfail_broken" = 1 ]; then
                  cat << EOF
                  if lsefi; then
                  set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
                  if [ x$feature_timeout_style = xy ] ; then
                  set timeout_style=menu
                  fi
                  fi
                  EOF


                  The fix is simply to add a value for GRUB_RECORDFAIL_TIMEOUT in /etc/default/grub and run update-grub again. For example:



                  GRUB_CMDLINE_LINUX_DEFAULT=""
                  GRUB_CMDLINE_LINUX=""

                  # Adjusted timeout for system which doesn't support recordfail
                  GRUB_RECORDFAIL_TIMEOUT=2

                  # Uncomment to enable BadRAM filtering, modify to suit your needs
                  # This works with Linux (no patch required) and with any kernel that obtains
                  # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
                  #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"





                  share|improve this answer


























                    2












                    2








                    2







                    In my case, the problem was that my system didn't support "recordfail" which caused a separate block to get added to the grub.cfg which defaults to a timeout of 30 seconds. The relevant code in /etc/grub.d/00_header:



                    if [ "$recordfail_broken" = 1 ]; then
                    cat << EOF
                    if lsefi; then
                    set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
                    if [ x$feature_timeout_style = xy ] ; then
                    set timeout_style=menu
                    fi
                    fi
                    EOF


                    The fix is simply to add a value for GRUB_RECORDFAIL_TIMEOUT in /etc/default/grub and run update-grub again. For example:



                    GRUB_CMDLINE_LINUX_DEFAULT=""
                    GRUB_CMDLINE_LINUX=""

                    # Adjusted timeout for system which doesn't support recordfail
                    GRUB_RECORDFAIL_TIMEOUT=2

                    # Uncomment to enable BadRAM filtering, modify to suit your needs
                    # This works with Linux (no patch required) and with any kernel that obtains
                    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
                    #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"





                    share|improve this answer













                    In my case, the problem was that my system didn't support "recordfail" which caused a separate block to get added to the grub.cfg which defaults to a timeout of 30 seconds. The relevant code in /etc/grub.d/00_header:



                    if [ "$recordfail_broken" = 1 ]; then
                    cat << EOF
                    if lsefi; then
                    set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}
                    if [ x$feature_timeout_style = xy ] ; then
                    set timeout_style=menu
                    fi
                    fi
                    EOF


                    The fix is simply to add a value for GRUB_RECORDFAIL_TIMEOUT in /etc/default/grub and run update-grub again. For example:



                    GRUB_CMDLINE_LINUX_DEFAULT=""
                    GRUB_CMDLINE_LINUX=""

                    # Adjusted timeout for system which doesn't support recordfail
                    GRUB_RECORDFAIL_TIMEOUT=2

                    # Uncomment to enable BadRAM filtering, modify to suit your needs
                    # This works with Linux (no patch required) and with any kernel that obtains
                    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
                    #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 4 at 0:21









                    Alex MalinovichAlex Malinovich

                    211




                    211























                        1














                        You can set GRUB_TIMEOUT to 0.



                        The part overwriting timeout value is written in ajust_timeout function in the top of /etc/grub.d/30_os-prober.



                        ajust_timeout () {
                        ...
                        if [ "${timeout}" = 0]; then
                        set timeout=10
                        fi
                        ...
                        }


                        So, you can set the value by editing the file and comment out if-block.






                        share|improve this answer






























                          1














                          You can set GRUB_TIMEOUT to 0.



                          The part overwriting timeout value is written in ajust_timeout function in the top of /etc/grub.d/30_os-prober.



                          ajust_timeout () {
                          ...
                          if [ "${timeout}" = 0]; then
                          set timeout=10
                          fi
                          ...
                          }


                          So, you can set the value by editing the file and comment out if-block.






                          share|improve this answer




























                            1












                            1








                            1







                            You can set GRUB_TIMEOUT to 0.



                            The part overwriting timeout value is written in ajust_timeout function in the top of /etc/grub.d/30_os-prober.



                            ajust_timeout () {
                            ...
                            if [ "${timeout}" = 0]; then
                            set timeout=10
                            fi
                            ...
                            }


                            So, you can set the value by editing the file and comment out if-block.






                            share|improve this answer















                            You can set GRUB_TIMEOUT to 0.



                            The part overwriting timeout value is written in ajust_timeout function in the top of /etc/grub.d/30_os-prober.



                            ajust_timeout () {
                            ...
                            if [ "${timeout}" = 0]; then
                            set timeout=10
                            fi
                            ...
                            }


                            So, you can set the value by editing the file and comment out if-block.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Aug 25 '18 at 3:14









                            Karl Richter

                            2,49483569




                            2,49483569










                            answered Aug 24 '18 at 21:56









                            guestguest

                            112




                            112























                                1














                                You can set GRUB_TIMEOUT to -1.




                                Ex:GRUB_TIMEOUT="-1"







                                share|improve this answer


























                                • 'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

                                  – Vijay
                                  Feb 20 at 14:10


















                                1














                                You can set GRUB_TIMEOUT to -1.




                                Ex:GRUB_TIMEOUT="-1"







                                share|improve this answer


























                                • 'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

                                  – Vijay
                                  Feb 20 at 14:10
















                                1












                                1








                                1







                                You can set GRUB_TIMEOUT to -1.




                                Ex:GRUB_TIMEOUT="-1"







                                share|improve this answer















                                You can set GRUB_TIMEOUT to -1.




                                Ex:GRUB_TIMEOUT="-1"








                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Sep 5 '18 at 5:48









                                Sss

                                6485922




                                6485922










                                answered Sep 4 '18 at 18:37









                                Giceu CassianoGiceu Cassiano

                                111




                                111













                                • 'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

                                  – Vijay
                                  Feb 20 at 14:10





















                                • 'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

                                  – Vijay
                                  Feb 20 at 14:10



















                                'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

                                – Vijay
                                Feb 20 at 14:10







                                'GRUB_TIMEOUT' 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. from command info -f grub -n 'Simple configuration

                                – Vijay
                                Feb 20 at 14:10




















                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036091%2fhow-to-set-grub-timeout-to-0-on-ubuntu-18-04%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How to change which sound is reproduced for terminal bell?

                                Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                                Can I use Tabulator js library in my java Spring + Thymeleaf project?