virt-drivers(1) | Virtualization Support | virt-drivers(1) |
virt-drivers - 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.
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>
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 <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>
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/rwmjones/guestfs-tools/tree/master/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.
The format of the disk image is auto-detected. To override this and force a particular format use the --format option.
If you specify guest block devices directly (-a), then libvirt is not used at all.
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).
Use the specified "KEY_STRING" as passphrase.
Note that if any such option is present on the command line, QEMU user networking will be automatically enabled for the libguestfs appliance.
If there are multiple encrypted devices then you may need to supply multiple keys on stdin, one per line.
For other environment variables which affect all libguestfs programs, see "ENVIRONMENT VARIABLES" in guestfs(3).
This program returns 0 if successful, or non-zero if there was an error.
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/
Copyright (C) 2009-2023 Red Hat Inc.
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:
2024-04-01 | guestfs-tools-1.52.0 |