Boxwright.Qmp 0.3.0

dotnet add package Boxwright.Qmp --version 0.3.0
                    
NuGet\Install-Package Boxwright.Qmp -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Boxwright.Qmp" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Boxwright.Qmp" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Boxwright.Qmp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Boxwright.Qmp --version 0.3.0
                    
#r "nuget: Boxwright.Qmp, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Boxwright.Qmp@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Boxwright.Qmp&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Boxwright.Qmp&version=0.3.0
                    
Install as a Cake Tool

Boxwright.Qmp

A small, dependency-free C# client for the QEMU Machine Protocol (QMP) and the QEMU Guest Agent (QGA). It talks to a running qemu-system-* over a TCP or Unix-domain socket — connect, run correlated commands, observe events — using only System.Text.Json and the base class library (no third-party packages, no UI framework).

It's the protocol layer of Boxwright, a cross-platform QEMU GUI, and is designed to stand on its own.

Install

dotnet add package Boxwright.Qmp

QMP — connect and run a command

using System.Text.Json;
using Boxwright.Qmp;

await using var client = new QmpClient();

// Performs the greeting + qmp_capabilities handshake.
await client.ConnectAsync(QmpEndpoint.Tcp("127.0.0.1", 4444));

// Correlated request/response.
JsonElement status = await client.ExecuteAsync("query-status");
Console.WriteLine(status.GetProperty("status").GetString()); // e.g. "running"

// Asynchronous events are exposed as IObservable<QmpEvent> on client.Events.

Launch QEMU with a QMP server, e.g.:

qemu-system-x86_64 ... -qmp tcp:127.0.0.1:4444,server,nowait

QEMU Guest Agent

using Boxwright.Qmp;

await using var agent = new QgaClient();
await agent.ConnectAsync("127.0.0.1", 4445);
if (await agent.PingAsync())
{
    foreach (string ip in await agent.GetIpAddressesAsync())
        Console.WriteLine(ip);
}

Scope

  • Connect to a QMP endpoint (TCP or Unix socket) and run the qmp_capabilities handshake.
  • Send execute commands with correlated, awaitable replies.
  • Surface asynchronous QMP events (SHUTDOWN, RESET, STOP, …) as a stream.
  • Probe query-qmp-schema for capability detection.
  • A minimal QEMU Guest Agent client (ping, shutdown, guest IP addresses).

Connection retry/policy logic lives in the consuming application, not here. Tested against an in-memory loopback fake server — no live QEMU required.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 42 6/2/2026
0.2.0 45 6/2/2026
0.1.0 51 6/1/2026

0.3.0 — version aligned with the Boxwright 0.3.0 release. No public QMP/QGA API changes since 0.1.0.