I configured Qemu's grub the following way:

GRUB_TERMINAL="serial console"

and run the qemu process with the -nographic command line option. These enables to use the current terminal for the serial console and qemu monitor console. However now, anytime I press Ctrl+C inside the running VM, it is intercepted by qemu and shuts the process down.

How am I supposed to pass Ctrl+C or any other keystroke involving CTRL in Qemu?

3 Answers 3


In your shell, before you run qemu, run "stty intr ^]" to change the interrupt key from ^c to ctrl-]

That way, ctrl-c will be passed through to qemu, but you can still interrupt qemu itself by pressing ctrl-]

  • 2
    To override Ctrl-Z (backgrounding) too, there is stty susp ^]. For Ctrl-\ (quit), use stty quit ^]. With multiple definitions for a single char, this is the order of precedence: intr quit susp.
    – Lekensteyn
    Commented Aug 7, 2015 at 12:49
  • To override all characters that generate signals (like SIGINT and SIGSTOP), use stty -isig. To save the and restore the settings, use (trap "stty $(stty -g)" 0; stty -isig; qemu-system-....) Commented Jan 31 at 1:54

You can try using the sendkey command using -monitor stdio. Though apparently the -display none -serial mon:stdio option should pass Ctrl + c through to the guest.

You can also create a monitor socket, like this:

qemu -display none -monitor unix:/tmp/qemu-monitor,server,nowait

And then, connect to the monitor to use sendkey with socat like this:

socat - UNIX-CONNECT:/tmp/qemu-monitor

You can now send your keys, like this:

(qemu) sendkey ctrl-c
sendkey ctrl-c
  • Thanks. Could you tell me how can I 'jump' into qemy monitor console (ie. what keystroke should I press), if I run qemu in the PuTTY terminal?
    – Mark
    Commented Nov 11, 2014 at 12:42
  • 1
    In GUI - Ctrl + Alt then Shift + 2 to switch to the monitor, or Shift-1 to switch back to guest OS. That doesn't work in console. There you can use the socket approach, and open up another screen window and connect to it via socat. You can also use -monitor stdio to redirect to your terminal instead. Commented Nov 11, 2014 at 12:51

Remove -monitor or add -serial mon:stdio

As of QEMU 2.10.1, Ubuntu 17.10, Ctrl-C does get passed by default to the guest without problem when using -nographic.

However, if you also use the -monitor option, behavior changes, and the Ctrl-C kills QEMU instead.

This is how -monitor would normally be used: How to switch to the QEMU control panel with -nographics? | Super User

If you need -monitor, you can get Ctrl+C back with -serial mon:stdio: How to run qemu with -nographic and -monitor but still be able to send Ctrl+C to the guest and quit with Ctrl+A X? | Stack Overflow

  • 1
    this is the very amazing answer!
    – Alex
    Commented May 18 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .