Open-sourcing the Virtainer guest agent
The Virtainer Guest Agent provides guest information, filesystem freeze, live resource activation and an interactive Shell. It is independently available under Apache-2.0.
We are releasing the Virtainer Guest Agent as open source under Apache-2.0. It gives a host information and controls inside a running guest: IP addresses, filesystem freeze for consistent snapshots, clock settings and an interactive Shell. This article covers the x86_64 Linux agent introduced with this release.
The code and current support information are at github.com/virtainer/virtainer-guest-agent. Downloads are on the Releases page. The project stands on its own; you do not need to use Virtainer to inspect, build or integrate it.
Why a guest agent
A VM can boot and run without an agent, but the host cannot reliably discover everything happening inside it. An agent lets the host report guest addresses, coordinate supported snapshot operations and offer a terminal even when the guest has no working network connection.
Live resource changes need guest cooperation too. Some Linux images leave newly added CPUs or memory offline. The agent brings those resources online, so a successful host-side resize can become usable capacity inside the guest.
Compatibility and limits
The agent supports clients using the QEMU Guest Agent (QGA) protocol for the
commands it implements. That is an interoperability interface, not a promise
that every command or every guest behaves identically. Suspend commands
(guest-suspend-*) are not supported.
The test suite compares selected read-only commands with the reference agent provided by each tested image. Other commands have separate tests against the protocol documentation; they are not all covered by reference comparisons. The repository’s README lists supported environments, command differences and the current test scope. Check those requirements before using the agent with another host platform.
What it adds
An interactive Shell. The host can open the selected guest user’s shell, resize its terminal and keep several sessions open. This does not require SSH or guest networking. It is a privileged management session, not a password-based login. Closing its connection hangs up the session; see the README for integration details and session limits.
Automatic activation of added CPUs and memory. Newly added resources are brought online inside supported Linux guests. Resources already present when the agent starts are left unchanged. This support is adapted from Kata Containers.
An auto-thaw watchdog. If the host does not request a thaw within the configured freeze timeout, the agent thaws the filesystems itself. An early thaw must not be reported as a successfully quiesced snapshot: the host still needs to verify its capture result.
Security posture
The agent runs as root and exposes root-equivalent management commands. Protect host access to the agent as carefully as root SSH access to the guest. The Shell does not add a separate privilege boundary beyond command execution.
A guest administrator can restrict commands in
/etc/virtainer-guest-agent.conf with block-rpcs and allow-rpcs.
Blocking guest-exec blocks the Shell too. Blocking just one powerful command
is not an isolation boundary when another still allows arbitrary execution or
file writes; review the complete allowed command set.
Install only binaries and installation media you trust. Build them from source or verify their checksums against a separately trusted source. Installation and automatic updates run with guest administrative privileges.
To report a vulnerability, use Security → Report a vulnerability on the repository rather than opening a public issue. The details are in SECURITY.md.
Using it
In Virtainer, enable Virtainer Guest Agent (VGA) when creating a classic VM. The host supplies the agent at boot without a guest download. See the guest-agent guide for available features, updates and what happens when the agent is disabled.
For an independent integration, follow the installation and host-interface instructions in the project’s README. It contains the supported deployment methods and protocol details; use those requirements rather than assuming that an arbitrary platform is compatible.
License and contributions
The code is under the Apache License 2.0. The CPU and memory activation support
in src/autoonline.rs is adapted from Kata Containers, also Apache-2.0, and its
notice ships with the binary. The QGA protocol is implemented from its
published documentation and observed behavior; no QEMU code is included.
Contributions are welcome. CONTRIBUTING.md in the repository covers build and
test commands. When reporting a problem, include the guest distribution and
version and compare it with the environments and test coverage listed in the
README.