How to change grub command-line (grub shell) keyboard layout?











up vote
2
down vote

favorite












When I boot in GRUB2 and press c, I have access to GRUB shell.



How to change the keyboard layout (language) of this GRUB shell?



Note that I'm booting an Ubuntu VM inside Virtualbox.










share|improve this question




























    up vote
    2
    down vote

    favorite












    When I boot in GRUB2 and press c, I have access to GRUB shell.



    How to change the keyboard layout (language) of this GRUB shell?



    Note that I'm booting an Ubuntu VM inside Virtualbox.










    share|improve this question


























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      When I boot in GRUB2 and press c, I have access to GRUB shell.



      How to change the keyboard layout (language) of this GRUB shell?



      Note that I'm booting an Ubuntu VM inside Virtualbox.










      share|improve this question















      When I boot in GRUB2 and press c, I have access to GRUB shell.



      How to change the keyboard layout (language) of this GRUB shell?



      Note that I'm booting an Ubuntu VM inside Virtualbox.







      grub2 virtualbox keyboard-layout






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 '16 at 22:59

























      asked Mar 28 '16 at 22:54









      KrisWebDev

      6531617




      6531617






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          First, check that you're using GRUB 2 (GRUB 0.x works differently).



          grub-install --version


          Generate a GRUB keyboard layout file. Below is the command for a french keyboard. For other languages, check /usr/share/X11/xkb/symbols/. Filename choice is not important (you can change bepo).



          sudo grub-kbdcomp -o /boot/grub/bepo.gkb fr


          Edit /etc/default/grub with root rights to have:



          #GRUB_HIDDEN_TIMEOUT=0
          GRUB_TERMINAL_INPUT="at_keyboard"


          Edit /etc/grub.d/40_custom with root rights to have:



          #!/bin/sh
          exec tail -n +3 $0

          insmod keylayouts
          keymap /boot/grub/bepo.gkb


          Finally:



          sudo update-grub


          Note: Forget immediately about using the Shift key to display GRUB menu! It may be normal that terminal_input at_keyboard make this key not work anymore. So make sure #GRUB_HIDDEN_TIMEOUT=0 is properly commented.






          share|improve this answer























          • Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
            – Xerus
            Apr 22 at 16:46










          • Link is dead and solution isn't bullet proof on laptops.
            – Zulgrib
            Apr 27 at 11:48


















          up vote
          1
          down vote













          Fine-tuning my grub (2.02-2ubuntu8.3), on an old fully functional Asus N73JF (multiboot Windows 7, Windows recovery, Ubuntu 15.10, Ubuntu 18.04...) a custom menu was not an option for me.



          sudo grub-kbdcomp -o /boot/grub/layouts/laptop.gkb fr


          (Ubuntu's grub2 uses /boot/grub/layouts from 15.10).



          Next, I don't open /etc/default/grub nor /etc/grub.d/40_custom: I edit /etc/grub.d/00_header where I replace



              cat << EOF
          set gfxmode=${GRUB_GFXMODE}
          load_video
          insmod gfxterm
          EOF


          with



              cat << EOF
          set gfxmode=${GRUB_GFXMODE}
          load_video
          insmod gfxterm
          insmod terminal
          terminal_output gfxterm
          insmod keylayouts
          insmod at_keyboard
          terminal_input at_keyboard
          keymap laptop
          EOF


          Thanks to KrisWebDev for his question-answer: I learn a lot looking inside /boot/grub/i386-pc/.






          share|improve this answer





















            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',
            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%2f751259%2fhow-to-change-grub-command-line-grub-shell-keyboard-layout%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            6
            down vote



            accepted










            First, check that you're using GRUB 2 (GRUB 0.x works differently).



            grub-install --version


            Generate a GRUB keyboard layout file. Below is the command for a french keyboard. For other languages, check /usr/share/X11/xkb/symbols/. Filename choice is not important (you can change bepo).



            sudo grub-kbdcomp -o /boot/grub/bepo.gkb fr


            Edit /etc/default/grub with root rights to have:



            #GRUB_HIDDEN_TIMEOUT=0
            GRUB_TERMINAL_INPUT="at_keyboard"


            Edit /etc/grub.d/40_custom with root rights to have:



            #!/bin/sh
            exec tail -n +3 $0

            insmod keylayouts
            keymap /boot/grub/bepo.gkb


            Finally:



            sudo update-grub


            Note: Forget immediately about using the Shift key to display GRUB menu! It may be normal that terminal_input at_keyboard make this key not work anymore. So make sure #GRUB_HIDDEN_TIMEOUT=0 is properly commented.






            share|improve this answer























            • Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
              – Xerus
              Apr 22 at 16:46










            • Link is dead and solution isn't bullet proof on laptops.
              – Zulgrib
              Apr 27 at 11:48















            up vote
            6
            down vote



            accepted










            First, check that you're using GRUB 2 (GRUB 0.x works differently).



            grub-install --version


            Generate a GRUB keyboard layout file. Below is the command for a french keyboard. For other languages, check /usr/share/X11/xkb/symbols/. Filename choice is not important (you can change bepo).



            sudo grub-kbdcomp -o /boot/grub/bepo.gkb fr


            Edit /etc/default/grub with root rights to have:



            #GRUB_HIDDEN_TIMEOUT=0
            GRUB_TERMINAL_INPUT="at_keyboard"


            Edit /etc/grub.d/40_custom with root rights to have:



            #!/bin/sh
            exec tail -n +3 $0

            insmod keylayouts
            keymap /boot/grub/bepo.gkb


            Finally:



            sudo update-grub


            Note: Forget immediately about using the Shift key to display GRUB menu! It may be normal that terminal_input at_keyboard make this key not work anymore. So make sure #GRUB_HIDDEN_TIMEOUT=0 is properly commented.






            share|improve this answer























            • Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
              – Xerus
              Apr 22 at 16:46










            • Link is dead and solution isn't bullet proof on laptops.
              – Zulgrib
              Apr 27 at 11:48













            up vote
            6
            down vote



            accepted







            up vote
            6
            down vote



            accepted






            First, check that you're using GRUB 2 (GRUB 0.x works differently).



            grub-install --version


            Generate a GRUB keyboard layout file. Below is the command for a french keyboard. For other languages, check /usr/share/X11/xkb/symbols/. Filename choice is not important (you can change bepo).



            sudo grub-kbdcomp -o /boot/grub/bepo.gkb fr


            Edit /etc/default/grub with root rights to have:



            #GRUB_HIDDEN_TIMEOUT=0
            GRUB_TERMINAL_INPUT="at_keyboard"


            Edit /etc/grub.d/40_custom with root rights to have:



            #!/bin/sh
            exec tail -n +3 $0

            insmod keylayouts
            keymap /boot/grub/bepo.gkb


            Finally:



            sudo update-grub


            Note: Forget immediately about using the Shift key to display GRUB menu! It may be normal that terminal_input at_keyboard make this key not work anymore. So make sure #GRUB_HIDDEN_TIMEOUT=0 is properly commented.






            share|improve this answer














            First, check that you're using GRUB 2 (GRUB 0.x works differently).



            grub-install --version


            Generate a GRUB keyboard layout file. Below is the command for a french keyboard. For other languages, check /usr/share/X11/xkb/symbols/. Filename choice is not important (you can change bepo).



            sudo grub-kbdcomp -o /boot/grub/bepo.gkb fr


            Edit /etc/default/grub with root rights to have:



            #GRUB_HIDDEN_TIMEOUT=0
            GRUB_TERMINAL_INPUT="at_keyboard"


            Edit /etc/grub.d/40_custom with root rights to have:



            #!/bin/sh
            exec tail -n +3 $0

            insmod keylayouts
            keymap /boot/grub/bepo.gkb


            Finally:



            sudo update-grub


            Note: Forget immediately about using the Shift key to display GRUB menu! It may be normal that terminal_input at_keyboard make this key not work anymore. So make sure #GRUB_HIDDEN_TIMEOUT=0 is properly commented.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Dec 1 at 9:12

























            answered Mar 28 '16 at 22:54









            KrisWebDev

            6531617




            6531617












            • Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
              – Xerus
              Apr 22 at 16:46










            • Link is dead and solution isn't bullet proof on laptops.
              – Zulgrib
              Apr 27 at 11:48


















            • Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
              – Xerus
              Apr 22 at 16:46










            • Link is dead and solution isn't bullet proof on laptops.
              – Zulgrib
              Apr 27 at 11:48
















            Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
            – Xerus
            Apr 22 at 16:46




            Trying this on Linux Mint 18.3 with german locale (de) completely disabled my keyboard while in grub. Probably because grub-kbdcomp reported multiple times invalid code and invalid identifier
            – Xerus
            Apr 22 at 16:46












            Link is dead and solution isn't bullet proof on laptops.
            – Zulgrib
            Apr 27 at 11:48




            Link is dead and solution isn't bullet proof on laptops.
            – Zulgrib
            Apr 27 at 11:48












            up vote
            1
            down vote













            Fine-tuning my grub (2.02-2ubuntu8.3), on an old fully functional Asus N73JF (multiboot Windows 7, Windows recovery, Ubuntu 15.10, Ubuntu 18.04...) a custom menu was not an option for me.



            sudo grub-kbdcomp -o /boot/grub/layouts/laptop.gkb fr


            (Ubuntu's grub2 uses /boot/grub/layouts from 15.10).



            Next, I don't open /etc/default/grub nor /etc/grub.d/40_custom: I edit /etc/grub.d/00_header where I replace



                cat << EOF
            set gfxmode=${GRUB_GFXMODE}
            load_video
            insmod gfxterm
            EOF


            with



                cat << EOF
            set gfxmode=${GRUB_GFXMODE}
            load_video
            insmod gfxterm
            insmod terminal
            terminal_output gfxterm
            insmod keylayouts
            insmod at_keyboard
            terminal_input at_keyboard
            keymap laptop
            EOF


            Thanks to KrisWebDev for his question-answer: I learn a lot looking inside /boot/grub/i386-pc/.






            share|improve this answer

























              up vote
              1
              down vote













              Fine-tuning my grub (2.02-2ubuntu8.3), on an old fully functional Asus N73JF (multiboot Windows 7, Windows recovery, Ubuntu 15.10, Ubuntu 18.04...) a custom menu was not an option for me.



              sudo grub-kbdcomp -o /boot/grub/layouts/laptop.gkb fr


              (Ubuntu's grub2 uses /boot/grub/layouts from 15.10).



              Next, I don't open /etc/default/grub nor /etc/grub.d/40_custom: I edit /etc/grub.d/00_header where I replace



                  cat << EOF
              set gfxmode=${GRUB_GFXMODE}
              load_video
              insmod gfxterm
              EOF


              with



                  cat << EOF
              set gfxmode=${GRUB_GFXMODE}
              load_video
              insmod gfxterm
              insmod terminal
              terminal_output gfxterm
              insmod keylayouts
              insmod at_keyboard
              terminal_input at_keyboard
              keymap laptop
              EOF


              Thanks to KrisWebDev for his question-answer: I learn a lot looking inside /boot/grub/i386-pc/.






              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                Fine-tuning my grub (2.02-2ubuntu8.3), on an old fully functional Asus N73JF (multiboot Windows 7, Windows recovery, Ubuntu 15.10, Ubuntu 18.04...) a custom menu was not an option for me.



                sudo grub-kbdcomp -o /boot/grub/layouts/laptop.gkb fr


                (Ubuntu's grub2 uses /boot/grub/layouts from 15.10).



                Next, I don't open /etc/default/grub nor /etc/grub.d/40_custom: I edit /etc/grub.d/00_header where I replace



                    cat << EOF
                set gfxmode=${GRUB_GFXMODE}
                load_video
                insmod gfxterm
                EOF


                with



                    cat << EOF
                set gfxmode=${GRUB_GFXMODE}
                load_video
                insmod gfxterm
                insmod terminal
                terminal_output gfxterm
                insmod keylayouts
                insmod at_keyboard
                terminal_input at_keyboard
                keymap laptop
                EOF


                Thanks to KrisWebDev for his question-answer: I learn a lot looking inside /boot/grub/i386-pc/.






                share|improve this answer












                Fine-tuning my grub (2.02-2ubuntu8.3), on an old fully functional Asus N73JF (multiboot Windows 7, Windows recovery, Ubuntu 15.10, Ubuntu 18.04...) a custom menu was not an option for me.



                sudo grub-kbdcomp -o /boot/grub/layouts/laptop.gkb fr


                (Ubuntu's grub2 uses /boot/grub/layouts from 15.10).



                Next, I don't open /etc/default/grub nor /etc/grub.d/40_custom: I edit /etc/grub.d/00_header where I replace



                    cat << EOF
                set gfxmode=${GRUB_GFXMODE}
                load_video
                insmod gfxterm
                EOF


                with



                    cat << EOF
                set gfxmode=${GRUB_GFXMODE}
                load_video
                insmod gfxterm
                insmod terminal
                terminal_output gfxterm
                insmod keylayouts
                insmod at_keyboard
                terminal_input at_keyboard
                keymap laptop
                EOF


                Thanks to KrisWebDev for his question-answer: I learn a lot looking inside /boot/grub/i386-pc/.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 1 at 17:45









                Anacharsis

                163




                163






























                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f751259%2fhow-to-change-grub-command-line-grub-shell-keyboard-layout%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

                    Ellipse (mathématiques)

                    Quarter-circle Tiles

                    Mont Emei