Provided by: libguestfs-tools_1.24.5-1ubuntu0.1_amd64
名前
virt-cat - 仮想マシンにあるファイルの表示
書式
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
説明
"virt-cat" は "file" の内容を表示するためにコマンドラインツールです。ここで "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 '/'). "virt-cat" can be used to quickly view a file. To edit a file, use "virt-edit". For more complex cases you should look at the guestfish(1) tool (see "USING GUESTFISH" below).
例
"mydomain" という名前の libvirt 仮想マシンの中にある "/etc/fstab" を表示します: virt-cat -d mydomain /etc/fstab 仮想マシンのディスクイメージファイルから syslog メッセージを一覧表示するには: virt-cat -a disk.img /var/log/messages | tail 仮想マシンが取得している DHCP IP アドレスを発見するには: virt-cat -d mydomain /var/log/messages | \ grep 'dhclient: bound to' | tail どのパッケージが最新インストールされたかを見つけるには: 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
オプション
--help 簡単なヘルプを表示します。 -a file --add file Add 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 -a options. ディスクイメージの形式は自動検知されます。 これを上書きして強制的に特定の形式を使用す る場合、 --format=.. オプションを使用します。 -a URI --add URI リモートディスクを追加します。 "リモートストレージの追加" in guestfish(1) 参照。 -c URI --connect URI libvirt を使用していると、指定された URI に接続します。 省略すると、デフォルトの libvirt ハイパーバイザーに接続します。 ゲストのブロックデバイスを直接指定していると((-a))、libvirt は何も使用されません。 -d guest --domain guest 名前付きの libvirt 仮想マシンからすべてのディスクを追加します。 名前の代わりに仮想マ シンの UUID を使用できます。 --echo-keys キーやパスフレーズを入力するとき、通常 virt-cat はエコーを無効化します。 そのため、入 力内容を確認できません。 テンペスト攻撃の心配がなく、 部屋に誰も居なければ、 入力内容 を確認するためにこのフラグを指定できます。 --format=raw|qcow2|.. --format -a オプションは標準状態でディスクイメージの形式を自動検知します。 これを使用することに より、コマンドラインで後続の -a オプションのディスク形式を強制的に指定できます。 引数 なしで --format を使用することにより、 後続の -a オプションに対して自動検知に戻せま す。 例: virt-cat --format=raw -a disk.img file 強制的に "disk.img" を raw 形式にします (自動検出しません)。 virt-cat --format=raw -a disk.img --format -a another.img file 強制的に "disk.img" を raw 形式にし (自動検知なし)、 "another.img" に対して自動検知に 戻します。 仮想マシンのディスクイメージが信頼できない raw 形式である場合、 ディスク形式を指定する ためにこのオプションを使用すべきです。 これにより、悪意のある仮想マシンにより起こり得 る セキュリティ問題を回避できます (CVE-2010-3851)。 --keys-from-stdin 標準入力からキーまたはパスフレーズのパラメーターを読み込みます。 標準で "/dev/tty" を 開いているユーザーから読み込もうとします。 -v --verbose デバッグ用の冗長なメッセージを有効にします。 -V --version バージョン番号を表示して終了します。 -x libguestfs API 呼び出しのトレースを有効にします。
旧形式のコマンドライン引数
以前のバージョンの virt-cat はどちらの書き込みもできます: virt-cat disk.img [disk.img ...] file または virt-cat guestname file whereas in this version you should use -a or -d respectively to avoid the confusing case where a disk image might have the same name as a guest. 互換性のため古い形式がまだサポートされています。
Windows のパス
"virt-cat" は Windows のドライブレターとパスの解釈能力に制限があります(例: "E:\foo\bar.txt")。 仮想マシンが Windows を実行している場合に限り: • Drive letter prefixes like "C:" are resolved against the Windows Registry to the correct filesystem. • Any backslash ("\") characters in the path are replaced with forward slashes so that libguestfs can process it. • The path is resolved case insensitively to locate the file that should be displayed. There are some known shortcomings: • Some NTFS symbolic links may not be followed correctly. • NTFS junction points that cross filesystems are not followed.
guestfish の使用法
guestfish(1) は "virt-cat" がうまく機能しないときに使用できる、より強力な、より低レベルな ツールです。 "virt-cat" を使用することは、次のこととほぼ同等です: guestfish --ro -i -d domname download file - ここで "domname" は libvirt 仮想マシンの名前です。また、"file" はファイルの完全パスで す。最後の "-" ("標準出力に出力" を意味します) に注意してください。 上のコマンドは libguestfs の仮想マシン検査機能を使用します。そのため、libguestfs が検査で きない仮想マシンにおいて、または仮想マシンを含んでいない任意のディスクイメージのようなもの において、うまく動作しません。ディスクイメージから直接ファイルを表示するには、次を使用しま す: guestfish --ro -a disk.img -m /dev/sda1 download file - ここで、"disk.img" はディスクイメージ、"/dev/sda1" はディスクイメージにあるファイルシステ ム、そして "file" はファイルの完全パスです。
SHELL QUOTING
Libvirt guest names can contain arbitrary characters, some of which have meaning to the shell such as "#" and space. You may need to quote or escape these characters on the command line. See the shell manual page sh(1) for details.
終了ステータス
このプログラムは、成功すると 0 を、エラーがあると 0 以外を返します。
関連項目
guestfs(3), guestfish(1), virt-copy-out(1), virt-edit(1), virt-tar-out(1), http://libguestfs.org/.
著者
Richard W.M. Jones http://people.redhat.com/~rjones/
COPYRIGHT
Copyright (C) 2010-2012 Red Hat Inc.
LICENSE
BUGS
To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools When reporting a bug, please supply: • The version of libguestfs. • Where you got libguestfs (eg. which Linux distro, compiled from source, etc) • Describe the bug accurately and give a way to reproduce it. • Run libguestfs-test-tool(1) and paste the complete, unedited output into the bug report.