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
|
=head1 名前
virt-cat - 仮想マシンにあるファイルの表示
=head1 書式
virt-cat [--options] -d domname file [file ...]
virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]
古い形式:
virt-cat domname file
virt-cat disk.img file
=head1 説明
C<virt-cat> は C<file> の内容を表示するためにコマンドラインツールです。ここで C<file> は仮想マシン (またはディスクイメージ) の中に存在します。
Multiple filenames can be given, in which case they are concatenated together. Each filename must be a full path, starting at the root directory (starting with '/').
C<virt-cat> can be used to quickly view a file. To edit a file, use C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> tool (see L</USING GUESTFISH> below).
=head1 例
Display F</etc/fstab> file from inside the libvirt VM called C<mydomain>:
virt-cat -d mydomain /etc/fstab
どのパッケージが最新インストールされたかを見つけるには:
virt-cat -d mydomain /var/log/yum.log | tail
どのユーザーが仮想マシンにログインしているかを見つけるには:
virt-cat -d mydomain /var/run/utmp > /tmp/utmp
who /tmp/utmp
または、だれがログオンしたかを見つけるには:
virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp
last -f /tmp/wtmp
=head1 オプション
=over 4
=item B<--help>
簡単なヘルプを表示します。
=item B<-a> file
=item B<--add> file
Add I<file> which should be a disk image from a virtual machine. If the virtual machine has multiple block devices, you must supply all of them with separate I<-a> options.
ディスクイメージの形式は自動検知されます。 これを上書きして強制的に特定の形式を使用する場合、 I<--format=..> オプションを使用します。
=item B<-a URI>
=item B<--add URI>
リモートディスクを追加します。 L<guestfish(1)/リモートストレージの追加> 参照。
__INCLUDE:blocksize-option.pod__
=item B<-c> URI
=item B<--connect> URI
libvirt を使用していると、指定された I<URI> に接続します。 省略すると、デフォルトの libvirt ハイパーバイザーに接続します。
ゲストのブロックデバイスを直接指定していると((I<-a>))、libvirt は何も使用されません。
=item B<-d> guest
=item B<--domain> guest
名前付きの libvirt 仮想マシンからすべてのディスクを追加します。 名前の代わりに仮想マシンの UUID を使用できます。
=item B<--echo-keys>
キーやパスフレーズを入力するとき、通常 virt-cat はエコーを無効化します。 そのため、入力内容を確認できません。 テンペスト攻撃の心配がなく、 部屋に誰も居なければ、 入力内容を確認するためにこのフラグを指定できます。
=item B<--format=raw|qcow2|..>
=item B<--format>
I<-a> オプションは標準状態でディスクイメージの形式を自動検知します。 これを使用することにより、コマンドラインで後続の I<-a> オプションのディスク形式を強制的に指定できます。 引数なしで I<--format> を使用することにより、 後続の I<-a> オプションに対して自動検知に戻せます。
例:
virt-cat --format=raw -a disk.img file
forces raw format (no auto-detection) for F<disk.img>.
virt-cat --format=raw -a disk.img --format -a another.img file
forces raw format (no auto-detection) for F<disk.img> and reverts to auto-detection for F<another.img>.
仮想マシンのディスクイメージが信頼できない raw 形式である場合、 ディスク形式を指定するためにこのオプションを使用すべきです。 これにより、悪意のある仮想マシンにより起こり得る セキュリティ問題を回避できます (CVE-2010-3851)。
__INCLUDE:key-option.pod__
__INCLUDE:keys-from-stdin-option.pod__
=item B<-m> dev[:mountpoint[:options[:fstype]]]
=item B<--mount> dev[:mountpoint[:options[:fstype]]]
指定されたマウントポイントにある、 名前付きパーティションまたは論理ボリュームをマウントします。
If the mountpoint is omitted, it defaults to F</>.
Specifying any mountpoint disables the inspection of the guest and the mount of its root and all of its mountpoints, so make sure to mount all the mountpoints needed to work with the filenames given as arguments.
If you don’t know what filesystems a disk image contains, you can either run guestfish without this option, then list the partitions, filesystems and LVs available (see L</list-partitions>, L</list-filesystems> and L</lvs> commands), or you can use the L<virt-filesystems(1)> program.
マウントパラメーターの三番目の (ほとんど使用されない) 項目は、 バックエンドのファイルシステムをマウントするために使用される マウントオプションの一覧です。 これが指定されていない場合、 マウントオプションは空文字列または C<ro> (I<--ro> フラグが使用されている場合) になります。
-m /dev/sda1:/:acl,user_xattr
このフラグを使用することは、 C<mount-options> コマンドを使用することと同等です。
パラメーターの四番目の項目は使用するファイルシステムドライバー (C<ext3> や C<ntfs> など) です。 これはほとんど必要ありません。 しかし、複数のドライバーがファイルシステムに対して有効である場合 (例: C<ext2> と C<ext3>)、 または libguestfs がファイルシステムを誤検知している場合、 これは有用です。
=item B<-v>
=item B<--verbose>
デバッグ用の冗長なメッセージを有効にします。
=item B<-V>
=item B<--version>
バージョン番号を表示して、終了します。
=item B<-x>
libguestfs API 呼び出しのトレースを有効にします。
=back
=head1 旧形式のコマンドライン引数
以前のバージョンの virt-cat はどちらの書き込みもできます:
virt-cat disk.img [disk.img ...] file
または
virt-cat guestname file
whereas in this version you should use I<-a> or I<-d> respectively to avoid the confusing case where a disk image might have the same name as a guest.
互換性のため古い形式がまだサポートされています。
=head1 LOG FILES
To list out the log files from guests, see the related tool L<virt-log(1)>. It understands binary log formats such as the systemd journal.
To follow (tail) text log files, use L<virt-tail(1)>.
=head1 Windows のパス
C<virt-cat> has a limited ability to understand Windows drive letters and paths (eg. F<E:\foo\bar.txt>).
仮想マシンが Windows を実行している場合に限り:
=over 4
=item *
Drive letter prefixes like C<C:> are resolved against the Windows Registry to the correct filesystem.
=item *
Any backslash (C<\>) characters in the path are replaced with forward slashes so that libguestfs can process it.
=item *
The path is resolved case insensitively to locate the file that should be displayed.
=back
There are some known shortcomings:
=over 4
=item *
Some NTFS symbolic links may not be followed correctly.
=item *
NTFS junction points that cross filesystems are not followed.
=back
=head1 guestfish の使用法
L<guestfish(1)> は C<virt-cat> がうまく機能しないときに使用できる、より強力な、より低レベルなツールです。
C<virt-cat> を使用することは、次のこととほぼ同等です:
guestfish --ro -i -d domname download file -
ここで C<domname> は libvirt 仮想マシンの名前です。また、C<file> はファイルの完全パスです。最後の C<-> ("標準出力に出力" を意味します) に注意してください。
The command above uses libguestfs’s guest inspection feature and so does not work on guests that libguestfs cannot inspect, or on things like arbitrary disk images that don't contain guests. To display a file from a disk image directly, use:
guestfish --ro -a disk.img -m /dev/sda1 download file -
where F<disk.img> is the disk image, F</dev/sda1> is the filesystem within the disk image, and C<file> is the full path to the file.
=head1 終了ステータス
このプログラムは、成功すると 0 を、エラーがあると 0 以外を返します。
=head1 関連項目
L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, L<virt-log(1)>, L<virt-tail(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>.
=head1 著者
Richard W.M. Jones L<http://people.redhat.com/~rjones/>
=head1 COPYRIGHT
Copyright (C) 2010-2023 Red Hat Inc.
|