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

--help

Display brief help.

--version

Display version number and exit.

--connect URI | -c URI

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.

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

--text (default)

Plain text report.

--none

Produce no output at all.

--xml

If you select --xml then you get XML output which can be fed to other programs.

--yaml

If you select --yaml then you get YAML output which can be fed to other programs.

--perl

If you select --perl then you get Perl structures output which can be used directly in another Perl program.

--fish
--ro-fish

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.

--query

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.

--windows-registry

If this item is passed, and the guest is Windows, and the external program reged is available (see SEE ALSO section), then we attempt to parse the Windows registry. This allows much more information to be gathered for Windows guests.

This is quite an expensive and slow operation, so we don't do it by default.


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.

windows=(yes|no)

Answer yes if Microsoft Windows is installed in the guest.

linux=(yes|no)

Answer yes if a Linux kernel is installed in the guest.

rhel=(yes|no)

Answer yes if the guest contains Red Hat Enterprise Linux.

fedora=(yes|no)

Answer yes if the guest contains the Fedora Linux distribution.

debian=(yes|no)

Answer yes if the guest contains the Debian Linux distribution.

fullvirt=(yes|no)

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.

xen_domU_kernel=(yes|no)

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

xen_pv_drivers=(yes|no)

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

virtio_drivers=(yes|no)

Answer yes if the guest has virtio paravirtualized drivers installed. Virtio drivers are commonly used to improve the performance of KVM.

userspace_arch=(x86_64|...)

Print the architecture of userspace.

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

kernel_arch=(x86_64|...)

Print the architecture of the kernel.

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


SEE ALSO

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

For Windows registry parsing we require the reged program from http://home.eunet.no/~pnordahl/ntpasswd/.


AUTHOR

Richard W.M. Jones http://et.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.