How can I ctrl-alt-f# to get to a TTY in a QEMU session?
sendkey
can be used to send keys to the virtual system that your host intercepts at low level - such as Ctrl + Alt + F*.
- Use Ctrl + Alt + 2 to switch to the QEMU console.
- Type
sendkey ctrl-alt-f1
and press Enter. - 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.
You can change tty in the guest os running on qemu with ALT
+ left or right arrows on the keypad.
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.