vmkey

command
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL