Documentation
¶
Overview ¶
Command vmkey drives a running QEMU guest's keyboard over its QMP socket, so you can interact with a VM that has no working network yet (e.g. a WinPE or freshly-installed Windows whose NIC driver has not loaded, so SSH/RDP are dead). It talks to the same QMP unix socket the screenshot poller uses, so run it on the host where QEMU runs (e.g. the Mac under HVF), pointing -qmp at the socket the run created under its output dir.
Usage:
vmkey -qmp <socket> type "powershell -NoProfile" # type an ASCII string vmkey -qmp <socket> key meta_l r # one chord (Win+R) vmkey -qmp <socket> key ctrl alt delete # secure attention seq vmkey -qmp <socket> enter # press Return vmkey -qmp <socket> run "powershell" # Win+R, type, Enter
Recipe to open an elevated PowerShell on the Windows desktop and dump the first-logon logs to the C: root (read them later by mounting the qcow2):
vmkey -qmp S run "powershell" vmkey -qmp S type "Copy-Item C:\Windows\Panther\UnattendGC\setupact.log,C:\Windows\INF\setupapi.dev.log C:\ ; Get-NetAdapter | Out-File C:\netadapter.txt" vmkey -qmp S enter
Click to show internal directories.
Click to hide internal directories.