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.
  • -a file, --add file β€” 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.

  • -a URI, --add URI β€” add a remote disk. the URI format is compatible with guestfish. see "ADDING REMOTE STORAGE" in guestfish(1).
  • --blocksize 512, --blocksize 4096 β€” this parameter sets the sector size of the disk image added with -a option and is ignored for libvirt guest added with -d option. see also guestfs_add_drive_opts in guestfs(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 ✨)
  • -c URI, --connect URI β€” 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 🚫

  • -d guest, --domain guest β€” 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 -a option is to auto-detect the format of the disk image. using this forces the disk format for the -a option 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 πŸ”’
  • --key SELECTOR β€” specify a key for LUKS, to automatically open a LUKS device when using the inspection.
    • --key NAME:key:KEY_STRING
    • --key UUID: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.

  • --key NAME:file:FILENAME
  • --key UUID:file:FILENAME
  • --key all:file:FILENAME

read the passphrase from FILENAME.

  • --key NAME:clevis
  • --key UUID: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.

  • --key NAME:error
  • --key UUID: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 (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