Linux – What numeric key codes do I need to send for the magic sysrq functionality in a VNC session

linuxmagic-sysrqvnc

I have access to the system console of a KVM guest through VNC. What key codes do I need to send for the magic sysrq sequence (Ctrl+Alt+"REISUB") in Linux?

Edit: In Linux under qemu, running showkey and the command sendkey alt-sysrq-h in the QEMU monitor reveals keycodes 99 (SysRq?), 56 (Alt), and 35 (H). Using UltraVNC Viewer's Send Custom Key command, none of those numeric codes came out correctly when entered and viewed through showkey.

Best Answer

Yes, this is possible, at least from NoVNC with KVM based guest. The trick is to understand that VNC has been built for X11. Hence, on the wire, the keycodes you need to send are the one used internally by X11.

In this specific use case, this is:

0xffe9 --> alt
0xff15 --> sysrq
0x0062 --> b

Sources

Related Question