5e19ac2b429448645380ceda60b0034a567cda0a
[libguestfs.git] / fish / guestfish.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 guestfish - the libguestfs Filesystem Interactive SHell
6
7 =head1 SYNOPSIS
8
9  guestfish [--options] [commands]
10
11  guestfish
12
13  guestfish -a disk.img
14
15  guestfish -a disk.img -m dev[:mountpoint]
16
17  guestfish -i libvirt-domain
18
19  guestfish -i disk.img [disk.img ...]
20
21 =head1 EXAMPLES
22
23 =head2 As an interactive shell
24
25  $ guestfish
26  
27  Welcome to guestfish, the libguestfs filesystem interactive shell for
28  editing virtual machine filesystems.
29  
30  Type: 'help' for a list of commands
31        'man' to read the manual
32        'quit' to quit the shell
33  
34  ><fs> man
35
36 =head2 From shell scripts
37
38 Create a new C</etc/motd> file in a guest:
39
40  guestfish <<_EOF_
41  add disk.img
42  run
43  mount /dev/vg_guest/lv_root /
44  write /etc/motd "Welcome, new users"
45  _EOF_
46
47 List the LVM logical volumes in a guest:
48
49  guestfish -a disk.img --ro <<_EOF_
50  run
51  lvs
52  _EOF_
53
54 =head2 On one command line
55
56 Update C</etc/resolv.conf> in a guest:
57
58  guestfish \
59    add disk.img : run : mount /dev/vg_guest/lv_root / : \
60    write /etc/resolv.conf "nameserver 1.2.3.4"
61
62 Edit C</boot/grub/grub.conf> interactively:
63
64  guestfish --add disk.img \
65    --mount /dev/vg_guest/lv_root \
66    --mount /dev/sda1:/boot \
67    edit /boot/grub/grub.conf
68
69 =head2 Using virt-inspector
70
71 Use the I<-i> option to get virt-inspector to mount
72 the filesystems automatically as they would be mounted
73 in the virtual machine:
74
75  guestfish --ro -i disk.img cat /etc/group
76
77 =head2 As a script interpreter
78
79 Create a 100MB disk containing an ext2-formatted partition:
80
81  #!/usr/bin/guestfish -f
82  sparse test1.img 100M
83  run
84  part-disk /dev/sda mbr
85  mkfs ext2 /dev/sda1
86
87 =head2 Start with a prepared disk
88
89 An alternate way to create a 100MB disk called C<test1.img> containing
90 a single ext2-formatted partition:
91
92  guestfish -N fs
93
94 To list what is available do:
95
96  guestfish -N list | less
97
98 =head2 Remote control
99
100  eval `guestfish --listen --ro`
101  guestfish --remote add disk.img
102  guestfish --remote run
103  guestfish --remote lvs
104
105 =head1 DESCRIPTION
106
107 Guestfish is a shell and command-line tool for examining and modifying
108 virtual machine filesystems.  It uses libguestfs and exposes all of
109 the functionality of the guestfs API, see L<guestfs(3)>.
110
111 Guestfish gives you structured access to the libguestfs API, from
112 shell scripts or the command line or interactively.  If you want to
113 rescue a broken virtual machine image, you should look at the
114 L<virt-rescue(1)> command.
115
116 Using guestfish in read/write mode on live virtual machines can be
117 dangerous, potentially causing disk corruption.  Use the I<--ro>
118 (read-only) option to use guestfish safely if the disk image or
119 virtual machine might be live.
120
121 =head1 OPTIONS
122
123 =over 4
124
125 =item B<--help>
126
127 Displays general help on options.
128
129 =item B<-h> | B<--cmd-help>
130
131 Lists all available guestfish commands.
132
133 =item B<-h cmd> | B<--cmd-help cmd>
134
135 Displays detailed help on a single command C<cmd>.
136
137 =item B<-a image> | B<--add image>
138
139 Add a block device or virtual machine image to the shell.
140
141 =item B<-D> | B<--no-dest-paths>
142
143 Don't tab-complete paths on the guest filesystem.  It is useful to be
144 able to hit the tab key to complete paths on the guest filesystem, but
145 this causes extra "hidden" guestfs calls to be made, so this option is
146 here to allow this feature to be disabled.
147
148 =item B<-f file> | B<--file file>
149
150 Read commands from C<file>.  To write pure guestfish
151 scripts, use:
152
153  #!/usr/bin/guestfish -f
154
155 =item B<-i> | B<--inspector>
156
157 Run virt-inspector on the named libvirt domain or list of disk
158 images.  If virt-inspector is available and if it can identify
159 the domain or disk images, then partitions will be mounted
160 correctly at start-up.
161
162 Typical usage is either:
163
164  guestfish -i myguest
165
166 (for an inactive libvirt domain called I<myguest>), or:
167
168  guestfish --ro -i myguest
169
170 (for active domains, readonly), or specify the block device directly:
171
172  guestfish -i /dev/Guests/MyGuest
173
174 You cannot use I<-a>, I<-m>, I<-N>, I<--listen>, I<--remote> or
175 I<--selinux> in conjunction with this option, and options other than
176 I<--ro> might not behave correctly.
177
178 See also: L<virt-inspector(1)>.
179
180 =item B<--listen>
181
182 Fork into the background and listen for remote commands.  See section
183 L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
184
185 =item B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>
186
187 Mount the named partition or logical volume on the given mountpoint.
188
189 If the mountpoint is omitted, it defaults to C</>.
190
191 You have to mount something on C</> before most commands will work.
192
193 If any I<-m> or I<--mount> options are given, the guest is
194 automatically launched.
195
196 If you don't know what filesystems a disk image contains, you
197 can either run guestfish without this option, then list the partitions
198 and LVs available (see L</list-partitions> and L</lvs> commands),
199 or you can use the L<virt-list-filesystems(1)> program.
200
201 =item B<-n> | B<--no-sync>
202
203 Disable autosync.  This is enabled by default.  See the discussion
204 of autosync in the L<guestfs(3)> manpage.
205
206 =item B<-N type> | B<--new type> | B<-N list>
207
208 Prepare a fresh disk image formatted as "type".  This is an
209 alternative to the I<-a> option: whereas I<-a> adds an existing disk,
210 I<-N> creates a preformatted disk with a filesystem and adds it.
211 See L</PREPARED DISK IMAGES> below.
212
213 =item B<--remote[=pid]>
214
215 Send remote commands to C<$GUESTFISH_PID> or C<pid>.  See section
216 L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
217
218 =item B<-r> | B<--ro>
219
220 This changes the I<-a> and I<-m> options so that disks are added and
221 mounts are done read-only (see L<guestfs(3)/guestfs_mount_ro>).
222
223 The option must always be used if the disk image or virtual machine
224 might be running, and is generally recommended in cases where you
225 don't need write access to the disk.
226
227 Note that prepared disk images created with I<-N> are not affected by
228 the I<--ro> option.
229
230 =item B<--selinux>
231
232 Enable SELinux support for the guest.  See L<guestfs(3)/SELINUX>.
233
234 =item B<-v> | B<--verbose>
235
236 Enable very verbose messages.  This is particularly useful if you find
237 a bug.
238
239 =item B<-V> | B<--version>
240
241 Display the guestfish / libguestfs version number and exit.
242
243 =item B<-x>
244
245 Echo each command before executing it.
246
247 =back
248
249 =head1 COMMANDS ON COMMAND LINE
250
251 Any additional (non-option) arguments are treated as commands to
252 execute.
253
254 Commands to execute should be separated by a colon (C<:>), where the
255 colon is a separate parameter.  Thus:
256
257  guestfish cmd [args...] : cmd [args...] : cmd [args...] ...
258
259 If there are no additional arguments, then we enter a shell, either an
260 interactive shell with a prompt (if the input is a terminal) or a
261 non-interactive shell.
262
263 In either command line mode or non-interactive shell, the first
264 command that gives an error causes the whole shell to exit.  In
265 interactive mode (with a prompt) if a command fails, you can continue
266 to enter commands.
267
268 =head1 USING launch (OR run)
269
270 As with L<guestfs(3)>, you must first configure your guest by adding
271 disks, then launch it, then mount any disks you need, and finally
272 issue actions/commands.  So the general order of the day is:
273
274 =over 4
275
276 =item *
277
278 add or -a/--add
279
280 =item *
281
282 launch (aka run)
283
284 =item *
285
286 mount or -m/--mount
287
288 =item *
289
290 any other commands
291
292 =back
293
294 C<run> is a synonym for C<launch>.  You must C<launch> (or C<run>)
295 your guest before mounting or performing any other commands.
296
297 The only exception is that if the I<-m> or I<--mount> option was
298 given, the guest is automatically run for you (simply because
299 guestfish can't mount the disks you asked for without doing this).
300
301 =head1 QUOTING
302
303 You can quote ordinary parameters using either single or double
304 quotes.  For example:
305
306  add "file with a space.img"
307
308  rm '/file name'
309
310  rm '/"'
311
312 A few commands require a list of strings to be passed.  For these, use
313 a whitespace-separated list, enclosed in quotes.  Strings containing whitespace
314 to be passed through must be enclosed in single quotes.  A literal single quote
315 must be escaped with a backslash.
316
317  vgcreate VG "/dev/sda1 /dev/sdb1"
318  command "/bin/echo 'foo      bar'"
319  command "/bin/echo \'foo\'"
320
321 =head1 NUMBERS
322
323 This section applies to all commands which can take integers
324 as parameters.
325
326 =head2 SIZE SUFFIX
327
328 When the command takes a parameter measured in bytes, you can use one
329 of the following suffixes to specify kilobytes, megabytes and larger
330 sizes:
331
332 =over 4
333
334 =item B<k> or B<K> or B<KiB>
335
336 The size in kilobytes (multiplied by 1024).
337
338 =item B<KB>
339
340 The size in SI 1000 byte units.
341
342 =item B<M> or B<MiB>
343
344 The size in megabytes (multiplied by 1048576).
345
346 =item B<MB>
347
348 The size in SI 1000000 byte units.
349
350 =item B<G> or B<GiB>
351
352 The size in gigabytes (multiplied by 2**30).
353
354 =item B<GB>
355
356 The size in SI 10**9 byte units.
357
358 =item B<T> or B<TiB>
359
360 The size in terabytes (multiplied by 2**40).
361
362 =item B<TB>
363
364 The size in SI 10**12 byte units.
365
366 =item B<P> or B<PiB>
367
368 The size in petabytes (multiplied by 2**50).
369
370 =item B<PB>
371
372 The size in SI 10**15 byte units.
373
374 =item B<E> or B<EiB>
375
376 The size in exabytes (multiplied by 2**60).
377
378 =item B<EB>
379
380 The size in SI 10**18 byte units.
381
382 =item B<Z> or B<ZiB>
383
384 The size in zettabytes (multiplied by 2**70).
385
386 =item B<ZB>
387
388 The size in SI 10**21 byte units.
389
390 =item B<Y> or B<YiB>
391
392 The size in yottabytes (multiplied by 2**80).
393
394 =item B<YB>
395
396 The size in SI 10**24 byte units.
397
398 =back
399
400 For example:
401
402  truncate-size /file 1G
403
404 would truncate the file to 1 gigabyte.
405
406 Be careful because a few commands take sizes in kilobytes or megabytes
407 (eg. the parameter to L</memsize> is specified in megabytes already).
408 Adding a suffix will probably not do what you expect.
409
410 =head2 OCTAL AND HEXADECIMAL NUMBERS
411
412 For specifying the radix (base) use the C convention: C<0> to prefix
413 an octal number or C<0x> to prefix a hexadecimal number.  For example:
414
415  1234      decimal number 1234
416  02322     octal number, equivalent to decimal 1234
417  0x4d2     hexadecimal number, equivalent to decimal 1234
418
419 When using the C<chmod> command, you almost always want to specify an
420 octal number for the mode, and you must prefix it with C<0> (unlike
421 the Unix L<chmod(1)> program):
422
423  chmod 0777 /public  # OK
424  chmod 777 /public   # WRONG! This is mode 777 decimal = 01411 octal.
425
426 Commands that return numbers usually print them in decimal, but
427 some commands print numbers in other radices (eg. C<umask> prints
428 the mode in octal, preceeded by C<0>).
429
430 =head1 WILDCARDS AND GLOBBING
431
432 Neither guestfish nor the underlying guestfs API performs
433 wildcard expansion (globbing) by default.  So for example the
434 following will not do what you expect:
435
436  rm-rf /home/*
437
438 Assuming you don't have a directory literally called C</home/*>
439 then the above command will return an error.
440
441 To perform wildcard expansion, use the C<glob> command.
442
443  glob rm-rf /home/*
444
445 runs C<rm-rf> on each path that matches (ie. potentially running
446 the command many times), equivalent to:
447
448  rm-rf /home/jim
449  rm-rf /home/joe
450  rm-rf /home/mary
451
452 C<glob> only works on simple guest paths and not on device names.
453
454 If you have several parameters, each containing a wildcard, then glob
455 will perform a cartesian product.
456
457 =head1 COMMENTS
458
459 Any line which starts with a I<#> character is treated as a comment
460 and ignored.  The I<#> can optionally be preceeded by whitespace,
461 but B<not> by a command.  For example:
462
463  # this is a comment
464          # this is a comment
465  foo # NOT a comment
466
467 Blank lines are also ignored.
468
469 =head1 RUNNING COMMANDS LOCALLY
470
471 Any line which starts with a I<!> character is treated as a command
472 sent to the local shell (C</bin/sh> or whatever L<system(3)> uses).
473 For example:
474
475  !mkdir local
476  tgz-out /remote local/remote-data.tar.gz
477
478 will create a directory C<local> on the host, and then export
479 the contents of C</remote> on the mounted filesystem to
480 C<local/remote-data.tar.gz>.  (See C<tgz-out>).
481
482 To change the local directory, use the C<lcd> command.  C<!cd> will
483 have no effect, due to the way that subprocesses work in Unix.
484
485 =head1 PIPES
486
487 Use C<command E<lt>spaceE<gt> | command> to pipe the output of the
488 first command (a guestfish command) to the second command (any host
489 command).  For example:
490
491  cat /etc/passwd | awk -F: '$3 == 0 { print }'
492
493 (where C<cat> is the guestfish cat command, but C<awk> is the host awk
494 program).  The above command would list all accounts in the guest
495 filesystem which have UID 0, ie. root accounts including backdoors.
496 Other examples:
497
498  hexdump /bin/ls | head
499  list-devices | tail -1
500  tgz-out / - | tar ztf -
501
502 The space before the pipe symbol is required, any space after the pipe
503 symbol is optional.  Everything after the pipe symbol is just passed
504 straight to the host shell, so it can contain redirections, globs and
505 anything else that makes sense on the host side.
506
507 To use a literal argument which begins with a pipe symbol, you have
508 to quote it, eg:
509
510  echo "|"
511
512 =head1 HOME DIRECTORIES
513
514 If a parameter starts with the character C<~> then the tilde may be
515 expanded as a home directory path (either C<~> for the current user's
516 home directory, or C<~user> for another user).
517
518 Note that home directory expansion happens for users known I<on the
519 host>, not in the guest filesystem.
520
521 To use a literal argument which begins with a tilde, you have to quote
522 it, eg:
523
524  echo "~"
525
526 =head1 WINDOWS PATHS
527
528 If a path is prefixed with C<win:> then you can use Windows-style
529 paths (with some limitations).  The following commands are equivalent:
530
531  file /WINDOWS/system32/config/system.LOG
532
533  file win:/windows/system32/config/system.log
534
535  file win:\windows\system32\config\system.log
536
537  file WIN:C:\Windows\SYSTEM32\conFIG\SYSTEM.LOG
538
539 This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also
540 handles case insensitivity like Windows would.  This only works in
541 argument positions that expect a path.
542
543 =head1 UPLOADING AND DOWNLOADING FILES
544
545 For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and
546 others which upload from or download to a local file, you can use the
547 special filename C<-> to mean "from stdin" or "to stdout".  For example:
548
549  upload - /foo
550
551 reads stdin and creates from that a file C</foo> in the disk image,
552 and:
553
554  tar-out /etc - | tar tf -
555
556 writes the tarball to stdout and then pipes that into the external
557 "tar" command (see L</PIPES>).
558
559 When using C<-> to read from stdin, the input is read up to the end of
560 stdin.  You can also use a special "heredoc"-like syntax to read up to
561 some arbitrary end marker:
562
563  upload -<<END /foo
564  input line 1
565  input line 2
566  input line 3
567  END
568
569 Any string of characters can be used instead of C<END>.  The end
570 marker must appear on a line of its own, without any preceeding or
571 following characters (not even spaces).
572
573 Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to
574 upload local files (so-called "FileIn" parameters in the generator).
575
576 =head1 EXIT ON ERROR BEHAVIOUR
577
578 By default, guestfish will ignore any errors when in interactive mode
579 (ie. taking commands from a human over a tty), and will exit on the
580 first error in non-interactive mode (scripts, commands given on the
581 command line).
582
583 If you prefix a command with a I<-> character, then that command will
584 not cause guestfish to exit, even if that (one) command returns an
585 error.
586
587 =head1 REMOTE CONTROL GUESTFISH OVER A SOCKET
588
589 Guestfish can be remote-controlled over a socket.  This is useful
590 particularly in shell scripts where you want to make several different
591 changes to a filesystem, but you don't want the overhead of starting
592 up a guestfish process each time.
593
594 Start a guestfish server process using:
595
596  eval `guestfish --listen`
597
598 and then send it commands by doing:
599
600  guestfish --remote cmd [...]
601
602 To cause the server to exit, send it the exit command:
603
604  guestfish --remote exit
605
606 Note that the server will normally exit if there is an error in a
607 command.  You can change this in the usual way.  See section
608 L</EXIT ON ERROR BEHAVIOUR>.
609
610 =head2 CONTROLLING MULTIPLE GUESTFISH PROCESSES
611
612 The C<eval> statement sets the environment variable C<$GUESTFISH_PID>,
613 which is how the I<--remote> option knows where to send the commands.
614 You can have several guestfish listener processes running using:
615
616  eval `guestfish --listen`
617  pid1=$GUESTFISH_PID
618  eval `guestfish --listen`
619  pid2=$GUESTFISH_PID
620  ...
621  guestfish --remote=$pid1 cmd
622  guestfish --remote=$pid2 cmd
623
624 =head2 REMOTE CONTROL DETAILS
625
626 Remote control happens over a Unix domain socket called
627 C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective
628 user ID of the process, and C<$PID> is the process ID of the server.
629
630 Guestfish client and server versions must match exactly.
631
632 =head1 PREPARED DISK IMAGES
633
634 Use the I<-N type> or I<--new type> parameter to select one of a set
635 of preformatted disk images that guestfish can make for you to save
636 typing.  This is particularly useful for testing purposes.  This
637 option is used instead of the I<-a> option, and like I<-a> can appear
638 multiple times (and can be mixed with I<-a>).
639
640 The new disk is called C<test1.img> for the first I<-N>, C<test2.img>
641 for the second and so on.  Existing files in the current directory are
642 I<overwritten>.
643
644 The type briefly describes how the disk should be sized, partitioned,
645 how filesystem(s) should be created, and how content should be added.
646 Optionally the type can be followed by extra parameters, separated by
647 C<:> (colon) characters.  For example, I<-N fs> creates a default
648 100MB, sparsely-allocated disk, containing a single partition, with
649 the partition formatted as ext2.  I<-N fs:ext4:1G> is the same, but
650 for an ext4 filesystem on a 1GB disk instead.
651
652 To list the available types and any extra parameters they take, run:
653
654  guestfish -N list | less
655
656 Note that the prepared filesystem is not mounted.  You would usually
657 have to use the C<mount /dev/sda1 /> command or add the
658 I<-m /dev/sda1> option.
659
660 If any I<-N> or I<--new> options are given, the guest is automatically
661 launched.
662
663 =head2 EXAMPLES
664
665 Create a 100MB disk with an ext4-formatted partition:
666
667  guestfish -N fs:ext4
668
669 Create a 32MB disk with a VFAT-formatted partition, and mount it:
670
671  guestfish -N fs:vfat:32M -m /dev/sda1
672
673 Create a blank 200MB disk:
674
675  guestfish -N disk:200M
676
677 =head1 GUESTFISH COMMANDS
678
679 The commands in this section are guestfish convenience commands, in
680 other words, they are not part of the L<guestfs(3)> API.
681
682 =head2 alloc | allocate
683
684  alloc filename size
685
686 This creates an empty (zeroed) file of the given size, and then adds
687 so it can be further examined.
688
689 For more advanced image creation, see L<qemu-img(1)> utility.
690
691 Size can be specified using standard suffixes, eg. C<1M>.
692
693 =head2 echo
694
695  echo [params ...]
696
697 This echos the parameters to the terminal.
698
699 =head2 edit | vi | emacs
700
701  edit filename
702
703 This is used to edit a file.  It downloads the file, edits it
704 locally using your editor, then uploads the result.
705
706 The editor is C<$EDITOR>.  However if you use the alternate
707 commands C<vi> or C<emacs> you will get those corresponding
708 editors.
709
710 NOTE: This will not work reliably for large files
711 (> 2 MB) or binary files containing \0 bytes.
712
713 =head2 glob
714
715  glob command args...
716
717 Expand wildcards in any paths in the args list, and run C<command>
718 repeatedly on each matching path.
719
720 See section WILDCARDS AND GLOBBING.
721
722 =head2 help
723
724  help
725  help cmd
726
727 Without any parameter, this lists all commands.  With a C<cmd>
728 parameter, this displays detailed help for a command.
729
730 =head2 lcd
731
732  lcd directory
733
734 Change the local directory, ie. the current directory of guestfish
735 itself.
736
737 Note that C<!cd> won't do what you might expect.
738
739 =head2 man | manual
740
741  man
742
743 Opens the manual page for guestfish.
744
745 =head2 more | less
746
747  more filename
748
749  less filename
750
751 This is used to view a file.
752
753 The default viewer is C<$PAGER>.  However if you use the alternate
754 command C<less> you will get the C<less> command specifically.
755
756 NOTE: This will not work reliably for large files
757 (> 2 MB) or binary files containing \0 bytes.
758
759 =head2 quit | exit
760
761 This exits guestfish.  You can also use C<^D> key.
762
763 =head2 reopen
764
765  reopen
766
767 Close and reopen the libguestfs handle.  It is not necessary to use
768 this normally, because the handle is closed properly when guestfish
769 exits.  However this is occasionally useful for testing.
770
771 =head2 sparse
772
773  sparse filename size
774
775 This creates an empty sparse file of the given size, and then adds
776 so it can be further examined.
777
778 In all respects it works the same as the C<alloc> command, except that
779 the image file is allocated sparsely, which means that disk blocks are
780 not assigned to the file until they are needed.  Sparse disk files
781 only use space when written to, but they are slower and there is a
782 danger you could run out of real disk space during a write operation.
783
784 For more advanced image creation, see L<qemu-img(1)> utility.
785
786 Size can be specified using standard suffixes, eg. C<1M>.
787
788 =head2 supported
789
790  supported
791
792 This command returns a list of the optional groups
793 known to the daemon, and indicates which ones are
794 supported by this build of the libguestfs appliance.
795
796 See also L<guestfs(3)/AVAILABILITY>.
797
798 =head2 time
799
800  time command args...
801
802 Run the command as usual, but print the elapsed time afterwards.  This
803 can be useful for benchmarking operations.
804
805 =head1 COMMANDS
806
807 @ACTIONS@
808
809 =head1 ENVIRONMENT VARIABLES
810
811 =over 4
812
813 =item EDITOR
814
815 The C<edit> command uses C<$EDITOR> as the editor.  If not
816 set, it uses C<vi>.
817
818 =item GUESTFISH_PID
819
820 Used with the I<--remote> option to specify the remote guestfish
821 process to control.  See section
822 L</REMOTE CONTROL GUESTFISH OVER A SOCKET>.
823
824 =item HOME
825
826 If compiled with GNU readline support, then the command history
827 is saved in C<$HOME/.guestfish>
828
829 =item LIBGUESTFS_APPEND
830
831 Pass additional options to the guest kernel.
832
833 =item LIBGUESTFS_DEBUG
834
835 Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages.  This has the
836 same effect as using the B<-v> option.
837
838 =item LIBGUESTFS_MEMSIZE
839
840 Set the memory allocated to the qemu process, in megabytes.  For
841 example:
842
843  LIBGUESTFS_MEMSIZE=700
844
845 =item LIBGUESTFS_PATH
846
847 Set the path that guestfish uses to search for kernel and initrd.img.
848 See the discussion of paths in L<guestfs(3)>.
849
850 =item LIBGUESTFS_QEMU
851
852 Set the default qemu binary that libguestfs uses.  If not set, then
853 the qemu which was found at compile time by the configure script is
854 used.
855
856 =item LIBGUESTFS_TRACE
857
858 Set C<LIBGUESTFS_TRACE=1> to enable command traces.
859
860 =item PAGER
861
862 The C<more> command uses C<$PAGER> as the pager.  If not
863 set, it uses C<more>.
864
865 =item TMPDIR
866
867 Location of temporary directory, defaults to C</tmp>.
868
869 If libguestfs was compiled to use the supermin appliance then each
870 handle will require rather a large amount of space in this directory
871 for short periods of time (~ 80 MB).  You can use C<$TMPDIR> to
872 configure another directory to use in case C</tmp> is not large
873 enough.
874
875 =back
876
877 =head1 EXIT CODE
878
879 guestfish returns 0 if the commands completed without error, or
880 1 if there was an error.
881
882 =head1 SEE ALSO
883
884 L<guestfs(3)>,
885 L<http://libguestfs.org/>,
886 L<virt-cat(1)>,
887 L<virt-df(1)>,
888 L<virt-edit(1)>,
889 L<virt-list-filesystems(1)>,
890 L<virt-list-partitions(1)>,
891 L<virt-ls(1)>,
892 L<virt-make-fs(1)>,
893 L<virt-rescue(1)>,
894 L<virt-resize(1)>,
895 L<virt-tar(1)>,
896 L<virt-win-reg(1)>.
897
898 =head1 AUTHORS
899
900 Richard W.M. Jones (C<rjones at redhat dot com>)
901
902 =head1 COPYRIGHT
903
904 Copyright (C) 2009-2010 Red Hat Inc.
905 L<http://libguestfs.org/>
906
907 This program is free software; you can redistribute it and/or modify
908 it under the terms of the GNU General Public License as published by
909 the Free Software Foundation; either version 2 of the License, or
910 (at your option) any later version.
911
912 This program is distributed in the hope that it will be useful,
913 but WITHOUT ANY WARRANTY; without even the implied warranty of
914 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
915 GNU General Public License for more details.
916
917 You should have received a copy of the GNU General Public License
918 along with this program; if not, write to the Free Software
919 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.