Skip to content

Instantly share code, notes, and snippets.

@orgcontrib
Last active June 12, 2026 21:55
Show Gist options
  • Select an option

  • Save orgcontrib/ae684fc6ded87d366fb6aca7deb2b025 to your computer and use it in GitHub Desktop.

Select an option

Save orgcontrib/ae684fc6ded87d366fb6aca7deb2b025 to your computer and use it in GitHub Desktop.
GNOME Boxes: Linux host, Windows guest (!)
##########################
# QEMU Guest Agent HOWTO #
##########################
# Linux Host (Fedora)
# To use virsh command, you need:
$ sudo dnf -y install libvirt-client
# Windows Guest (11 Pro)
# You need the qemu-ga:
> winget install RedHat.VirtIO
> sc query qemu-ga |findstr "STATE"
# The Problem (configuration)
# With domain/VM running, you try:
$ virsh list
Id Name State
--------------------------
1 win11pro running
$ virsh guestinfo win11pro
error: argument unsupported: QEMU guest agent is not configured
# Alternatively, it may be one of these error return codes:
$ curl https://libvirt.org/html/libvirt-virterror.html |pup 'table tr:nth-last-of-type(n+2) a' |rg VIR_ERR_AGENT_ |rg -v id=
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 58808 100 58808 0 0 121.5k 0 0
VIR_ERR_AGENT_UNRESPONSIVE
VIR_ERR_AGENT_UNSYNCED
VIR_ERR_AGENT_COMMAND_TIMEOUT
VIR_ERR_AGENT_COMMAND_FAILED
$
Q: What's the problem and how to fix it?
A: Well, as you should know, GNOME Boxes is a minimalist tool that "just works".
A: When it creates the domain/VM definition, it's NOT configuring a qemu-ga dedicated communication channel.
# See https://wiki.libvirt.org/Qemu_guest_agent.html#setting-qemu-ga-up
# See https://libvirt.org/formatdomain.html#channel
# You need to edit the domain/VM XML and add the missing channel (after the console block).
$ virsh edit win11pro
# Insert these lines:
<channel type='unix'>
<source mode='bind'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
# Libvirt will figure it out when you save it. (tested on F44)
Q: How to verify the result (and how it should look like)?
# Method-1
# NB: if you don't have rg, use grep.
$ virsh dumpxml win11pro |rg -C2 'org.qemu.guest_agent.0'
</console>
<channel type='unix'>
<target type='virtio' name='org.qemu.guest_agent.0'/>
<address type='virtio-serial' controller='0' bus='0' port='3'/>
</channel>
$
# Method-2
$ virsh dumpxml win11pro |xmllint --xpath "//domain/devices/channel[@type='unix']" -
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"/>
<address type="virtio-serial" controller="0" bus="0" port="3"/>
</channel>
$
# Now start your domain/VM, and check again:
$ virsh guestinfo win11pro
user.count : 1
user.0.name : vmuser
user.0.domain : VMELEVEN
user.0.login-time : 1780698157543
os.id : mswindows
os.name : Microsoft Windows
os.pretty-name : Windows 10 Pro
os.version : Microsoft Windows 11
os.version-id : 11
os.machine : x86_64
os.variant : client
os.variant-id : client
os.kernel-release : 22631
os.kernel-version : 10.0
timezone.name : GTB Daylight Time
timezone.offset : 10800
hostname : VMELEVEN
fs.count : 2
fs.0.name : \\?\Volume{c53a2aa0-0171-45a9-b531-c259fc3d9d19}\
fs.0.mountpoint : C:\
fs.0.fstype : NTFS
fs.0.total-bytes : 53670309888
fs.0.used-bytes : 37538541568
fs.0.disk.count : 1
fs.0.disk.0.serial : QM00001
fs.0.disk.0.device : \\.\PhysicalDrive0
fs.1.name : \\?\Volume{e0655436-e9a5-45dc-9bd0-a162b4df0acb}\
fs.1.mountpoint : System Reserved
fs.1.fstype : FAT32
fs.1.disk.count : 1
fs.1.disk.0.serial : QM00001
fs.1.disk.0.device : \\.\PhysicalDrive0
disk.count : 1
disk.0.name : \\.\PhysicalDrive0
disk.0.partition : no
disk.0.serial : QM00001
disk.0.guest_bus : sata
if.count : 2
if.0.name : Ethernet
if.0.hwaddr : 52:54:00:59:81:23
if.0.addr.count : 2
if.0.addr.0.type : ipv6
if.0.addr.0.addr : fe80::7467:2ea2:93fc:8963%7
if.0.addr.0.prefix : 64
if.0.addr.1.type : ipv4
if.0.addr.1.addr : 192.168.122.217
if.0.addr.1.prefix : 24
if.1.name : Loopback Pseudo-Interface 1
if.1.hwaddr :
if.1.addr.count : 2
if.1.addr.0.type : ipv6
if.1.addr.0.addr : ::1
if.1.addr.0.prefix : 128
if.1.addr.1.type : ipv4
if.1.addr.1.addr : 127.0.0.1
if.1.addr.1.prefix : 8
load.1m : 0.000000
load.5m : 0.000000
load.15m : 0.000000
$
@orgcontrib

Copy link
Copy Markdown
Author

Reated upstream RFE-ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment