How to quit the QEMU monitor when not using a GUI?












7















I'm running QEMU on Linux without GUI.



After running starting my custom kernel with QEMU, I can't kill and return to host by pressing Ctrl+C.



Is there any way to get back to host OS?










share|improve this question





























    7















    I'm running QEMU on Linux without GUI.



    After running starting my custom kernel with QEMU, I can't kill and return to host by pressing Ctrl+C.



    Is there any way to get back to host OS?










    share|improve this question



























      7












      7








      7


      4






      I'm running QEMU on Linux without GUI.



      After running starting my custom kernel with QEMU, I can't kill and return to host by pressing Ctrl+C.



      Is there any way to get back to host OS?










      share|improve this question
















      I'm running QEMU on Linux without GUI.



      After running starting my custom kernel with QEMU, I can't kill and return to host by pressing Ctrl+C.



      Is there any way to get back to host OS?







      qemu






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 22 '17 at 5:52









      Ciro Santilli 新疆改造中心 六四事件 法轮功

      3,97622734




      3,97622734










      asked Jun 10 '16 at 22:48









      NaftalyNaftaly

      138115




      138115






















          3 Answers
          3






          active

          oldest

          votes


















          17














          Ctrl-A X



          For -nographic just enter:



          Ctrl-A X


          which means




          1. first press Ctrl + A (A is just key a, not the alt key),

          2. then release the keys,

          3. afterwards type X.


          The same rule applies to Ctrl-A C.



          Alternatively:




          • enter the QEMU monitor with Ctrl-A C and then run quit. See also: https://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses


          • powerdown from a shell if you are able. This does not work for all machines however: https://stackoverflow.com/questions/31990487/how-to-cleanly-exit-qemu-after-executing-bare-metal-program-without-user-interve

          • use the -monitor telnet::45454,server,nowait -serial mon:stdio and telnet localhost 45454. -serial mon:stdio required to keep Ctrl+C working: https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144


          Tested in Ubuntu 17.10, QEMU 2.10.1.






          share|improve this answer

































            1














            To close a QEMU process in your shell:



            ctrl+a, then x






            share|improve this answer































              0














              Ok, found a solution.




              1. Opened new terminal session: ctrl+alt+f2

              2. Used ps to find PID of previous tty: ps -fu

              3. Killed previous tty: kill -HUP PID






              share|improve this answer



















              • 1





                This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                – EFraim
                Aug 21 '18 at 8:05













              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              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%2fsuperuser.com%2fquestions%2f1087859%2fhow-to-quit-the-qemu-monitor-when-not-using-a-gui%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              17














              Ctrl-A X



              For -nographic just enter:



              Ctrl-A X


              which means




              1. first press Ctrl + A (A is just key a, not the alt key),

              2. then release the keys,

              3. afterwards type X.


              The same rule applies to Ctrl-A C.



              Alternatively:




              • enter the QEMU monitor with Ctrl-A C and then run quit. See also: https://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses


              • powerdown from a shell if you are able. This does not work for all machines however: https://stackoverflow.com/questions/31990487/how-to-cleanly-exit-qemu-after-executing-bare-metal-program-without-user-interve

              • use the -monitor telnet::45454,server,nowait -serial mon:stdio and telnet localhost 45454. -serial mon:stdio required to keep Ctrl+C working: https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144


              Tested in Ubuntu 17.10, QEMU 2.10.1.






              share|improve this answer






























                17














                Ctrl-A X



                For -nographic just enter:



                Ctrl-A X


                which means




                1. first press Ctrl + A (A is just key a, not the alt key),

                2. then release the keys,

                3. afterwards type X.


                The same rule applies to Ctrl-A C.



                Alternatively:




                • enter the QEMU monitor with Ctrl-A C and then run quit. See also: https://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses


                • powerdown from a shell if you are able. This does not work for all machines however: https://stackoverflow.com/questions/31990487/how-to-cleanly-exit-qemu-after-executing-bare-metal-program-without-user-interve

                • use the -monitor telnet::45454,server,nowait -serial mon:stdio and telnet localhost 45454. -serial mon:stdio required to keep Ctrl+C working: https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144


                Tested in Ubuntu 17.10, QEMU 2.10.1.






                share|improve this answer




























                  17












                  17








                  17







                  Ctrl-A X



                  For -nographic just enter:



                  Ctrl-A X


                  which means




                  1. first press Ctrl + A (A is just key a, not the alt key),

                  2. then release the keys,

                  3. afterwards type X.


                  The same rule applies to Ctrl-A C.



                  Alternatively:




                  • enter the QEMU monitor with Ctrl-A C and then run quit. See also: https://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses


                  • powerdown from a shell if you are able. This does not work for all machines however: https://stackoverflow.com/questions/31990487/how-to-cleanly-exit-qemu-after-executing-bare-metal-program-without-user-interve

                  • use the -monitor telnet::45454,server,nowait -serial mon:stdio and telnet localhost 45454. -serial mon:stdio required to keep Ctrl+C working: https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144


                  Tested in Ubuntu 17.10, QEMU 2.10.1.






                  share|improve this answer















                  Ctrl-A X



                  For -nographic just enter:



                  Ctrl-A X


                  which means




                  1. first press Ctrl + A (A is just key a, not the alt key),

                  2. then release the keys,

                  3. afterwards type X.


                  The same rule applies to Ctrl-A C.



                  Alternatively:




                  • enter the QEMU monitor with Ctrl-A C and then run quit. See also: https://stackoverflow.com/questions/14165158/how-to-switch-to-qemu-monitor-console-when-running-with-curses


                  • powerdown from a shell if you are able. This does not work for all machines however: https://stackoverflow.com/questions/31990487/how-to-cleanly-exit-qemu-after-executing-bare-metal-program-without-user-interve

                  • use the -monitor telnet::45454,server,nowait -serial mon:stdio and telnet localhost 45454. -serial mon:stdio required to keep Ctrl+C working: https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144


                  Tested in Ubuntu 17.10, QEMU 2.10.1.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 10 at 2:08









                  user4337

                  31




                  31










                  answered May 22 '17 at 5:50









                  Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功

                  3,97622734




                  3,97622734

























                      1














                      To close a QEMU process in your shell:



                      ctrl+a, then x






                      share|improve this answer




























                        1














                        To close a QEMU process in your shell:



                        ctrl+a, then x






                        share|improve this answer


























                          1












                          1








                          1







                          To close a QEMU process in your shell:



                          ctrl+a, then x






                          share|improve this answer













                          To close a QEMU process in your shell:



                          ctrl+a, then x







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 20 '17 at 9:55









                          NoichNoich

                          1113




                          1113























                              0














                              Ok, found a solution.




                              1. Opened new terminal session: ctrl+alt+f2

                              2. Used ps to find PID of previous tty: ps -fu

                              3. Killed previous tty: kill -HUP PID






                              share|improve this answer



















                              • 1





                                This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                                – EFraim
                                Aug 21 '18 at 8:05


















                              0














                              Ok, found a solution.




                              1. Opened new terminal session: ctrl+alt+f2

                              2. Used ps to find PID of previous tty: ps -fu

                              3. Killed previous tty: kill -HUP PID






                              share|improve this answer



















                              • 1





                                This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                                – EFraim
                                Aug 21 '18 at 8:05
















                              0












                              0








                              0







                              Ok, found a solution.




                              1. Opened new terminal session: ctrl+alt+f2

                              2. Used ps to find PID of previous tty: ps -fu

                              3. Killed previous tty: kill -HUP PID






                              share|improve this answer













                              Ok, found a solution.




                              1. Opened new terminal session: ctrl+alt+f2

                              2. Used ps to find PID of previous tty: ps -fu

                              3. Killed previous tty: kill -HUP PID







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jun 10 '16 at 23:21









                              NaftalyNaftaly

                              138115




                              138115








                              • 1





                                This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                                – EFraim
                                Aug 21 '18 at 8:05
















                              • 1





                                This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                                – EFraim
                                Aug 21 '18 at 8:05










                              1




                              1





                              This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                              – EFraim
                              Aug 21 '18 at 8:05







                              This is a really inferior solution to the most upvoted answer here. I will not downvote the answer, since it was entered before the better solutions.

                              – EFraim
                              Aug 21 '18 at 8:05




















                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • 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%2fsuperuser.com%2fquestions%2f1087859%2fhow-to-quit-the-qemu-monitor-when-not-using-a-gui%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

                              flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                              Mangá

                              Eduardo VII do Reino Unido