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