41

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?

75

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:

Tested in Ubuntu 17.10, QEMU 2.10.1.

2
  • The example in the other answer is clearer "ctrl+a, then x" – vharron Sep 25 '19 at 21:17
  • @vharron yes, my amazing explanation skills have finally been surpassed – Ciro Santilli新疆棉花TRUMP BAN BAD Sep 25 '19 at 21:19
4

To close a QEMU process in your shell:

ctrl+a, then x

1
4

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

enter image description here

You can find more useful shortcuts here

1
  • I found the Ctrl part unnecessary. Alt-2 does the job. – Jet Blue Sep 16 '20 at 23:03
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
1
  • 4
    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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.