Scroll to navigation

virt-inspector(1) Virtualization Support virt-inspector(1)

NAME

virt-inspector - Display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine

SYNOPSIS

 virt-inspector [--connect URI] domname
 virt-inspector guest.img [guest.img ...]

DESCRIPTION

virt-inspector examines a virtual machine and tries to determine the version of the OS, the kernel version, what drivers are installed, whether the virtual machine is fully virtualized (FV) or para-virtualized (PV), what applications are installed and more.

Virt-inspector can produce output in several formats, including a readable text report, and XML for feeding into other programs.

In the normal usage, use "virt-inspector domname" where "domname" is the libvirt domain (see: "virsh list --all").

You can also run virt-inspector directly on disk images from a single virtual machine. Use "virt-inspector guest.img". In rare cases a domain has several block devices, in which case you should list them one after another, with the first corresponding to the guest's "/dev/sda", the second to the guest's "/dev/sdb" and so on.

Virt-inspector can only inspect and report upon one domain at a time. To inspect several virtual machines, you have to run virt-inspector several times (for example, from a shell script for-loop).

Because virt-inspector needs direct access to guest images, it won't normally work over remote libvirt connections.

OPTIONS

Display brief help.
Display version number and exit.
If using libvirt, connect to the given URI. If omitted, then we connect to the default libvirt hypervisor.

Libvirt is only used if you specify a "domname" on the command line. If you specify guest block devices directly, then libvirt is not used at all.

Specify the format of disk images given on the command line. If this is omitted then the format is autodetected from the content of the disk image.

If disk images are requested from libvirt, then this program asks libvirt for this information. In this case, the value of the format parameter is ignored.

If working with untrusted raw-format guest disk images, you should ensure the format is always specified.

The following options select the output format. Use only one of them. The default is a readable text report.

Plain text report.
Produce no output at all.
If you select --xml then you get XML output which can be fed to other programs.
If you select --yaml then you get YAML output which can be fed to other programs.
If you select --perl then you get Perl structures output which can be used directly in another Perl program.
If you select --fish then we print a guestfish(1) command line which will automatically mount up the filesystems on the correct mount points. Try this for example:

 guestfish $(virt-inspector --fish guest.img)
    

--ro-fish is the same, but the --ro option is passed to guestfish so that the filesystems are mounted read-only.

In "query mode" we answer common questions about the guest, such as whether it is fullvirt or needs a Xen hypervisor to run.

See section QUERY MODE below.

This flag is ignored for compatibility with earlier releases of the software.

In this version, if Win::Hivex(3) is available, then we attempt to parse information out of the Registry for any Windows guest.

OUTPUT FORMAT

 Operating system(s)
 -------------------
 Linux (distro + version)
 Windows (version)
    |
    |
    +--- Filesystems ---------- Installed apps --- Kernel & drivers
         -----------            --------------     ----------------
         mount point => device  List of apps       Extra information
         mount point => device  and versions       about kernel(s)
              ...                                  and drivers
         swap => swap device
         (plus lots of extra information
         about each filesystem)

The output of virt-inspector is a complex two-level data structure.

At the top level is a list of the operating systems installed on the guest. (For the vast majority of guests, only a single OS is installed.) The data returned for the OS includes the name (Linux, Windows), the distribution and version.

The diagram above shows what we return for each OS.

With the --xml option the output is mapped into an XML document. There is a RELAX-NG schema for this XML in the file virt-inspector.rng which normally ships with virt-inspector, or can be found in the source.

With the --fish or --ro-fish option the mount points are mapped to guestfish(1) command line parameters, so that you can go in afterwards and inspect the guest with everything mounted in the right place. For example:

 guestfish $(virt-inspector --ro-fish guest.img)
 ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot

QUERY MODE

When you use "virt-inspector --query", the output is a series of lines of the form:

 windows=no
 linux=yes
 fullvirt=yes
 xen_pv_drivers=no

(each answer is usually "yes" or "no", or the line is completely missing if we could not determine the answer at all).

If the guest is multiboot, you can get apparently conflicting answers (eg. "windows=yes" and "linux=yes", or a guest which is both fullvirt and has a Xen PV kernel). This is normal, and just means that the guest can do both things, although it might require operator intervention such as selecting a boot option when the guest is booting.

This section describes the full range of answers possible.

Answer "yes" if Microsoft Windows is installed in the guest.
Answer "yes" if a Linux kernel is installed in the guest.
Answer "yes" if the guest contains Red Hat Enterprise Linux.
Answer "yes" if the guest contains the Fedora Linux distribution.
Answer "yes" if the guest contains the Debian Linux distribution.
Answer "yes" if there is at least one operating system kernel installed in the guest which runs fully virtualized. Such a guest would require a hypervisor which supports full system virtualization.

Note: This only works correctly for Linux guests (RHBZ#690358).

Answer "yes" if there is at least one Linux kernel installed in the guest which is compiled as a Xen DomU (a Xen paravirtualized guest).
Answer "yes" if the guest has Xen paravirtualized drivers installed (usually the kernel itself will be fully virtualized, but the PV drivers have been installed by the administrator for performance reasons).
Answer "yes" if the guest has virtio paravirtualized drivers installed. Virtio drivers are commonly used to improve the performance of KVM.
Print the architecture of userspace.

NB. For multi-boot VMs this can print several lines.

Print the architecture of the kernel.

NB. For multi-boot VMs this can print several lines.

SHELL QUOTING

Libvirt guest names can contain arbitrary characters, some of which have meaning to the shell such as "#" and space. You may need to quote or escape these characters on the command line. See the shell manual page sh(1) for details.

SEE ALSO

guestfs(3), guestfish(1), Sys::Guestfs(3), Sys::Guestfs::Lib(3), Sys::Virt(3), <http://libguestfs.org/>.

AUTHORS

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

Matthew Booth mbooth@redhat.com

COPYRIGHT

Copyright (C) 2009 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., 675 Mass Ave, Cambridge, MA 02139, USA.

Contains code from perl String::ShellQuote under the following copyright and license:

Copyright (c) 1997 Roderick Schertler. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2017-03-27 libguestfs-1.20.11