53

I'm doing an install via testdrive using QEMU/KVM and I would like to check the log files during the installation, however I can't figure out a way to send Ctrl-Alt-F1 and other F keys to the virtualized window (It instead goes to the TTY on the host machine).

Ctrl-Alt-1 through 4 send me to some kind of QEMU consoles (the installer is on one, then there are qemu consoles and one serial and one parallel, so I think I'm getting close.

Jorge Castro
  • 73,717

4 Answers4

59

sendkey can be used to send keys to the virtual system that your host intercepts at low level - such as Ctrl + Alt + F*.

  1. Use Ctrl + Alt + 2 to switch to the QEMU console.
  2. Type sendkey ctrl-alt-f1 and press Enter.
  3. Use Ctrl + Alt + 1 to switch back to the virtual system, which should now by at TTY1.

Once at a virtual terminal, you should be able to use the chvt command, e.g. sudo chvt 7 to go back to your X session.

htorque
  • 66,086
23

You can change tty in the guest os running on qemu with ALT + left or right arrows on the keypad.

6

You can try using sticky keys: Press the first key three times to "stick" it to the "virtualized window" followed by the other keys e.g. CTRL+CTRL+CTRL+ALT+F1.

This should send the command to the virtual machine instead of the host machine "hijacking" it.

Peachy
  • 7,235
  • 10
  • 40
  • 47
0

It's also possible to exit the installer by pressing Ctrl+C giving you a log or a console. I found Alt+Left/Right and Alt+F# was mapped by my wayland compositor, and sendkey didn't work when the VM used a serial console with no graphics, but Ctrl+C still worked. Once you exit the last shell, the installer should start back up.

nathan
  • 101