man pages: Add a standard EXIT STATUS section to most pages.
[libguestfs.git] / fuse / guestmount.pod
index fe19a07..fef84d9 100644 (file)
@@ -8,6 +8,10 @@ guestmount - Mount a guest filesystem on the host using FUSE and libguestfs
 
  guestmount [--options] -a disk.img -m device [--ro] mountpoint
 
+ guestmount [--options] -a disk.img -i [--ro] mountpoint
+
+ guestmount [--options] -d Guest -i [--ro] mountpoint
+
 =head1 WARNING
 
 You must I<not> use C<guestmount> in read-write mode on live virtual
@@ -21,10 +25,10 @@ access to the guest filesystem, and FUSE (the "filesystem in
 userspace") to make it appear as a mountable device.
 
 Along with other options, you have to give at least one device (I<-a>
-option) and at least one mountpoint (I<-m> option).  How this works is
-better explained in the L<guestfish(1)> manual page, or you can use
-L<virt-inspector(1)> and/or the wrapper script
-C<guestmount-wrapper> to help you.
+option) or libvirt domain (I<-d> option), and at least one mountpoint
+(I<-m> option) or use the I<-i> inspection option.  How this works is
+better explained in the L<guestfish(1)> manual page, or by looking at
+the examples below.
 
 FUSE lets you mount filesystems as non-root.  The mountpoint must be
 owned by you, and the filesystem will not be visible to any other
@@ -44,40 +48,69 @@ partition, and the root filesystem on a logical volume:
 
  guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt
 
-To get L<virt-inspector(1)> to do the hard work of detecting guest
-mountpoints for you:
+To get libguestfs to detect guest mountpoints for you:
 
- guestmount $(virt-inspector --ro-fish MyGuest) /mnt
+ guestmount -a guest.img -i --ro /mnt
 
