1guestmount(1) Virtualization Support guestmount(1)
2
3
4
6 guestmount - Mount a guest filesystem on the host using FUSE and
7 libguestfs
8
10 guestmount [--options] -a disk.img -m device [--ro] mountpoint
11
12 guestmount [--options] -a disk.img -i [--ro] mountpoint
13
14 guestmount [--options] -d Guest -i [--ro] mountpoint
15
17 You must not use "guestmount" in read-write mode on live virtual
18 machines. If you do this, you risk disk corruption in the VM.
19
21 The guestmount program can be used to mount virtual machine filesystems
22 and other disk images on the host. It uses libguestfs for access to
23 the guest filesystem, and FUSE (the "filesystem in userspace") to make
24 it appear as a mountable device.
25
26 Along with other options, you have to give at least one device (-a
27 option) or libvirt domain (-d option), and at least one mountpoint (-m
28 option) or use the -i inspection option. How this works is better
29 explained in the guestfish(1) manual page, or by looking at the
30 examples below.
31
32 FUSE lets you mount filesystems as non-root. The mountpoint must be
33 owned by you, and the filesystem will not be visible to any other users
34 unless you make certain global configuration changes to
35 "/etc/fuse.conf". To unmount the filesystem, use the "fusermount -u"
36 command.
37
39 For a typical Windows guest which has its main filesystem on the first
40 partition:
41
42 guestmount -a windows.img -m /dev/sda1 --ro /mnt
43
44 For a typical Linux guest which has a /boot filesystem on the first
45 partition, and the root filesystem on a logical volume:
46
47 guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt
48
49 To get libguestfs to detect guest mountpoints for you:
50
51 guestmount -a guest.img -i --ro /mnt
52
53 For a libvirt guest called "Guest" you could do:
54
55 guestmount -d Guest -i --ro /mnt
56
57 If you don't know what filesystems are contained in a guest or disk
58 image, use virt-filesystems(1) first:
59
60 virt-filesystems MyGuest
61
62 If you want to trace the libguestfs calls but without excessive
63 debugging information, we recommend:
64
65 guestmount [...] --trace /mnt
66
67 If you want to debug the program, we recommend:
68
69 guestmount [...] --trace --verbose /mnt
70
72 -a image | --add image
73 Add a block device or virtual machine image.
74
75 The format of the disk image is auto-detected. To override this
76 and force a particular format use the --format=.. option.
77
78 -c URI | --connect URI
79 When used in conjunction with the -d option, this specifies the
80 libvirt URI to use. The default is to use the default libvirt
81 connection.
82
83 -d libvirt-domain | --domain libvirt-domain
84 Add disks from the named libvirt domain. If the --ro option is
85 also used, then any libvirt domain can be used. However in write
86 mode, only libvirt domains which are shut down can be named here.
87
88 --dir-cache-timeout N
89 Set the readdir cache timeout to N seconds, the default being 60
90 seconds. The readdir cache [actually, there are several semi-
91 independent caches] is populated after a readdir(2) call with the
92 stat and extended attributes of the files in the directory, in
93 anticipation that they will be requested soon after.
94
95 There is also a different attribute cache implemented by FUSE (see
96 the FUSE option -o attr_timeout), but the FUSE cache does not
97 anticipate future requests, only cache existing ones.
98
99 --echo-keys
100 When prompting for keys and passphrases, guestfish normally turns
101 echoing off so you cannot see what you are typing. If you are not
102 worried about Tempest attacks and there is no one else in the room
103 you can specify this flag to see what you are typing.
104
105 --format=raw|qcow2|.. | --format
106 The default for the -a option is to auto-detect the format of the
107 disk image. Using this forces the disk format for -a options which
108 follow on the command line. Using --format with no argument
109 switches back to auto-detection for subsequent -a options.
110
111 If you have untrusted raw-format guest disk images, you should use
112 this option to specify the disk format. This avoids a possible
113 security problem with malicious guests (CVE-2010-3851). See also
114 "guestfs_add_drive_opts" in guestfs(3).
115
116 --fuse-help
117 Display help on special FUSE options (see -o below).
118
119 --help
120 Display brief help and exit.
121
122 -i | --inspector
123 Using virt-inspector(1) code, inspect the disks looking for an
124 operating system and mount filesystems as they would be mounted on
125 the real virtual machine.
126
127 --keys-from-stdin
128 Read key or passphrase parameters from stdin. The default is to
129 try to read passphrases from the user by opening "/dev/tty".
130
131 -m dev[:mnt] | --mount dev[:mnt]
132 Mount the named partition or logical volume on the given mountpoint
133 in the guest (this has nothing to do with mountpoints in the host).
134
135 If the mountpoint is omitted, it defaults to "/". You have to
136 mount something on "/".
137
138 -n | --no-sync
139 By default, we attempt to sync the guest disk when the FUSE
140 mountpoint is unmounted. If you specify this option, then we don't
141 attempt to sync the disk. See the discussion of autosync in the
142 guestfs(3) manpage.
143
144 -o option | --option option
145 Pass extra options to FUSE.
146
147 To get a list of all the extra options supported by FUSE, use the
148 command below. Note that only the FUSE -o options can be passed,
149 and only some of them are a good idea.
150
151 guestmount --fuse-help
152
153 Some potentially useful FUSE options:
154
155 -o allow_other
156 Allow other users to see the filesystem.
157
158 -o attr_timeout=N
159 Enable attribute caching by FUSE, and set the timeout to N
160 seconds.
161
162 -o kernel_cache
163 Allow the kernel to cache files (reduces the number of reads
164 that have to go through the guestfs(3) API). This is generally
165 a good idea if you can afford the extra memory usage.
166
167 -o uid=N -o gid=N
168 Use these options to map all UIDs and GIDs inside the guest
169 filesystem to the chosen values.
170
171 -r | --ro
172 Add devices and mount everything read-only. Also disallow writes
173 and make the disk appear read-only to FUSE.
174
175 This is highly recommended if you are not going to edit the guest
176 disk. If the guest is running and this option is not supplied,
177 then there is a strong risk of disk corruption in the guest. We
178 try to prevent this from happening, but it is not always possible.
179
180 See also "OPENING DISKS FOR READ AND WRITE" in guestfish(1).
181
182 --selinux
183 Enable SELinux support for the guest.
184
185 -v | --verbose
186 Enable verbose messages from underlying libguestfs.
187
188 -V | --version
189 Display the program version and exit.
190
191 -w | --rw
192 This option does nothing at the moment. See "OPENING DISKS FOR
193 READ AND WRITE" in guestfish(1).
194
195 -x | --trace
196 Trace libguestfs calls and entry into each FUSE function.
197
198 This also stops the daemon from forking into the background.
199
201 guestfish(1), virt-inspector(1), virt-cat(1), virt-edit(1),
202 virt-tar(1), guestfs(3), <http://libguestfs.org/>,
203 <http://fuse.sf.net/>.
204
206 Richard W.M. Jones ("rjones at redhat dot com")
207
209 Copyright (C) 2009-2010 Red Hat Inc. <http://libguestfs.org/>
210
211 This program is free software; you can redistribute it and/or modify it
212 under the terms of the GNU General Public License as published by the
213 Free Software Foundation; either version 2 of the License, or (at your
214 option) any later version.
215
216 This program is distributed in the hope that it will be useful, but
217 WITHOUT ANY WARRANTY; without even the implied warranty of
218 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
219 General Public License for more details.
220
221 You should have received a copy of the GNU General Public License along
222 with this program; if not, write to the Free Software Foundation, Inc.,
223 675 Mass Ave, Cambridge, MA 02139, USA.
224
225
226
227libguestfs-1.8.15 2011-11-10 guestmount(1)