Installing Guest Tools (Guest Agent, VirtIO Drivers, vTPM)

Installing the right tools inside the guest unlocks features the platform relies on — reporting the IP address, graceful shutdown, application-consistent snapshots, and (for Windows) usable disk and network drivers.

QEMU guest agent

The QEMU guest agent lets the platform read the guest IP, shut the guest down gracefully, and freeze the filesystem for application-consistent snapshots. Without it, online snapshots are only crash-consistent.

  • Linux — install and enable the agent from the distribution packages:

    # RHEL / CentOS / Fedora
    sudo dnf install -y qemu-guest-agent && sudo systemctl enable --now qemu-guest-agent
    # Debian / Ubuntu
    sudo apt-get install -y qemu-guest-agent && sudo systemctl enable --now qemu-guest-agent
  • Windows — install the guest agent from the virtio-win media (guest-agent\qemu-ga-x86_64.msi).

When the agent is running, VirtualMachineInstance.status.conditions includes AgentConnected=True and the IP address appears in the console and in status.interfaces.

VirtIO drivers (Windows)

Windows has no built-in VirtIO drivers, so a freshly installed Windows guest cannot see its VirtIO disk or NIC until the drivers are installed. Attach the virtio-win container disk as a CD-ROM and install the drivers:

  • During Windows setup, Load driver from the virtio-win CD-ROM (viostor for the boot disk).
  • After installation, run virtio-win-guest-tools.exe from the same media to install all drivers plus the guest agent.

Virtual TPM (vTPM)

Windows 11 and BitLocker require a TPM 2.0 device. Add a virtual TPM to the virtual machine through spec.template.spec.domain.devices.tpm:

spec:
  template:
    spec:
      domain:
        devices:
          tpm: {}
        firmware:
          bootloader:
            efi:
              secureBoot: true   # Windows 11 also requires UEFI + Secure Boot

Note that a vTPM's persistent state is not included in virtual machine snapshots or clones.