-(or use --fish if you don't want it to be a read only mount).  The
-option is called I<--ro-fish> or I<--fish> because these parameters
-are compatible with L<guestfish(1)>.
+For a libvirt guest called "Guest" you could do:
+
+ guestmount -d Guest -i --ro /mnt
 
 If you don't know what filesystems are contained in a guest or
-disk image, use L<virt-list-filesystems(1)> first:
+disk image, use L<virt-filesystems(1)> first:
 
- virt-list-filesystems MyGuest
+ virt-filesystems MyGuest
 
 If you want to trace the libguestfs calls but without excessive
-debugging, we recommend:
+debugging information, we recommend:
 
- guestmount [-a ... -m ...] --trace /mnt
+ guestmount [...] --trace /mnt
 
 If you want to debug the program, we recommend:
 
- guestmount [-a ... -m ...] --trace --verbose /mnt
+ guestmount [...] --trace --verbose /mnt
+
+=head1 NOTES
+
+=head2 Other users cannot see the filesystem by default
+
+If you mount a filesystem as one user (eg. root), then other users
+will not be able to see it by default.  The fix is to add the FUSE
+C<allow_other> option when mounting:
+
+ sudo guestmount [...] -o allow_other /mnt
 
 =head1 OPTIONS
 
 =over 4
 
-=item B<-a image> | B<--add image>
+=item B<-a image>
+
+=item B<--add image>
 
 Add a block device or virtual machine image.
 
 The format of the disk image is auto-detected.  To override this and
 force a particular format use the I<--format=..> option.
 
+=item B<-c URI>
+
+=item B<--connect URI>
+
+When used in conjunction with the I<-d> option, this specifies
+the libvirt URI to use.  The default is to use the default libvirt
+connection.
+
+=item B<-d libvirt-domain>
+
+=item B<--domain libvirt-domain>
+
+Add disks from the named libvirt domain.  If the I<--ro> option is
+also used, then any libvirt domain can be used.  However in write
+mode, only libvirt domains which are shut down can be named here.
+
+Domain UUIDs can be used instead of names.
+
 =item B<--dir-cache-timeout N>
 
 Set the readdir cache timeout to I<N> seconds, the default being 60
@@ -90,7 +123,16 @@ There is also a different attribute cache implemented by FUSE
 (see the FUSE option I<-o attr_timeout>), but the FUSE cache
 does not anticipate future requests, only cache existing ones.
 
-=item B<--format=raw|qcow2|..> | B<--format>
+=item B<--echo-keys>
+
+When prompting for keys and passphrases, guestfish normally turns
+echoing off so you cannot see what you are typing.  If you are not
+worried about Tempest attacks and there is no one else in the room
+you can specify this flag to see what you are typing.
+
+=item B<--format=raw|qcow2|..>
+
+=item B<--format>
 
 The default for the I<-a> option is to auto-detect the format of the
 disk image.  Using this forces the disk format for I<-a> options which
@@ -100,7 +142,7 @@ switches back to auto-detection for subsequent I<-a> options.
 If you have untrusted raw-format guest disk images, you should use
 this option to specify the disk format.  This avoids a possible
 security problem with malicious guests (CVE-2010-3851).  See also
-L</add-drive-opts>.
+L<guestfs(3)/guestfs_add_drive_opts>.
 
 =item B<--fuse-help>
 
@@ -110,7 +152,27 @@ Display help on special FUSE options (see I<-o> below).
 
 Display brief help and exit.
 
-=item B<-m dev[:mnt]> | B<--mount dev[:mnt]>
+=item B<-i>
+
+=item B<--inspector>
+
+Using L<virt-inspector(1)> code, inspect the disks looking for
+an operating system and mount filesystems as they would be
+mounted on the real virtual machine.
+
+=item B<--keys-from-stdin>
+
+Read key or passphrase parameters from stdin.  The default is
+to try to read passphrases from the user by opening C</dev/tty>.
+
+=item B<--live>
+
+Connect to a live virtual machine.
+(Experimental, see L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>).
+
+=item B<-m dev[:mountpoint[:options]]>
+
+=item B<--mount dev[:mountpoint[:options]]>
 
 Mount the named partition or logical volume on the given mountpoint
 B<in the guest> (this has nothing to do with mountpoints in the host).
@@ -118,14 +180,28 @@ B<in the guest> (this has nothing to do with mountpoints in the host).
 If the mountpoint is omitted, it defaults to C</>.  You have to mount
 something on C</>.
 
-=item B<-n> | B<--no-sync>
+The third (and rarely used) part of the mount parameter is the list of
+mount options used to mount the underlying filesystem.  If this is not
+given, then the mount options are either the empty string or C<ro>
+(the latter if the I<--ro> flag is used).  By specifying the mount
+options, you override this default choice.  Probably the only time you
+would use this is to enable ACLs and/or extended attributes if the
+filesystem can support them:
+
+ -m /dev/sda1:/:acl,user_xattr
+
+=item B<-n>
+
+=item B<--no-sync>
 
 By default, we attempt to sync the guest disk when the FUSE mountpoint
 is unmounted.  If you specify this option, then we don't attempt to
 sync the disk.  See the discussion of autosync in the L<guestfs(3)>
 manpage.
 
-=item B<-o option> | B<--option option>
+=item B<-o option>
+
+=item B<--option option>
 
 Pass extra options to FUSE.
 
@@ -160,7 +236,9 @@ to the chosen values.
 
 =back
 
-=item B<-r> | B<--ro>
+=item B<-r>
+
+=item B<--ro>
 
 Add devices and mount everything read-only.  Also disallow writes and
 make the disk appear read-only to FUSE.
@@ -170,26 +248,63 @@ disk.  If the guest is running and this option is I<not> supplied,
 then there is a strong risk of disk corruption in the guest.  We try
 to prevent this from happening, but it is not always possible.
 
+See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>.
+
 =item B<--selinux>
 
 Enable SELinux support for the guest.
 
+=item B<-v>
+
+=item B<--verbose>
+
+Enable verbose messages from underlying libguestfs.
+
+=item B<-V>
+
+=item B<--version>
+
+Display the program version and exit.
+
+=item B<-w>
+
+=item B<--rw>
+
+This changes the I<-a>, I<-d> and I<-m> options so that disks are
+added and mounts are done read-write.
+
+See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>.
+
+=item B<-x>
+
 =item B<--trace>
 
-Trace libguestfs calls (to stderr).
+Trace libguestfs calls and entry into each FUSE function.
 
 This also stops the daemon from forking into the background.
 
-=item B<-v> | B<--verbose>
+=back
 
-Enable verbose messages from underlying libguestfs.
+=head1 FILES
 
-=item B<-V> | B<--version>
+=over 4
 
-Display the program version and exit.
+=item $HOME/.libguestfs-tools.rc
+
+=item /etc/libguestfs-tools.conf
+
+This configuration file controls the default read-only or read-write
+mode (I<--ro> or I<--rw>).
+
+See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>.
 
 =back
 
+=head1 EXIT STATUS
+
+This program returns 0 if successful, or non-zero if there was an
+error.
+
 =head1 SEE ALSO
 
 L<guestfish(1)>,
@@ -207,7 +322,7 @@ Richard W.M. Jones (C<rjones at redhat dot com>)
 
 =head1 COPYRIGHT
 
-Copyright (C) 2009 Red Hat Inc.
+Copyright (C) 2009-2010 Red Hat Inc.
 L<http://libguestfs.org/>
 
 This program is free software; you can redistribute it and/or modify