1virt-inspector(1)           Virtualization Support           virt-inspector(1)
2
3
4

NAME

6       virt-inspector - Display operating system version and other information
7       about a virtual machine
8

SYNOPSIS

10        virt-inspector [--options] -d domname
11
12        virt-inspector [--options] -a disk.img [-a disk.img ...]
13
14       Old-style:
15
16        virt-inspector domname
17
18        virt-inspector disk.img [disk.img ...]
19

DESCRIPTION

21       virt-inspector examines a virtual machine or disk image and tries to
22       determine the version of the operating system and other information
23       about the virtual machine.
24
25       Virt-inspector produces XML output for feeding into other programs.
26
27       In the normal usage, use "virt-inspector -d domname" where "domname" is
28       the libvirt domain (see: "virsh list --all").
29
30       You can also run virt-inspector directly on disk images from a single
31       virtual machine.  Use "virt-inspector -a disk.img".  In rare cases a
32       domain has several block devices, in which case you should list several
33       -a options one after another, with the first corresponding to the
34       guest's "/dev/sda", the second to the guest's "/dev/sdb" and so on.
35
36       Virt-inspector can only inspect and report upon one domain at a time.
37       To inspect several virtual machines, you have to run virt-inspector
38       several times (for example, from a shell script for-loop).
39
40       Because virt-inspector needs direct access to guest images, it won't
41       normally work over remote libvirt connections.
42

OPTIONS

44       --help
45           Display brief help.
46
47       -a file
48       --add file
49           Add file which should be a disk image from a virtual machine.  If
50           the virtual machine has multiple block devices, you must supply all
51           of them with separate -a options.
52
53           The format of the disk image is auto-detected.  To override this
54           and force a particular format use the --format=.. option.
55
56       -c URI
57       --connect URI
58           If using libvirt, connect to the given URI.  If omitted, then we
59           connect to the default libvirt hypervisor.
60
61           Libvirt is only used if you specify a "domname" on the command
62           line.  If you specify guest block devices directly (-a), then
63           libvirt is not used at all.
64
65       -d guest
66       --domain guest
67           Add all the disks from the named libvirt guest.
68
69       --echo-keys
70           When prompting for keys and passphrases, virt-inspector normally
71           turns echoing off so you cannot see what you are typing.  If you
72           are not worried about Tempest attacks and there is no one else in
73           the room you can specify this flag to see what you are typing.
74
75       --format=raw|qcow2|..
76       --format
77           Specify the format of disk images given on the command line.  If
78           this is omitted then the format is autodetected from the content of
79           the disk image.
80
81           If disk images are requested from libvirt, then this program asks
82           libvirt for this information.  In this case, the value of the
83           format parameter is ignored.
84
85           If working with untrusted raw-format guest disk images, you should
86           ensure the format is always specified.
87
88       --keys-from-stdin
89           Read key or passphrase parameters from stdin.  The default is to
90           try to read passphrases from the user by opening "/dev/tty".
91
92       -v
93       --verbose
94           Enable verbose messages for debugging.
95
96       -V
97       --version
98           Display version number and exit.
99
100       -x  Enable tracing of libguestfs API calls.
101

OLD-STYLE COMMAND LINE ARGUMENTS

103       Previous versions of virt-inspector allowed you to write either:
104
105        virt-inspector disk.img [disk.img ...]
106
107       or
108
109        virt-inspector guestname
110
111       whereas in this version you should use -a or -d respectively to avoid
112       the confusing case where a disk image might have the same name as a
113       guest.
114
115       For compatibility the old style is still supported.
116

XML FORMAT

