File: guestmount.pod

package info (click to toggle)
libguestfs 1%3A1.18.1-1%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,156 kB
  • sloc: ansic: 282,408; ml: 22,707; sh: 16,121; perl: 5,946; java: 5,047; cs: 4,329; makefile: 3,191; haskell: 2,564; erlang: 1,510; python: 1,502; xml: 509; ruby: 217; pascal: 142; cpp: 11
file content (337 lines) | stat: -rw-r--r-- 10,133 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
=encoding utf8

=head1 名前

guestmount - Mount a guest filesystem on the host using FUSE and libguestfs

=head1 書式

 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 警告

You must I<not> use C<guestmount> in read-write mode on live virtual
machines.  If you do this, you risk disk corruption in the VM.

=head1 説明

The guestmount program can be used to mount virtual machine filesystems and
other disk images on the host.  It uses libguestfs for 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) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m>
option) or use the I<-i> inspection option or the I<--live> 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 users unless you
make certain global configuration changes to C</etc/fuse.conf>.  To unmount
the filesystem, use the C<fusermount -u> command.

=head1 例

For a typical Windows guest which has its main filesystem on the first
partition:

 guestmount -a windows.img -m /dev/sda1 --ro /mnt

For a typical Linux guest which has a /boot filesystem on the first
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 libguestfs to detect guest mountpoints for you:

 guestmount -a guest.img -i --ro /mnt

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-filesystems(1)> first:

 virt-filesystems -d MyGuest

If you want to trace the libguestfs calls but without excessive debugging
information, we recommend:

 guestmount [...] --trace /mnt

If you want to debug the program, we recommend:

 guestmount [...] --trace --verbose /mnt

=head1 注記

=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

=head2 Enabling FUSE

On some distros, you may need to add yourself to a special group
(eg. C<fuse>) before you can use any FUSE filesystem.  This is necessary on
Debian and derivatives.

On other distros, no special group is required.  It is not necessary on
Fedora or Red Hat Enterprise Linux.

=head1 オプション

=over 4

=item B<-a image>

=item B<--add image>

ブロックデバイスまたは仮想マシンイメージを追加します。

ディスクイメージの形式は自動検知されます。これを上書きして強制的に特定の形式を使用するには、I<--format=..> オプションを使用します。

=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
seconds.  The readdir cache [actually, there are several semi-independent
caches] is populated after a readdir(2) call with the stat and extended
attributes of the files in the directory, in anticipation that they will be
requested soon after.

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<--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>

I<-a> オプションのデフォルトはディスクイメージの形式を自動検知します。これを使用することにより、I<-a>
オプションのディスク形式をコマンドラインにおいて指定したものに強制できます。引数なしで I<--format> を使用することにより、後続の I<-a>
オプションに対して自動検知に戻せます。

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<guestfs(3)/guestfs_add_drive_opts>.

=item B<--fuse-help>

Display help on special FUSE options (see I<-o> below).

=item B<--help>

簡単なヘルプを表示して終了します。

=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).

If the mountpoint is omitted, it defaults to C</>.  You have to mount
something on C</>.

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>

=item B<--option option>

追加オプションを FUSE に渡します。

To get a list of all the extra options supported by FUSE, use the command
below.  Note that only the FUSE I<-o> options can be passed, and only some
of them are a good idea.

 guestmount --fuse-help

Some potentially useful FUSE options:

=over 4

=item B<-o allow_other>

Allow other users to see the filesystem.

=item B<-o attr_timeout=N>

Enable attribute caching by FUSE, and set the timeout to I<N> seconds.

=item B<-o kernel_cache>

Allow the kernel to cache files (reduces the number of reads that have to go
through the L<guestfs(3)> API).  This is generally a good idea if you can
afford the extra memory usage.

=item B<-o uid=N> B<-o gid=N>

Use these options to map all UIDs and GIDs inside the guest filesystem to
the chosen values.

=back

=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.

This is highly recommended if you are not going to edit the guest 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.

L<guestfish(1)/OPENING DISKS FOR READ AND WRITE> 参照。

=item B<--selinux>

仮想マシンの SELinux サポートを有効にします。

=item B<-v>

=item B<--verbose>

libguestfs からの冗長なメッセージを有効にします。

=item B<-V>

=item B<--version>

プログラムのバージョンを表示して、終了します。

=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.

L<guestfish(1)/OPENING DISKS FOR READ AND WRITE> 参照。

=item B<-x>

=item B<--trace>

Trace libguestfs calls and entry into each FUSE function.

This also stops the daemon from forking into the background.

=back

=head1 ファイル

=over 4

=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>).

L<guestfish(1)/OPENING DISKS FOR READ AND WRITE> 参照。

=back

=head1 終了ステータス

このプログラムは、成功すると 0 を、エラーがあると 0 以外を返します。

=head1 関連項目

L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>,
L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>,
L<http://fuse.sf.net/>.

=head1 著者

Richard W.M. Jones (C<rjones at redhat dot com>)

=head1 COPYRIGHT

Copyright (C) 2009-2012 Red Hat Inc.  L<http://libguestfs.org/>

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.