virt-drivers(1)
π
virt-drivers(1) β the virt-drivers page, bestie edition
okay so this is the manual for virt-drivers, a libguestfs tool, and by the end of this page you're gonna know exactly what it does. let's go πΈ
β¨ NAME β¨
virt-drivers β detect bootloader, kernel and drivers inside guest π
π¦ SYNOPSIS π¦
virt-drivers [--options] -d domname
virt-drivers [--options] -a disk.img
literally two ways to run it, pick your vibe π
π DESCRIPTION π
bestie. this tool can detect the bootloader, kernel and drivers inside some guests from only the disk image. no booting, no drama, no "let me just spin up the VM and see". it can detect, for example, whether a disk image needs BIOS or UEFI to boot, and whether it supports virtio or requires slower emulated devices. iconic behavior honestly π
π«Ά Notes
okay real talk: normally you should distribute hypervisor metadata (eg. libvirt XML or OVF) alongside disk images to tell the hypervisor how to boot them. that's the correct, grown-up way.
this tool is used when this metadata has not been provided. so like⦠it's the fallback plan, not the main character.
work with the supplier of the disk image to get them to provide proper metadata. fr fr, ask them. it's their job π
π XML FORMAT π
the output is an XML document. at the top level it lists the operating systems found (the same as virt-inspector(1)):
<operatingsystems>
<operatingsystem>
<root>/dev/sda2</root>
<name>linux</name>
<arch>x86_64</arch>
<distro>fedora</distro>
...
</operatingsystem>
<operatingsystem>
<root>/dev/sdb1</root>
...
</operatingsystem>
</operatingsystems>
look at that. gorgeous. two whole OSes just chilling π¦
π <firmware>
the <firmware> element lists the firmware which is required to boot the guest. for UEFI it will additionally show the EFI system partition ("ESP"). guests may support multiple boot firmwares. for example this guest is detected as using UEFI boot, and the UEFI ESP is the first partition of the first disk:
<operatingsystems>
<firmware type='uefi'>/dev/sda1</firmware>
<operatingsystem>
...
the way that <firmware> sits outside the <operatingsystem>β¦ yes. that's intentional. drink water π§
π§ <bootloader> and <kernel>
the <bootloader> element shows the bootloader found in the Linux guest. if known, this may contain information about what Linux kernels are provided. for example:
<operatingsystems>
<firmware type='bios'/>
<operatingsystem>
<root>/dev/sda2</root>
<name>linux</name>
...
<bootloader type='grub2' config='/boot/grub2/grub.cfg'>
<kernel>
<name>kernel</name>
<version>6.1.0-0.rc6.46.fc38.x86_64</version>
<vmlinuz>/boot/vmlinuz-6.1.0-0.rc6.46.fc38.x86_64</vmlinuz>
<modules>
...
</modules>
<supports_virtio_blk/>
<supports_virtio_net/>
...
</kernel>
</bootloader>
ngl that supports_virtio_blk and supports_virtio_net are the parts you're really here for, iykyk π₯
many more fields are usually available for Linux guests, including a complete list of kernel modules and information about support for virtio. for a complete example see: https://github.com/libguestfs/guestfs-tools/tree/master/drivers
β <drivers>
the <drivers> element lists information about drivers found in Windows guests:
<operatingsystems>
<firmware type='bios'/>
<operatingsystem>
<root>/dev/sda2</root>
<name>windows</name>
...
<drivers>
<driver>
<name>scsidev</name>
<pci vendor='1077' device='1216' subsystem='8471101E'/>
<pci vendor='1077' device='1216' subsystem='8493101E'/>
</driver>
...
</drivers>
the driver name (eg. "scsidev") corresponds to the Windows driver .INF file (eg. scsidev.inf). the list of PCI, USB etc devices are the matching devices which would cause this driver to load at boot. so likeβ¦ it's a little matchmaking service for hardware and drivers π
π«Ά
π OPTIONS π
okay here we go, the full list, no skips, no shortcuts:
--helpβ display help. the classic.-afile,--addfile β add file which should be a disk image from a virtual machine.
the format of the disk image is auto-detected. to override this and force a particular format use the --format option.
-aURI,--addURI β add a remote disk. the URI format is compatible withguestfish. see "ADDING REMOTE STORAGE" inguestfish(1).--blocksize 512,--blocksize 4096β this parameter sets the sector size of the disk image added with-aoption and is ignored for libvirt guest added with-doption. see alsoguestfs_add_drive_optsinguestfs(3).
heads up: it's ignored when you use -d. don't come for me, that's just how it is π
--colors,--coloursβ use ANSI colour sequences to colourize messages. this is the default when the output is a tty. if the output of the program is redirected to a file, ANSI colour sequences are disabled unless you use this option. (yes, both spellings. we love options β¨)-cURI,--connectURI β if using libvirt, connect to the given URI. if omitted, then we connect to the default libvirt hypervisor.
if you specify guest block devices directly (-a), then libvirt is not used at all. like, at all. zero. none π«
-dguest,--domainguest β add all the disks from the named libvirt guest. domain UUIDs can be used instead of names. slay, UUIDs are valid too π--echo-keysβ when prompting for keys and passphrases, virt-get-kernel normally turns echoing off so you cannot see what you are typing. if you are not worried about Tempest attacks and there is no one else in the room you can specify this flag to see what you are typing.
fr, only use this if nobody's looking over your shoulder. Tempest attacks are real π
--format raw|qcow2|..,--format autoβ the default for the-aoption is to auto-detect the format of the disk image. using this forces the disk format for the-aoption on the command line.
if you have untrusted raw-format guest disk images, you should use this option to specify the disk format. this avoids a possible security problem with malicious guests (CVE-2010-3851).
this one's a security thing, not a vibe thing. take it seriously bestie π
--keySELECTOR β specify a key for LUKS, to automatically open a LUKS device when using the inspection.--keyNAME:key:KEY_STRING--keyUUID:key:KEY_STRING--key all:key:KEY_STRING
"NAME" is the libguestfs device name (eg. /dev/sda1). "UUID" is the device UUID. "all" means try the key against any encrypted device.
use the specified "KEY_STRING" as passphrase.
--keyNAME:file:FILENAME--keyUUID:file:FILENAME--key all:file:FILENAME
read the passphrase from FILENAME.
--keyNAME:clevis--keyUUID:clevis--key all:clevis
attempt passphrase-less unlocking for the device with Clevis, over the network. please refer to "ENCRYPTED DISKS" in guestfs(3) for more information on network-bound disk encryption (NBDE).
note that if any such option is present on the command line, QEMU user networking will be automatically enabled for the libguestfs appliance.
--keyNAME:error--keyUUID:error--key all:error
any encrypted device matching will cause an error. --key all:error can be used to reject any disk image that contains an encrypted partition.
lowkey iconic use case: this is how you say "nope, not touching any encrypted disk, sorry" π«π
--keys-from-stdinβ read key or passphrase parameters from stdin. the default is to try to read passphrases from the user by opening/dev/tty.
if there are multiple encrypted devices then you may need to supply multiple keys on stdin, one per line. one per line, bestie, don't mash them together π
-q,--quietβ don't print ordinary progress messages. silence. peace. π§-v,--verboseβ enable verbose messages for debugging.-V,--versionβ display version number and exit.--wrapβ wrap error, warning, and informative messages. this is the default when the output is a tty. if the output of the program is redirected to a file, wrapping is disabled unless you use this option.-xβ enable tracing of libguestfs API calls. the "show me everything" button π
πΈ ENVIRONMENT VARIABLES πΈ
for other environment variables which affect all libguestfs programs, see "ENVIRONMENT VARIABLES" in guestfs(3). it's all over there, go look π«Ά
π EXIT STATUS π
this program returns 0 if successful, or non-zero if there was an error. that's it. that's the whole section. periodt π
π SEE ALSO π
guestfs(3), guestfish(1), guestmount(1), virt-get-kernel(1), virt-inspector(1), virt-v2v(1), http://libguestfs.org/.
go read them, they're all friends π
π AUTHOR π
Richard W.M. Jones http://people.redhat.com/~rjones/ β thank you king π«‘
π COPYRIGHT π
Copyright (C) 2009-2025 Red Hat Inc.
π LICENSE π
this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
yes the all-caps warranty bits stay all-caps. that's legally required shouting, not me being dramatic π
π BUGS π
to get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
to report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
when reporting a bug, please supply:
- the version of libguestfs.
- where you got libguestfs (eg. which Linux distro, compiled from source, etc)
- describe the bug accurately and give a way to reproduce it.
- run
libguestfs-test-tool(1)and paste the complete, unedited output into the bug report.
complete. unedited. do not trim it, do not "clean it up", do not paraphrase. the maintainers need the whole thing π
that's the whole page bestie, you ate that π
β¨ this was guestfs-tools-1.57.3, dated 2026-09-16 β mwah, go detect some drivers π¦π
π¦ where this page comes from
- centos-stream 10: guestfs-tools 1.57.3-1.el10 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms