Include virt-ps in the manpage.
[virt-mem.git] / virt-mem.1
1 .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
29 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
30 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
31 .\" nothing in troff, for use with C<>.
32 .tr \(*W-
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" Escape single quotes in literal strings from groff's Unicode transform.
52 .ie \n(.g .ds Aq \(aq
53 .el       .ds Aq '
54 .\"
55 .\" If the F register is turned on, we'll generate index entries on stderr for
56 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
57 .\" entries marked with X<> in POD.  Of course, you'll have to process the
58 .\" output yourself in some meaningful fashion.
59 .ie \nF \{\
60 .    de IX
61 .    tm Index:\\$1\t\\n%\t"\\$2"
62 ..
63 .    nr % 0
64 .    rr F
65 .\}
66 .el \{\
67 .    de IX
68 ..
69 .\}
70 .\"
71 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
72 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
73 .    \" fudge factors for nroff and troff
74 .if n \{\
75 .    ds #H 0
76 .    ds #V .8m
77 .    ds #F .3m
78 .    ds #[ \f1
79 .    ds #] \fP
80 .\}
81 .if t \{\
82 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
83 .    ds #V .6m
84 .    ds #F 0
85 .    ds #[ \&
86 .    ds #] \&
87 .\}
88 .    \" simple accents for nroff and troff
89 .if n \{\
90 .    ds ' \&
91 .    ds ` \&
92 .    ds ^ \&
93 .    ds , \&
94 .    ds ~ ~
95 .    ds /
96 .\}
97 .if t \{\
98 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
99 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
100 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
101 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
102 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
103 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
104 .\}
105 .    \" troff and (daisy-wheel) nroff accents
106 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
107 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
108 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
109 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
110 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
111 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
112 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
113 .ds ae a\h'-(\w'a'u*4/10)'e
114 .ds Ae A\h'-(\w'A'u*4/10)'E
115 .    \" corrections for vroff
116 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
117 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
118 .    \" for low resolution devices (crt and lpr)
119 .if \n(.H>23 .if \n(.V>19 \
120 \{\
121 .    ds : e
122 .    ds 8 ss
123 .    ds o a
124 .    ds d- d\h'-1'\(ga
125 .    ds D- D\h'-1'\(hy
126 .    ds th \o'bp'
127 .    ds Th \o'LP'
128 .    ds ae ae
129 .    ds Ae AE
130 .\}
131 .rm #[ #] #H #V #F C
132 .\" ========================================================================
133 .\"
134 .IX Title "VIRT-MEM 1"
135 .TH VIRT-MEM 1 "2008-08-07" "virt-mem-0.2.9" "Virtualization Support"
136 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
137 .\" way too many mistakes in technical documents.
138 .if n .ad l
139 .nh
140 .SH "NAME"
141 virt\-uname \- system information for virtual machines
142 .PP
143 virt\-dmesg \- print kernel messages for virtual machines
144 .PP
145 virt\-ps \- list processes for virtual machines
146 .PP
147 virt\-mem \- tool with additional information output
148 .SH "SUMMARY"
149 .IX Header "SUMMARY"
150 virt-uname [\-options] [domains...]
151 .PP
152 virt-dmesg [\-options] [domains...]
153 .PP
154 virt-ps [\-options] [domains...]
155 .PP
156 virt-mem uname [...]
157 .PP
158 virt-mem dmesg [...]
159 .PP
160 virt-mem ps [...]
161 .PP
162 virt-mem [\-options]
163 .SH "DESCRIPTION"
164 .IX Header "DESCRIPTION"
165 These virtualization tools allow you to inspect the status of virtual
166 machines running Linux.
167 .PP
168 These tools are designed to work like familiar Linux/Unix command line
169 tools.
170 .PP
171 These tools all use libvirt so are capable of showing information
172 across a variety of different virtualization systems.
173 .PP
174 The virt-mem tools do not work on domains which are not active
175 (running or paused).  eg. They do not work on shut down domains.
176 However they can (usually) be used on domains which are active but
177 hanging or unresponsive.  You also have the option of capturing a
178 memory image of a domain for post-mortem analysis, allowing you to
179 quickly reboot a failed domain and analyze it later at your leisure.
180 .SH "COMMON OPTIONS"
181 .IX Header "COMMON OPTIONS"
182 Each command obeys a common set of options.  The general form is:
183 .PP
184 virt\-\fIprogram\fR [\-options] [domains...]
185 .PP
186 where \fIprogram\fR is a subtool such as \f(CW\*(C`uname\*(C'\fR, \f(CW\*(C`dmesg\*(C'\fR or \f(CW\*(C`ps\*(C'\fR, and
187 \&\fIdomains\fR is a list of guest names to act on.  If no domains are
188 specified then we act on all active domains by default.
189 .PP
190 A \fIdomain\fR may be specified either by its name, by its \s-1ID\s0 or by its
191 \&\s-1UUID\s0.  Use \fIvirsh list\fR to get a list of active domain names and IDs.
192 .PP
193 Equivalently you can use the \f(CW\*(C`virt\-mem\*(C'\fR meta-tool with subcommands,
194 as in:
195 .PP
196 virt-mem \fIprogram\fR [...]
197 .PP
198 The \f(CW\*(C`virt\-mem\*(C'\fR program offers additional features, such as the
199 ability to capture \s-1VM\s0 images for post-mortem analysis (see below).
200 .IP "\fB\-c uri\fR, \fB\-\-connect uri\fR" 4
201 .IX Item "-c uri, --connect uri"
202 Connect to libvirt \s-1URI\s0.  The default is to connect to the default
203 libvirt \s-1URI\s0, normally Xen.
204 .IP "\fB\-\-csv\fR" 4
205 .IX Item "--csv"
206 Print the results in \s-1CSV\s0 format, suitable for importing into a
207 spreadsheet or database.
208 .Sp
209 This option is only supported if virt-mem was built with \s-1CSV\s0 support.
210 .IP "\fB\-\-debug\fR" 4
211 .IX Item "--debug"
212 Emit debugging information on stderr.  Please supply this if you
213 report a bug.
214 .IP "\fB\-\-help\fR" 4
215 .IX Item "--help"
216 Display usage summary.
217 .IP "\fB\-t memoryimage\fR" 4
218 .IX Item "-t memoryimage"
219 Post-mortem analysis mode.
220 .Sp
221 Instead of checking libvirt for domain information, this runs the tool
222 directly on the memory image supplied.  You may specify the \fB\-t\fR
223 option multiple times.  Use the \f(CW\*(C`virt\-mem capture\*(C'\fR command to capture
224 images (see below).
225 .Sp
226 See also the section \*(L"\s-1MEMORY\s0 \s-1IMAGES\s0\*(R" below.
227 .IP "\fB\-\-version\fR" 4
228 .IX Item "--version"
229 Display version and exit.
230 .IP "\fB\-E auto|littleendian|bigendian\fR" 4
231 .IX Item "-E auto|littleendian|bigendian"
232 .PD 0
233 .IP "\fB\-T auto|i386|x86\-64|\f(BIaddress\fB|\f(BIaddress,min,max\fB\fR" 4
234 .IX Item "-T auto|i386|x86-64|address|address,min,max"
235 .IP "\fB\-W auto|32|64\fR" 4
236 .IX Item "-W auto|32|64"
237 .PD
238 These options force the endianness, text address, and word size for
239 the subsequent domains listed on the command line (or if no domains
240 are listed, then for all domains).
241 .Sp
242 These default to \fIauto\fR which tries to do automatic detection (using
243 libvirt, or details from the memory images themselves).  You only need
244 to use these options if virt-mem tools get the automatic detection
245 wrong.
246 .Sp
247 Endianness (\fI\-E\fR) sets the memory endianness, for data, pointers and
248 so on.  \fI\-E littleendian\fR is the endianness used on Intel i386,
249 x86\-64 and (usually) \s-1IA64\s0.  \fI\-E bigendian\fR is the endianness used on
250 many \s-1RISC\s0 chips such as \s-1SPARC\s0 and PowerPC.
251 .Sp
252 Text address (\fI\-T\fR) sets the base address and optionally min and max
253 addresses of the kernel image.  \fI\-T i386\fR means to try some common
254 addresses for i386\-based kernels.  \fI\-T x86\-64\fR means to try some
255 common addresses for x86\-64\-based kernels.
256 .Sp
257 \&\fI\-T address\fR sets the kernel base address specifically (\fI0x\fR prefix
258 is used to specify hex addresses).  \fI\-T address,min,max\fR sets the
259 kernel base address, minimum address and maximum address.
260 .Sp
261 Word size (\fI\-W\fR) sets the word size, 32 or 64 bits.
262 .IP "\fB\-A auto|i386|x86\-64|...\fR" 4
263 .IX Item "-A auto|i386|x86-64|..."
264 This option sets the architecture to one of a collection of known
265 architectures.  It is equivalent to setting endianness and wordsize in
266 one go, but not text address.
267 .SH "virt-dmesg"
268 .IX Header "virt-dmesg"
269 This prints the latest kernel messages from the virtual machine, as if
270 you were logged into the machine and used \fIdmesg\fR\|(1).
271 .SH "virt-uname"
272 .IX Header "virt-uname"
273 This prints the contents of the system \f(CW\*(C`utsname\*(C'\fR structure, similar
274 to what is printed by the \fIuname\fR\|(1) command.
275 .SH "virt-mem"
276 .IX Header "virt-mem"
277 \&\f(CW\*(C`virt\-mem\*(C'\fR is a meta-tool which allows you to run all the commands
278 above, and provides some extra features.
279 .PP
280 Instead of the preceeding commands such as \f(CW\*(C`virt\-dmesg\*(C'\fR you can
281 write:
282 .PP
283 .Vb 1
284 \& virt\-mem dmesg [...]
285 .Ve
286 .PP
287 Options and other command line arguments work the same.
288 .PP
289 Additional \f(CW\*(C`virt\-mem\*(C'\fR subcommands are listed below.
290 .Sh "virt-mem capture \-o memoryimage [\-options] [domains...]"
291 .IX Subsection "virt-mem capture -o memoryimage [-options] [domains...]"
292 Capture the memory image of a virtual machine for later post-mortem
293 analysis.  Use the \fI\-t memoryimage\fR option for any other virt-mem
294 tool to analyze the memory image later.
295 .PP
296 The \fI\-o memoryimage\fR option is required, and is used to name the
297 output file.  If a single guest is captured, then the output is saved
298 in the \fImemoryimage\fR file.  However, if multiple guests are captured,
299 then their images are saved in \fImemoryimage.ID\fR where \fI\s-1ID\s0\fR is
300 replaced with the domain \s-1ID\s0.
301 .PP
302 See also the section \*(L"\s-1MEMORY\s0 \s-1IMAGES\s0\*(R" below.
303 .SH "EXAMPLES"
304 .IX Header "EXAMPLES"
305 .Vb 3
306 \& # virt\-uname
307 \& f9x32kvm: Linux localhost.localdomain 2.6.24\-0.155.rc7.git6.fc9 #1
308 \& SMP Tue Jan 15 17:52:31 EST 2008 i686 (none)
309 \&
310 \& # virt\-dmesg f9x32kvm | tail
311 \& <6>Bluetooth: Core ver 2.11
312 \& <6>NET: Registered protocol family 31
313 \& <6>Bluetooth: HCI device and connection manager initialized
314 \& <6>Bluetooth: HCI socket layer initialized
315 \& <6>Bluetooth: L2CAP ver 2.9
316 \& <6>Bluetooth: L2CAP socket layer initialized
317 \& <6>Bluetooth: RFCOMM socket layer initialized
318 \& <6>Bluetooth: RFCOMM TTY layer initialized
319 \& <6>Bluetooth: RFCOMM ver 1.8
320 \& <7>eth0: no IPv6 routers present
321 .Ve
322 .SH "MEMORY IMAGES"
323 .IX Header "MEMORY IMAGES"
324 All the tools can read dumped kernel images, using the common
325 \&\fI\-t memoryimage\fR option.  In addition you can capture memory
326 images from domains for post-mortem analysis using the
327 \&\f(CW\*(C`virt\-mem capture\*(C'\fR command (see above).
328 .PP
329 The memory images which are saved by \f(CW\*(C`virt\-mem capture\*(C'\fR contain a
330 header and some additional information about the kernel image, such as
331 architecture, original text address, and so forth.  Thus these images
332 can be reanalysed just using the \fI\-t memoryimage\fR option.
333 .PP
334 We also support analyzing raw kernel dumps, eg. produced using the
335 \&\fIqemu\fR\|(1) monitor's \f(CW\*(C`memsave\*(C'\fR command.  In this case however you
336 usually need to specify the original architecture, text address and
337 perhaps other details using the \fI\-A\fR, \fI\-T\fR and other command line
338 parameters.
339 .SH "SHORTCOMINGS"
340 .IX Header "SHORTCOMINGS"
341 The virt-mem tools spy on the guest's memory image.  There are some
342 shortcomings to this, described here.
343 .IP "\(bu" 4
344 Only works on specific, tested releases of Linux kernels.  Support
345 for arbitrary Linux kernel versions may be patchy because of changes
346 in the internal structures used.  Support for non-Linux kernels is
347 currently non-existent, and probably impossible for Windows because of
348 lack of an acceptable source license.
349 .IP "\(bu" 4
350 Heuristics are used which may mean in the worst case that the
351 output is wrong.
352 .IP "\(bu" 4
353 Structures which are frequently modified may cause errors.  This
354 could be a problem if, for example, the process table in the guest is
355 being rapidly updated.
356 .IP "\(bu" 4
357 We have to scan memory to find kernel symbols, etc., which can be
358 quite slow.  Optimizing the memory scanner would help, and caching the
359 base address of the symbol table(s) would make it dramatically faster.
360 .SH "SECURITY"
361 .IX Header "SECURITY"
362 The current code tries hard to be secure against malicious guests, for
363 example guests which set up malicious kernel memory.
364 .SH "SEE ALSO"
365 .IX Header "SEE ALSO"
366 \&\fIuname\fR\|(1),
367 \&\fIdmesg\fR\|(1),
368 \&\fIvirsh\fR\|(1),
369 \&\fIvirt\-top\fR\|(1),
370 \&\fIvirt\-df\fR\|(1),
371 \&\fIxm\fR\|(1),
372 \&\fIqemu\fR\|(1),
373 <http://www.libvirt.org/ocaml/>,
374 <http://www.libvirt.org/>,
375 <http://et.redhat.com/~rjones/>,
376 <http://caml.inria.fr/>
377 .SH "AUTHORS"
378 .IX Header "AUTHORS"
379 Richard W.M. Jones <rjones @ redhat . com>
380 .SH "COPYRIGHT"
381 .IX Header "COPYRIGHT"
382 (C) Copyright 2008 Red Hat Inc., Richard W.M. Jones
383 http://libvirt.org/
384 .PP
385 This program is free software; you can redistribute it and/or modify
386 it under the terms of the \s-1GNU\s0 General Public License as published by
387 the Free Software Foundation; either version 2 of the License, or
388 (at your option) any later version.
389 .PP
390 This program is distributed in the hope that it will be useful,
391 but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of
392 \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.  See the
393 \&\s-1GNU\s0 General Public License for more details.
394 .PP
395 You should have received a copy of the \s-1GNU\s0 General Public License
396 along with this program; if not, write to the Free Software
397 Foundation, Inc., 675 Mass Ave, Cambridge, \s-1MA\s0 02139, \s-1USA\s0.
398 .SH "REPORTING BUGS"
399 .IX Header "REPORTING BUGS"
400 Bugs can be viewed on the Red Hat Bugzilla page:
401 <https://bugzilla.redhat.com/>.
402 .PP
403 If you find a bug in virt-mem, please follow these steps to report it:
404 .IP "1. Check for existing bug reports" 4
405 .IX Item "1. Check for existing bug reports"
406 Go to <https://bugzilla.redhat.com/> and search for similar bugs.
407 Someone may already have reported the same bug, and they may even
408 have fixed it.
409 .IP "2. Capture debug and error messages" 4
410 .IX Item "2. Capture debug and error messages"
411 Run
412 .Sp
413 virt\-\fIprogram\fR \-\-debug > virt\-mem.log 2>&1
414 .Sp
415 and keep \fIvirt\-mem.log\fR.  It contains error messages which you should
416 submit with your bug report.
417 .IP "3. Get version of virt-mem and version of libvirt." 4
418 .IX Item "3. Get version of virt-mem and version of libvirt."
419 Run
420 .Sp
421 virt\-\fIprogram\fR \-\-version
422 .IP "4. Submit a bug report." 4
423 .IX Item "4. Submit a bug report."
424 Go to <https://bugzilla.redhat.com/> and enter a new bug.
425 Please describe the problem in as much detail as possible.
426 .Sp
427 Remember to include the version numbers (step 3) and the debug
428 messages file (step 2).
429 .IP "5. Assign the bug to rjones @ redhat.com" 4
430 .IX Item "5. Assign the bug to rjones @ redhat.com"
431 Assign or reassign the bug to \fBrjones @ redhat.com\fR (without the
432 spaces).  You can also send me an email with the bug number if you
433 want a faster response.