5 guestfish - the libguestfs Filesystem Interactive SHell
9 guestfish [--options] [commands]
13 guestfish [--ro|--rw] -a disk.img
15 guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]
17 guestfish -d libvirt-domain
19 guestfish [--ro|--rw] -a disk.img -i
21 guestfish -d libvirt-domain -i
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.
32 Guestfish is a shell and command-line tool for examining and modifying
33 virtual machine filesystems. It uses libguestfs and exposes all of
34 the functionality of the guestfs API, see L<guestfs(3)>.
36 Guestfish gives you structured access to the libguestfs API, from
37 shell scripts or the command line or interactively. If you want to
38 rescue a broken virtual machine image, you should look at the
39 L<virt-rescue(1)> command.
43 =head2 As an interactive shell
47 Welcome to guestfish, the libguestfs filesystem interactive shell for
48 editing virtual machine filesystems.
50 Type: 'help' for a list of commands
51 'man' to read the manual
52 'quit' to quit the shell
56 ><fs> list-filesystems
58 /dev/vg_guest/lv_root: ext4
59 /dev/vg_guest/lv_swap: swap
60 ><fs> mount /dev/vg_guest/lv_root /
67 =head2 From shell scripts
69 Create a new C</etc/motd> file in a guest or disk image:
74 mount /dev/vg_guest/lv_root /
75 write /etc/motd "Welcome, new users"
78 List the LVM logical volumes in a disk image:
80 guestfish -a disk.img --ro <<_EOF_
85 List all the filesystems in a disk image:
87 guestfish -a disk.img --ro <<_EOF_
92 =head2 On one command line
94 Update C</etc/resolv.conf> in a guest:
97 add disk.img : run : mount /dev/vg_guest/lv_root / : \
98 write /etc/resolv.conf "nameserver 1.2.3.4"
100 Edit C</boot/grub/grub.conf> interactively:
102 guestfish --rw --add disk.img \
103 --mount /dev/vg_guest/lv_root \
104 --mount /dev/sda1:/boot \
105 edit /boot/grub/grub.conf
107 =head2 Mount disks automatically
109 Use the I<-i> option to automatically mount the
110 disks from a virtual machine:
112 guestfish --ro -a disk.img -i cat /etc/group
114 guestfish --ro -d libvirt-domain -i cat /etc/group
116 Another way to edit C</boot/grub/grub.conf> interactively is:
118 guestfish --rw -a disk.img -i edit /boot/grub/grub.conf
120 =head2 As a script interpreter
122 Create a 100MB disk containing an ext2-formatted partition:
124 #!/usr/bin/guestfish -f
125 sparse test1.img 100M
127 part-disk /dev/sda mbr
130 =head2 Start with a prepared disk
132 An alternate way to create a 100MB disk called C<test1.img> containing
133 a single ext2-formatted partition:
137 To list what is available do:
139 guestfish -N help | less
141 =head2 Remote control
143 eval "`guestfish --listen`"
144 guestfish --remote add-ro disk.img
145 guestfish --remote run
146 guestfish --remote lvs
154 Displays general help on options.
160 Lists all available guestfish commands.
164 =item B<--cmd-help cmd>
166 Displays detailed help on a single command C<cmd>.
172 Add a block device or virtual machine image to the shell.
174 The format of the disk image is auto-detected. To override this and
175 force a particular format use the I<--format=..> option.
177 Using this flag is mostly equivalent to using the C<add> command,
178 with C<readonly:true> if the I<--ro> flag was given, and
179 with C<format:...> if the I<--format:...> flag was given.
183 =item B<--connect URI>
185 When used in conjunction with the I<-d> option, this specifies
186 the libvirt URI to use. The default is to use the default libvirt
191 If using the I<--listen> option and a csh-like shell, use this option.
192 See section L</REMOTE CONTROL AND CSH> below.
194 =item B<-d libvirt-domain>
196 =item B<--domain libvirt-domain>
198 Add disks from the named libvirt domain. If the I<--ro> option is
199 also used, then any libvirt domain can be used. However in write
200 mode, only libvirt domains which are shut down can be named here.
202 Using this flag is mostly equivalent to using the C<add-domain> command,
203 with C<readonly:true> if the I<--ro> flag was given, and
204 with C<format:...> if the I<--format:...> flag was given.
208 =item B<--no-dest-paths>
210 Don't tab-complete paths on the guest filesystem. It is useful to be
211 able to hit the tab key to complete paths on the guest filesystem, but
212 this causes extra "hidden" guestfs calls to be made, so this option is
213 here to allow this feature to be disabled.
217 When prompting for keys and passphrases, guestfish normally turns
218 echoing off so you cannot see what you are typing. If you are not
219 worried about Tempest attacks and there is no one else in the room
220 you can specify this flag to see what you are typing.
226 Read commands from C<file>. To write pure guestfish
229 #!/usr/bin/guestfish -f
231 =item B<--format=raw|qcow2|..>
235 The default for the I<-a> option is to auto-detect the format of the
236 disk image. Using this forces the disk format for I<-a> options which
237 follow on the command line. Using I<--format> with no argument
238 switches back to auto-detection for subsequent I<-a> options.
242 guestfish --format=raw -a disk.img
244 forces raw format (no auto-detection) for C<disk.img>.
246 guestfish --format=raw -a disk.img --format -a another.img
248 forces raw format (no auto-detection) for C<disk.img> and reverts to
249 auto-detection for C<another.img>.
251 If you have untrusted raw-format guest disk images, you should use
252 this option to specify the disk format. This avoids a possible
253 security problem with malicious guests (CVE-2010-3851). See also
260 Using L<virt-inspector(1)> code, inspect the disks looking for
261 an operating system and mount filesystems as they would be
262 mounted on the real virtual machine.
264 Typical usage is either:
266 guestfish -d myguest -i
268 (for an inactive libvirt domain called I<myguest>), or:
270 guestfish --ro -d myguest -i
272 (for active domains, readonly), or specify the block device directly:
274 guestfish --rw -a /dev/Guests/MyGuest -i
276 Note that the command line syntax changed slightly over older
277 versions of guestfish. You can still use the old syntax:
279 guestfish [--ro] -i disk.img
281 guestfish [--ro] -i libvirt-domain
283 Using this flag is mostly equivalent to using the C<inspect-os>
284 command and then using other commands to mount the filesystems that
287 =item B<--keys-from-stdin>
289 Read key or passphrase parameters from stdin. The default is
290 to try to read passphrases from the user by opening C</dev/tty>.
294 Fork into the background and listen for remote commands. See section
295 L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
299 Connect to a live virtual machine.
300 (Experimental, see L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>).
302 =item B<-m dev[:mountpoint[:options]]>
304 =item B<--mount dev[:mountpoint[:options]]>
306 Mount the named partition or logical volume on the given mountpoint.
308 If the mountpoint is omitted, it defaults to C</>.
310 You have to mount something on C</> before most commands will work.
312 If any I<-m> or I<--mount> options are given, the guest is
313 automatically launched.
315 If you don't know what filesystems a disk image contains, you can
316 either run guestfish without this option, then list the partitions,
317 filesystems and LVs available (see L</list-partitions>,
318 L</list-filesystems> and L</lvs> commands), or you can use the
319 L<virt-filesystems(1)> program.
321 The third (and rarely used) part of the mount parameter is the list of
322 mount options used to mount the underlying filesystem. If this is not
323 given, then the mount options are either the empty string or C<ro>
324 (the latter if the I<--ro> flag is used). By specifying the mount
325 options, you override this default choice. Probably the only time you
326 would use this is to enable ACLs and/or extended attributes if the
327 filesystem can support them:
329 -m /dev/sda1:/:acl,user_xattr
331 Using this flag is equivalent to using the C<mount-options> command.
337 Disable autosync. This is enabled by default. See the discussion
338 of autosync in the L<guestfs(3)> manpage.
346 Prepare a fresh disk image formatted as "type". This is an
347 alternative to the I<-a> option: whereas I<-a> adds an existing disk,
348 I<-N> creates a preformatted disk with a filesystem and adds it.
349 See L</PREPARED DISK IMAGES> below.
351 =item B<--progress-bars>
353 Enable progress bars, even when guestfish is used non-interactively.
355 Progress bars are enabled by default when guestfish is used as an
358 =item B<--no-progress-bars>
360 Disable progress bars.
362 =item B<--remote[=pid]>
364 Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section
365 L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
371 This changes the I<-a>, I<-d> and I<-m> options so that disks are
372 added and mounts are done read-only.
374 The option must always be used if the disk image or virtual machine
375 might be running, and is generally recommended in cases where you
376 don't need write access to the disk.
378 Note that prepared disk images created with I<-N> are not affected by
379 this option. Also commands like C<add> are not affected - you have to
380 specify the C<readonly:true> option explicitly if you need it.
382 See also L</OPENING DISKS FOR READ AND WRITE> below.
386 Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>.
392 Enable very verbose messages. This is particularly useful if you find
399 Display the guestfish / libguestfs version number and exit.
405 This changes the I<-a>, I<-d> and I<-m> options so that disks are
406 added and mounts are done read-write.
408 See L</OPENING DISKS FOR READ AND WRITE> below.
412 Echo each command before executing it.
416 =head1 COMMANDS ON COMMAND LINE
418 Any additional (non-option) arguments are treated as commands to
421 Commands to execute should be separated by a colon (C<:>), where the
422 colon is a separate parameter. Thus:
424 guestfish cmd [args...] : cmd [args...] : cmd [args...] ...
426 If there are no additional arguments, then we enter a shell, either an
427 interactive shell with a prompt (if the input is a terminal) or a
428 non-interactive shell.
430 In either command line mode or non-interactive shell, the first
431 command that gives an error causes the whole shell to exit. In
432 interactive mode (with a prompt) if a command fails, you can continue
435 =head1 USING launch (OR run)
437 As with L<guestfs(3)>, you must first configure your guest by adding
438 disks, then launch it, then mount any disks you need, and finally
439 issue actions/commands. So the general order of the day is:
461 C<run> is a synonym for C<launch>. You must C<launch> (or C<run>)
462 your guest before mounting or performing any other commands.
464 The only exception is that if any of the I<-i>, I<-m>, I<--mount>,
465 I<-N> or I<--new> options were given then C<run> is done
466 automatically, simply because guestfish can't perform the action you
467 asked for without doing this.
469 =head1 OPENING DISKS FOR READ AND WRITE
471 The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro>
472 and I<--rw> affect whether the other command line options I<-a>,
473 I<-c>, I<-d>, I<-i> and I<-m> open disk images read-only or for
476 In libguestfs E<le> 1.8, guestfish, guestmount and virt-rescue
477 defaulted to opening disk images supplied on the command line for
478 write. To open a disk image read-only you have to do I<-a image --ro>.
480 This matters: If you accidentally open a live VM disk image writable
481 then you will cause irreversible disk corruption.
483 By libguestfs 1.10 we intend to change the default the other way.
484 Disk images will be opened read-only. You will have to either specify
485 I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change
486 the configuration file C</etc/libguestfs-tools.conf> in order to get
487 write access for disk images specified by those other command line
490 This version of guestfish, guestmount and virt-rescue has a I<--rw>
491 option which does nothing (it is already the default). However it is
492 highly recommended that you use this option to indicate that you need
493 write access, and prepare your scripts for the day when this option
494 will be required for write access.
496 B<Note:> This does I<not> affect commands like L</add> and L</mount>,
497 or any other libguestfs program apart from guestfish and guestmount.
501 You can quote ordinary parameters using either single or double
504 add "file with a space.img"
510 A few commands require a list of strings to be passed. For these, use
511 a whitespace-separated list, enclosed in quotes. Strings containing whitespace
512 to be passed through must be enclosed in single quotes. A literal single quote
513 must be escaped with a backslash.
515 vgcreate VG "/dev/sda1 /dev/sdb1"
516 command "/bin/echo 'foo bar'"
517 command "/bin/echo \'foo\'"
519 =head1 OPTIONAL ARGUMENTS
521 Some commands take optional arguments. These arguments appear in this
522 documentation as C<[argname:..]>. You can use them as in these
525 add-drive-opts filename
527 add-drive-opts filename readonly:true
529 add-drive-opts filename format:qcow2 readonly:false
531 Each optional argument can appear at most once. All optional
532 arguments must appear after the required ones.
536 This section applies to all commands which can take integers
541 When the command takes a parameter measured in bytes, you can use one
542 of the following suffixes to specify kilobytes, megabytes and larger
547 =item B<k> or B<K> or B<KiB>
549 The size in kilobytes (multiplied by 1024).
553 The size in SI 1000 byte units.
557 The size in megabytes (multiplied by 1048576).
561 The size in SI 1000000 byte units.
565 The size in gigabytes (multiplied by 2**30).
569 The size in SI 10**9 byte units.
573 The size in terabytes (multiplied by 2**40).
577 The size in SI 10**12 byte units.
581 The size in petabytes (multiplied by 2**50).
585 The size in SI 10**15 byte units.
589 The size in exabytes (multiplied by 2**60).
593 The size in SI 10**18 byte units.
597 The size in zettabytes (multiplied by 2**70).
601 The size in SI 10**21 byte units.
605 The size in yottabytes (multiplied by 2**80).
609 The size in SI 10**24 byte units.
615 truncate-size /file 1G
617 would truncate the file to 1 gigabyte.
619 Be careful because a few commands take sizes in kilobytes or megabytes
620 (eg. the parameter to L</memsize> is specified in megabytes already).
621 Adding a suffix will probably not do what you expect.
623 =head2 OCTAL AND HEXADECIMAL NUMBERS
625 For specifying the radix (base) use the C convention: C<0> to prefix
626 an octal number or C<0x> to prefix a hexadecimal number. For example:
628 1234 decimal number 1234
629 02322 octal number, equivalent to decimal 1234
630 0x4d2 hexadecimal number, equivalent to decimal 1234
632 When using the C<chmod> command, you almost always want to specify an
633 octal number for the mode, and you must prefix it with C<0> (unlike
634 the Unix L<chmod(1)> program):
636 chmod 0777 /public # OK
637 chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.
639 Commands that return numbers usually print them in decimal, but
640 some commands print numbers in other radices (eg. C<umask> prints
641 the mode in octal, preceeded by C<0>).
643 =head1 WILDCARDS AND GLOBBING
645 Neither guestfish nor the underlying guestfs API performs
646 wildcard expansion (globbing) by default. So for example the
647 following will not do what you expect:
651 Assuming you don't have a directory called literally C</home/*>
652 then the above command will return an error.
654 To perform wildcard expansion, use the C<glob> command.
658 runs C<rm-rf> on each path that matches (ie. potentially running
659 the command many times), equivalent to:
665 C<glob> only works on simple guest paths and not on device names.
667 If you have several parameters, each containing a wildcard, then glob
668 will perform a Cartesian product.
672 Any line which starts with a I<#> character is treated as a comment
673 and ignored. The I<#> can optionally be preceeded by whitespace,
674 but B<not> by a command. For example:
680 Blank lines are also ignored.
682 =head1 RUNNING COMMANDS LOCALLY
684 Any line which starts with a I<!> character is treated as a command
685 sent to the local shell (C</bin/sh> or whatever L<system(3)> uses).
689 tgz-out /remote local/remote-data.tar.gz
691 will create a directory C<local> on the host, and then export
692 the contents of C</remote> on the mounted filesystem to
693 C<local/remote-data.tar.gz>. (See C<tgz-out>).
695 To change the local directory, use the C<lcd> command. C<!cd> will
696 have no effect, due to the way that subprocesses work in Unix.
698 =head2 LOCAL COMMANDS WITH INLINE EXECUTION
700 If a line starts with I<E<lt>!> then the shell command is executed (as
701 for I<!>), but subsequently any output (stdout) of the shell command
702 is parsed and executed as guestfish commands.
704 Thus you can use shell script to construct arbitrary guestfish
705 commands which are then parsed by guestfish.
707 For example it is tedious to create a sequence of files
708 (eg. C</foo.1> through C</foo.100>) using guestfish commands
709 alone. However this is simple if we use a shell script to
710 create the guestfish commands for us:
712 <! for n in `seq 1 100`; do echo write /foo.$n $n; done
714 or with names like C</foo.001>:
716 <! for n in `seq 1 100`; do printf "write /foo.%03d %d\n" $n $n; done
718 When using guestfish interactively it can be helpful to just run the
719 shell script first (ie. remove the initial C<E<lt>> character so it is
720 just an ordinary I<!> local command), see what guestfish commands it
721 would run, and when you are happy with those prepend the C<E<lt>>
722 character to run the guestfish commands for real.
726 Use C<command E<lt>spaceE<gt> | command> to pipe the output of the
727 first command (a guestfish command) to the second command (any host
728 command). For example:
730 cat /etc/passwd | awk -F: '$3 == 0 { print }'
732 (where C<cat> is the guestfish cat command, but C<awk> is the host awk
733 program). The above command would list all accounts in the guest
734 filesystem which have UID 0, ie. root accounts including backdoors.
737 hexdump /bin/ls | head
738 list-devices | tail -1
739 tgz-out / - | tar ztf -
741 The space before the pipe symbol is required, any space after the pipe
742 symbol is optional. Everything after the pipe symbol is just passed
743 straight to the host shell, so it can contain redirections, globs and
744 anything else that makes sense on the host side.
746 To use a literal argument which begins with a pipe symbol, you have
751 =head1 HOME DIRECTORIES
753 If a parameter starts with the character C<~> then the tilde may be
754 expanded as a home directory path (either C<~> for the current user's
755 home directory, or C<~user> for another user).
757 Note that home directory expansion happens for users known I<on the
758 host>, not in the guest filesystem.
760 To use a literal argument which begins with a tilde, you have to quote
765 =head1 ENCRYPTED DISKS
767 Libguestfs has some support for Linux guests encrypted according to
768 the Linux Unified Key Setup (LUKS) standard, which includes nearly all
769 whole disk encryption systems used by modern Linux guests. Currently
770 only LVM-on-LUKS is supported.
772 Identify encrypted block devices and partitions using L</vfs-type>:
774 ><fs> vfs-type /dev/sda2
777 Then open those devices using L</luks-open>. This creates a
778 device-mapper device called C</dev/mapper/luksdev>.
780 ><fs> luks-open /dev/sda2 luksdev
781 Enter key or passphrase ("key"): <enter the passphrase>
783 Finally you have to tell LVM to scan for volume groups on
784 the newly created mapper device:
789 The logical volume(s) can now be mounted in the usual way.
791 Before closing a LUKS device you must unmount any logical volumes on
792 it and deactivate the volume groups by calling C<vg-activate false VG>
793 on each one. Then you can close the mapper device:
795 vg-activate false /dev/VG
796 luks-close /dev/mapper/luksdev
800 If a path is prefixed with C<win:> then you can use Windows-style
801 drive letters and paths (with some limitations). The following
802 commands are equivalent:
804 file /WINDOWS/system32/config/system.LOG
806 file win:\windows\system32\config\system.log
808 file WIN:C:\Windows\SYSTEM32\CONFIG\SYSTEM.LOG
810 The parameter is rewritten "behind the scenes" by looking up the
811 position where the drive is mounted, prepending that to the path,
812 changing all backslash characters to forward slash, then resolving the
813 result using L</case-sensitive-path>. For example if the E: drive
814 was mounted on C</e> then the parameter might be rewritten like this:
816 win:e:\foo\bar => /e/FOO/bar
818 This only works in argument positions that expect a path.
820 =head1 UPLOADING AND DOWNLOADING FILES
822 For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and
823 others which upload from or download to a local file, you can use the
824 special filename C<-> to mean "from stdin" or "to stdout". For example:
828 reads stdin and creates from that a file C</foo> in the disk image,
831 tar-out /etc - | tar tf -
833 writes the tarball to stdout and then pipes that into the external
834 "tar" command (see L</PIPES>).
836 When using C<-> to read from stdin, the input is read up to the end of
837 stdin. You can also use a special "heredoc"-like syntax to read up to
838 some arbitrary end marker:
846 Any string of characters can be used instead of C<END>. The end
847 marker must appear on a line of its own, without any preceeding or
848 following characters (not even spaces).
850 Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to
851 upload local files (so-called "FileIn" parameters in the generator).
853 =head1 EXIT ON ERROR BEHAVIOUR
855 By default, guestfish will ignore any errors when in interactive mode
856 (ie. taking commands from a human over a tty), and will exit on the
857 first error in non-interactive mode (scripts, commands given on the
860 If you prefix a command with a I<-> character, then that command will
861 not cause guestfish to exit, even if that (one) command returns an
864 =head1 REMOTE CONTROL GUESTFISH OVER A SOCKET
866 Guestfish can be remote-controlled over a socket. This is useful
867 particularly in shell scripts where you want to make several different
868 changes to a filesystem, but you don't want the overhead of starting
869 up a guestfish process each time.
871 Start a guestfish server process using:
873 eval "`guestfish --listen`"
875 and then send it commands by doing:
877 guestfish --remote cmd [...]
879 To cause the server to exit, send it the exit command:
881 guestfish --remote exit
883 Note that the server will normally exit if there is an error in a
884 command. You can change this in the usual way. See section
885 L</EXIT ON ERROR BEHAVIOUR>.
887 =head2 CONTROLLING MULTIPLE GUESTFISH PROCESSES
889 The C<eval> statement sets the environment variable C<$GUESTFISH_PID>,
890 which is how the I<--remote> option knows where to send the commands.
891 You can have several guestfish listener processes running using:
893 eval "`guestfish --listen`"
895 eval "`guestfish --listen`"
898 guestfish --remote=$pid1 cmd
899 guestfish --remote=$pid2 cmd
901 =head2 REMOTE CONTROL AND CSH
903 When using csh-like shells (csh, tcsh etc) you have to add the
906 eval "`guestfish --listen --csh`"
908 =head2 REMOTE CONTROL DETAILS
910 Remote control happens over a Unix domain socket called
911 C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective
912 user ID of the process, and C<$PID> is the process ID of the server.
914 Guestfish client and server versions must match exactly.
916 =head1 PREPARED DISK IMAGES
918 Use the I<-N type> or I<--new type> parameter to select one of a set
919 of preformatted disk images that guestfish can make for you to save
920 typing. This is particularly useful for testing purposes. This
921 option is used instead of the I<-a> option, and like I<-a> can appear
922 multiple times (and can be mixed with I<-a>).
924 The new disk is called C<test1.img> for the first I<-N>, C<test2.img>
925 for the second and so on. Existing files in the current directory are
928 The type briefly describes how the disk should be sized, partitioned,
929 how filesystem(s) should be created, and how content should be added.
930 Optionally the type can be followed by extra parameters, separated by
931 C<:> (colon) characters. For example, I<-N fs> creates a default
932 100MB, sparsely-allocated disk, containing a single partition, with
933 the partition formatted as ext2. I<-N fs:ext4:1G> is the same, but
934 for an ext4 filesystem on a 1GB disk instead.
936 To list the available types and any extra parameters they take, run:
938 guestfish -N help | less
940 Note that the prepared filesystem is not mounted. You would usually
941 have to use the C<mount /dev/sda1 /> command or add the
942 I<-m /dev/sda1> option.
944 If any I<-N> or I<--new> options are given, the guest is automatically
949 Create a 100MB disk with an ext4-formatted partition:
953 Create a 32MB disk with a VFAT-formatted partition, and mount it:
955 guestfish -N fs:vfat:32M -m /dev/sda1
957 Create a blank 200MB disk:
959 guestfish -N disk:200M
963 Some (not all) long-running commands send progress notification
964 messages as they are running. Guestfish turns these messages into
967 When a command that supports progress bars takes longer than two
968 seconds to run, and if progress bars are enabled, then you will see
969 one appearing below the command:
971 ><fs> copy-size /large-file /another-file 2048M
972 / 10% [#####-----------------------------------------] 00:30
974 The spinner on the left hand side moves round once for every progress
975 notification received from the backend. This is a (reasonably) golden
976 assurance that the command is "doing something" even if the progress
977 bar is not moving, because the command is able to send the progress
978 notifications. When the bar reaches 100% and the command finishes,
979 the spinner disappears.
981 Progress bars are enabled by default when guestfish is used
982 interactively. You can enable them even for non-interactive modes
983 using I<--progress-bars>, and you can disable them completely using
984 I<--no-progress-bars>.
986 =head1 GUESTFISH COMMANDS
988 The commands in this section are guestfish convenience commands, in
989 other words, they are not part of the L<guestfs(3)> API.
996 Without any parameter, this provides general help.
998 With a C<cmd> parameter, this displays detailed help for that command.
1002 This exits guestfish. You can also use C<^D> key.
1012 guestfish returns 0 if the commands completed without error, or
1013 1 if there was an error.
1015 =head1 ENVIRONMENT VARIABLES
1021 The C<edit> command uses C<$EDITOR> as the editor. If not
1026 Used with the I<--remote> option to specify the remote guestfish
1027 process to control. See section
1028 L</REMOTE CONTROL GUESTFISH OVER A SOCKET>.
1032 The L</hexedit> command uses C<$HEXEDITOR> as the external hex
1033 editor. If not specified, the external L<hexedit(1)> program
1038 If compiled with GNU readline support, various files in the
1039 home directory can be used. See L</FILES>.
1041 =item LIBGUESTFS_APPEND
1043 Pass additional options to the guest kernel.
1045 =item LIBGUESTFS_DEBUG
1047 Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the
1048 same effect as using the B<-v> option.
1050 =item LIBGUESTFS_MEMSIZE
1052 Set the memory allocated to the qemu process, in megabytes. For
1055 LIBGUESTFS_MEMSIZE=700
1057 =item LIBGUESTFS_PATH
1059 Set the path that guestfish uses to search for kernel and initrd.img.
1060 See the discussion of paths in L<guestfs(3)>.
1062 =item LIBGUESTFS_QEMU
1064 Set the default qemu binary that libguestfs uses. If not set, then
1065 the qemu which was found at compile time by the configure script is
1068 =item LIBGUESTFS_TRACE
1070 Set C<LIBGUESTFS_TRACE=1> to enable command traces.
1074 The C<more> command uses C<$PAGER> as the pager. If not
1075 set, it uses C<more>.
1079 Location of temporary directory, defaults to C</tmp> except for the
1080 cached supermin appliance which defaults to C</var/tmp>.
1082 If libguestfs was compiled to use the supermin appliance then the
1083 real appliance is cached in this directory, shared between all
1084 handles belonging to the same EUID. You can use C<$TMPDIR> to
1085 configure another directory to use in case C</var/tmp> is not large
1094 =item $HOME/.libguestfs-tools.rc
1096 =item /etc/libguestfs-tools.conf
1098 This configuration file controls the default read-only or read-write
1099 mode (I<--ro> or I<--rw>).
1101 See L</OPENING DISKS FOR READ AND WRITE>.
1103 =item $HOME/.guestfish
1105 If compiled with GNU readline support, then the command history
1106 is saved in this file.
1108 =item $HOME/.inputrc
1112 If compiled with GNU readline support, then these files can be used to
1113 configure readline. For further information, please see
1114 L<readline(3)/INITIALIZATION FILE>.
1116 To write rules which only apply to guestfish, use:
1122 Variables that you can set in inputrc that change the behaviour
1123 of guestfish in useful ways include:
1127 =item completion-ignore-case (default: on)
1129 By default, guestfish will ignore case when tab-completing
1130 paths on the disk. Use:
1132 set completion-ignore-case off
1134 to make guestfish case sensitive.
1140 =item test2.img (etc)
1142 When using the C<-N> or C<--new> option, the prepared disk or
1143 filesystem will be created in the file C<test1.img> in the current
1144 directory. The second use of C<-N> will use C<test2.img> and so on.
1145 Any existing file with the same name will be overwritten.
1152 L<http://libguestfs.org/>,
1155 L<virt-copy-out(1)>,
1158 L<virt-filesystems(1)>,
1159 L<virt-inspector(1)>,
1160 L<virt-list-filesystems(1)>,
1161 L<virt-list-partitions(1)>,
1174 Richard W.M. Jones (C<rjones at redhat dot com>)
1178 Copyright (C) 2009-2011 Red Hat Inc.
1179 L<http://libguestfs.org/>
1181 This program is free software; you can redistribute it and/or modify
1182 it under the terms of the GNU General Public License as published by
1183 the Free Software Foundation; either version 2 of the License, or
1184 (at your option) any later version.
1186 This program is distributed in the hope that it will be useful,
1187 but WITHOUT ANY WARRANTY; without even the implied warranty of
1188 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1189 GNU General Public License for more details.
1191 You should have received a copy of the GNU General Public License
1192 along with this program; if not, write to the Free Software
1193 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.