[PR #312] ui: add optional keystroke logging for keyboard events #440

Open
opened 2026-01-31 21:31:17 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/qemu/qemu/pull/312

State: closed
Merged: No


To see characters echoed in the UEFI shell, launch with USB keyboard on XHCI (and logging still works):

export QEMU_KEYLOG_PATH="$PWD/keystrokes.log"
./build/qemu-system-aarch64-unsigned
-M virt -cpu cortex-a72 -m 512M
-display cocoa
-device virtio-gpu-pci
-device qemu-xhci
-device usb-kbd
-device usb-mouse
-monitor none
-serial null
-drive if=pflash,format=raw,readonly=on,file=build/pc-bios/edk2-aarch64-code.fd
-drive if=pflash,format=raw,file=build/pc-bios/edk2-arm-vars.fd

Build steps used on macOS M1:

  • Install deps: brew install pkg-config meson ninja glib pixman libslirp dtc sdl2 gnutls.
  • From repo root: rm -rf build && mkdir build.
  • Configure for aarch64 with Cocoa/slirp (DTC include/lib set for Homebrew):

cd build
CFLAGS='-I/opt/homebrew/opt/dtc/include'
LDFLAGS='-L/opt/homebrew/opt/dtc/lib'
PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig
../configure --target-list=aarch64-softmmu --enable-cocoa --enable-slirp --disable-werror

  • Build: ninja (or ninja -C build from repo root).
  • Binary to run: build/qemu-system-aarch64-unsigned.
**Original Pull Request:** https://github.com/qemu/qemu/pull/312 **State:** closed **Merged:** No --- To see characters echoed in the UEFI shell, launch with USB keyboard on XHCI (and logging still works): export QEMU_KEYLOG_PATH="$PWD/keystrokes.log" ./build/qemu-system-aarch64-unsigned \ -M virt -cpu cortex-a72 -m 512M \ -display cocoa \ -device virtio-gpu-pci \ -device qemu-xhci \ -device usb-kbd \ -device usb-mouse \ -monitor none \ -serial null \ -drive if=pflash,format=raw,readonly=on,file=build/pc-bios/edk2-aarch64-code.fd \ -drive if=pflash,format=raw,file=build/pc-bios/edk2-arm-vars.fd Build steps used on macOS M1: - Install deps: brew install pkg-config meson ninja glib pixman libslirp dtc sdl2 gnutls. - From repo root: rm -rf build && mkdir build. - Configure for aarch64 with Cocoa/slirp (DTC include/lib set for Homebrew): cd build CFLAGS='-I/opt/homebrew/opt/dtc/include' \ LDFLAGS='-L/opt/homebrew/opt/dtc/lib' \ PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:/opt/homebrew/share/pkgconfig \ ../configure --target-list=aarch64-softmmu --enable-cocoa --enable-slirp --disable-werror - Build: ninja (or ninja -C build from repo root). - Binary to run: build/qemu-system-aarch64-unsigned.
claunia added the pull-request label 2026-01-31 21:31:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/qemu#440