Your company here — click to reach over 10,000 unique daily visitors

virt-drivers - Man Page

Detect bootloader, kernel and drivers inside guest


 virt-drivers [--options] -d domname

 virt-drivers [--options] -a disk.img


This tool can detect the bootloader, kernel and drivers inside some guests from only the disk image.  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.


Normally you should distribute hypervisor metadata (eg. libvirt XML or OVF) alongside disk images to tell the hypervisor how to boot them. This tool is used when this metadata has not been provided.  Work with the supplier of the disk image to get them to provide proper metadata.

XML Format

The output is an XML document.  At the top level it lists the operating systems found (the same as virt-inspector(1)):



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:

   <firmware type='uefi'>/dev/sda1</firmware>

<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:

   <firmware type='bios'/>
     <bootloader type='grub2' config='/boot/grub2/grub.cfg'>

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


The <drivers> element lists information about drivers found in Windows guests:

   <firmware type='bios'/>
         <pci vendor='1077' device='1216' subsystem='8471101E'/>
         <pci vendor='1077' device='1216' subsystem='8493101E'/>

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.



Display help.

-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).


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.

-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.

-d guest
--domain guest

Add all the disks from the named libvirt guest.  Domain UUIDs can be used instead of names.


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.

--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).


Specify a key for LUKS, to automatically open a LUKS device when using the inspection.

--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.


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.


Don’t print ordinary progress messages.


Enable verbose messages for debugging.


Display version number and exit.


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.


Enable tracing of libguestfs API calls.

Environment Variables

For other environment variables which affect all libguestfs programs, see "ENVIRONMENT VARIABLES" in guestfs(3).

Exit Status

This program returns 0 if successful, or non-zero if there was an error.

See Also

guestfs(3), guestfish(1), guestmount(1), virt-get-kernel(1), virt-inspector(1), virt-v2v(1), http://libguestfs.org/.


Richard W.M. Jones http://people.redhat.com/~rjones/


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.


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:

Referenced By

guestfs-tools-release-notes-1.52(1), virt-df(1), virt-filesystems(1), virt-get-kernel(1), virt-inspector(1).

2024-06-19 guestfs-tools-1.53.1 Virtualization Support