36

When passing "-curses" option to qemu, qemu displays the emulation window as default. So, how can I switch to the monitor console from the emulation window? If using graphical interface, switching between emulation window and monitor console can be achieved by "ctrl+alt+(1 or 2)". I am just not sure how to do this in the non-graphical case.

tshepang
  • 11,360
  • 21
  • 88
  • 132
pusam
  • 393
  • 1
  • 3
  • 5

5 Answers5

31

Just use Esc instead of Ctrl-Alt. So to switch to the monitor console use Esc+2. To switch back to the terminal output use Esc+1. You can similarly switch ptys with Esc+F2 etc.

fuzzyTew
  • 3,105
  • 25
  • 23
minipli
  • 311
  • 3
  • 3
  • Hi, the ESC+1 and ESC+2 worked great for me for years. But now that I upgraded my system and I'm using QEMU 4.2.0, those shortcuts for switching to the monitor and back don't work anymore. Any ideas? Note: Alt+1, Alt+2 still work, but I need to use ESC+1, ESC+2 to avoid conflicts with the other shortcuts of the terminal emulator. How can I re-enable ESC+1, ESC+2 ? – vvaltchev May 22 '20 at 11:50
26

From the section keys in the character backend multiplexer in the QEMU docs:

During emulation, if you are using a character backend multiplexer (which is the default if you are using -nographic) then several commands are available via an escape sequence. These key sequences all start with an escape character, which is Ctrl-a by default, but can be changed with -echr. The list below assumes you’re using the default.

Ctrl-a c

Rotate between the frontends connected to the multiplexer (usually this switches between the monitor and the console)

Andrew Marshall
  • 92,562
  • 20
  • 215
  • 211
nikitis
  • 261
  • 3
  • 2
  • 1
    Beware that if you also use `-monitor` without `-serial mon:stdio`, QEMU disables this escape sequence: https://stackoverflow.com/questions/49716931/how-to-run-qemu-with-nographic-and-monitor-but-still-be-able-to-send-ctrlc-to/49751144#49751144 – Ciro Santilli Путлер Капут 六四事 Apr 11 '18 at 12:43
  • Linked documentation is unfortunately dead, wayback machine link: https://web.archive.org/web/20131223164110/http://wiki.qemu.org/download/qemu-doc.html#Keys Use `Ctrl+a`, `c` again to toggle back. – NiKiZe Jul 31 '21 at 14:02
13

Doesn't appear to be possible. However, you can access the monitor console via Telnet.

Start QEMU:

qemu-system-i386 -curses -monitor telnet:127.0.0.1:1234,server,nowait

Then, to access the monitor console, type this in another terminal:

telnet 127.0.0.1 1234
Søren Løvborg
  • 7,844
  • 2
  • 42
  • 39
13

alt + 2

Just drop the 'ctrl' and all of the key sequences work as expected.

Undo
  • 25,381
  • 37
  • 106
  • 126
Anthony Liguori
  • 131
  • 1
  • 2
1

None of the above worked for me. I have Ubuntu 16.04, I don't think this matters.

Ctrl + Alt + 2 worked for me.

rajiv_
  • 676
  • 7
  • 13