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

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.

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

  • use the QEMU monitor (same as Ctral-A C) with telnet:

    qemu-system-x86_64 -monitor telnet::45454,server,nowait -serial mon:stdio
    

    and on a host terminal:

    telnet localhost 45454
    

    and then quit from there.

    -serial mon:stdio is 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

  • powerdown from a guest 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

Tested in Ubuntu 17.10, QEMU 2.10.1.


To close a QEMU process in your shell:

ctrl+a, then x


Press Cntl-Alt-2 and then use the close button on the menu.

enter image description here

You can find more useful shortcuts here

Tags:

Qemu