118       The virt-inspector XML is described precisely in a RELAX NG schema
119       which is supplied with libguestfs.  This section is just an overview.
120
121       The top-level element is <operatingsystems>, and it contains one or
122       more <operatingsystem> elements.  You would only see more than one
123       <operatingsystem> element if the virtual machine is multi-boot, which
124       is vanishingly rare in real world VMs.
125
126   <operatingsystem>
127       In the <operatingsystem> tag are various optional fields that describe
128       the operating system, its architecture, the descriptive "product name"
129       string, the type of OS and so on, as in this example:
130
131        <operatingsystems>
132          <operatingsystem>
133            <root>/dev/sda2</root>
134            <name>windows</name>
135            <arch>i386</arch>
136            <distro>windows</distro>
137            <product_name>Windows 7 Enterprise</product_name>
138            <major_version>6</major_version>
139            <minor_version>1</minor_version>
140            <windows_systemroot>/Windows</windows_systemroot>
141
142       These fields are derived from the libguestfs inspection API, and you
143       can find more details in "INSPECTION" in guestfs(3).
144
145       The <root> element is the root filesystem device, but from the point of
146       view of libguestfs (block devices may have completely different names
147       inside the VM itself).
148
149   <mountpoints>
150       Un*x-like guests typically have multiple filesystems which are mounted
151       at various mountpoints, and these are described in the <mountpoints>
152       element which looks like this:
153
154        <operatingsystems>
155          <operatingsystem>
156            ...
157            <mountpoints>
158              <mountpoint dev="/dev/vg_f13x64/lv_root">/</mountpoint>
159              <mountpoint dev="/dev/sda1">/boot</mountpoint>
160            </mountpoints>
161
162       As with <root>, devices are from the point of view of libguestfs, and
163       may have completely different names inside the guest.  Only mountable
164       filesystems appear in this list, not things like swap devices.
165
166   <filesystems>
167       <filesystems> is like <mountpoints> but covers all filesystems
168       belonging to the guest, including swap and empty partitions.  (In the
169       rare case of a multi-boot guest, it covers filesystems belonging to
170       this OS or shared by this OS and other OSes).
171
172       You might see something like this:
173
174        <operatingsystems>
175          <operatingsystem>
176            ...
177            <filesystems>
178              <filesystem dev="/dev/vg_f13x64/lv_root">
179                <type>ext4</type>
180                <label>Fedora-13-x86_64</label>
181                <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>
182              </filesystem>
183
184       The optional elements within <filesystem> are the filesystem type, the
185       label, and the UUID.
186
187   <applications>
188       The related elements <package_format>, <package_management> and
189       <applications> describe applications installed in the virtual machine.
190
191       <package_format>, if present, describes the packaging system used.
192       Typical values would be "rpm" and "deb".
193
194       <package_management>, if present, describes the package manager.
195       Typical values include "yum", "up2date" and "apt"
196
197       <applications> lists the packages or applications installed.
198
199        <operatingsystems>
200          <operatingsystem>
201            ...
202            <applications>
203              <application>
204                <name>coreutils</name>
205                <version>8.5</version>
206                <release>1</release>
207              </application>
208
209       The version and release fields may not be available for some types
210       guests.  Other fields are possible, see
211       "guestfs_inspect_list_applications" in guestfs(3).
212

USING XPATH

214       You can use the XPath query language, and/or the xpath tool, in order
215       to select parts of the XML.
216
217       For example:
218
219        $ virt-inspector -d Guest | xpath //filesystems
220        Found 1 nodes:
221        -- NODE --
222        <filesystems>
223             <filesystem dev="/dev/vg_f13x64/lv_root">
224               <type>ext4</type>
225        [etc]
226
227        $ virt-inspector -d Guest | \
228            xpath "string(//filesystem[@dev='/dev/sda1']/type)"
229        Query didn't return a nodeset. Value: ext4
230

SHELL QUOTING

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

SEE ALSO

238       guestfs(3), guestfish(1), <http://www.w3.org/TR/xpath/>,
239       <http://libguestfs.org/>.
240

AUTHORS

242       ·   Richard W.M. Jones <http://people.redhat.com/~rjones/>
243
244       ·   Matthew Booth mbooth@redhat.com
245
247       Copyright (C) 2010 Red Hat Inc.
248
249       This program is free software; you can redistribute it and/or modify it
250       under the terms of the GNU General Public License as published by the
251       Free Software Foundation; either version 2 of the License, or (at your
252       option) any later version.
253
254       This program is distributed in the hope that it will be useful, but
255       WITHOUT ANY WARRANTY; without even the implied warranty of
256       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
257       General Public License for more details.
258
259       You should have received a copy of the GNU General Public License along
260       with this program; if not, write to the Free Software Foundation, Inc.,
261       675 Mass Ave, Cambridge, MA 02139, USA.
262
263
264
265libguestfs-1.8.15                 2011-11-10                 virt-inspector(1)
Impressum