Provided by: libguestfs-tools_1.32.2-4ubuntu2.2_amd64 bug

名前

       virt-rescue - 仮想マシンにおいてレスキューシェルを実行します

書式

        virt-rescue [--options] -d domname

        virt-rescue [--options] -a disk.img [-a disk.img ...]

        virt-rescue --suggest (-d domname | -a disk.img ...)

       古い形式:

        virt-rescue [--options] domname

        virt-rescue [--options] disk.img [disk.img ...]

説明

       virt-rescue is like a Rescue CD, but for virtual machines, and without the need for a CD.
       virt-rescue gives you a rescue shell and some simple recovery tools which you can use to
       examine or rescue a virtual machine or disk image.

       You can run virt-rescue on any virtual machine known to libvirt, or directly on disk
       image(s):

        virt-rescue -d GuestName

        virt-rescue --ro -a /path/to/disk.img

        virt-rescue -a /dev/sdc

       動作中の仮想マシンには --ro オプションを使用 しなければいけません 。

       When you run virt-rescue on a virtual machine or disk image, you are placed in an
       interactive bash shell where you can use many ordinary Linux commands.  What you see in /
       (/bin, /lib etc) is the rescue appliance.  You must mount the virtual machine's
       filesystems by hand.  There is an empty directory called /sysroot where you can mount
       filesystems.

       You can get virt-rescue to suggest mount commands for you by using the --suggest option
       (in another terminal):

        $ virt-rescue --suggest -d Fedora15
       仮想マシンまたはディスクイメージの検査中 ...

        This disk contains one or more operating systems.  You can use these
        mount commands in virt-rescue (at the ><rescue> prompt) to mount the
        filesystems.

        # /dev/vg_f15x32/lv_root は linux オペレーティングシステムのルートです
        # 種別: linux, ディストリビューション: fedora, バージョン: 15.0
        # Fedora release 15 (Lovelock)

        mount /dev/vg_f15x32/lv_root /sysroot/
        mount /dev/vda1 /sysroot/boot
        mount --bind /dev /sysroot/dev
        mount --bind /dev/pts /sysroot/dev/pts
        mount --bind /proc /sysroot/proc
        mount --bind /sys /sysroot/sys

       Another way is to list the logical volumes (with lvs(8)) and partitions (with parted(8))
       and mount them by hand:

        ><rescue> lvs
        LV      VG        Attr   LSize   Origin Snap%  Move Log Copy%  Convert
        lv_root vg_f15x32 -wi-a-   8.83G
        lv_swap vg_f15x32 -wi-a- 992.00M
        ><rescue> mount /dev/vg_f15x32/lv_root /sysroot
        ><rescue> mount /dev/vda1 /sysroot/boot
        ><rescue> ls /sysroot

       利用可能なファイルシステムを一覧表示するためのもう 1 つのコマンドは virt-filesystems(1) で
       す。

       Linux 仮想マシンにおいてコマンド(たとえば、grub)を実行するには、まず /sysroot ディレクト
       リーの中に chroot する必要があります:

        ><rescue> chroot /sysroot

   注記
       Virt-rescue can be used on any disk image file or device, not just a virtual machine.  For
       example you can use it on a blank file if you want to partition that file (although we
       would recommend using guestfish(1) instead as it is more suitable for this purpose).  You
       can even use virt-rescue on things like SD cards.

       You can get virt-rescue to give you scratch disk(s) to play with.  This is useful for
       testing out Linux utilities (see --scratch).

       Virt-rescue does not require root.  You only need to run it as root if you need root to
       open the disk image.

       This tool is just designed for quick interactive hacking on a virtual machine.  For more
       structured access to a virtual machine disk image, you should use guestfs(3).  To get a
       structured shell that you can use to make scripted changes to guests, use guestfish(1).

オプション

       --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) 参照。

       --append kernelopts
           レスキューカーネルに追加オプションを渡します。

       -c URI
       --connect URI
           libvirt を使用していると、指定された URI に接続します。  省略すると、デフォルトの
           libvirt ハイパーバイザーに接続します。

           ゲストのブロックデバイスを直接指定していると((-a))、libvirt は何も使用されません。

       -d guest
       --domain guest
           名前付きの libvirt 仮想マシンからすべてのディスクを追加します。  名前の代わりに仮想マ
           シンの UUID を使用できます。

       --format=raw|qcow2|..
       --format
           -a オプションは標準状態でディスクイメージの形式を自動検知します。 これを使用することに
           より、コマンドラインで後続の -a オプションのディスク形式を強制的に指定できます。 引数
           なしで --format を使用することにより、 後続の -a オプションに対して自動検知に戻せま
           す。

           例:

            virt-rescue --format=raw -a disk.img

           forces raw format (no auto-detection) for disk.img.

            virt-rescue --format=raw -a disk.img --format -a another.img

           forces raw format (no auto-detection) for disk.img and reverts to auto-detection for
           another.img.

           仮想マシンのディスクイメージが信頼できない raw 形式である場合、 ディスク形式を指定する
           ためにこのオプションを使用すべきです。 これにより、悪意のある仮想マシンにより起こり得
           る セキュリティ問題を回避できます (CVE-2010-3851)。

       -m MB
       --memsize MB
           Change the amount of memory allocated to the rescue system.  The default is set by
           libguestfs and is small but adequate for running system tools.  The occasional program
           might need more memory.  The parameter is specified in megabytes.

       --network
           仮想マシンにおいて QEMU のユーザーモードのネットワークを有効にします。 "NETWORK" 参
           照。

       -r
       --ro
           イメージを読み込み専用で開きます。

           ディスクイメージまたは仮想マシンが使用中の場合、 必ずこのオプションを使用する必要があ
           ります。 また、ディスクへの書き込みアクセスが不要な場合、 このオプションが一般的に推奨
           されます。

           "OPENING DISKS FOR READ AND WRITE" in guestfish(1) 参照。

       --scratch
       --scratch=N
           --scratch オプションにより、大きなスクラッチディスクをレスキュー・アプライアンスに追加
           できます。--scratch=N により、"N" 個のスクラッチディスクを追加できます。virt-rescue が
           終了するとき、スクラッチディスクは自動的に削除されます。

           -a, -d および --scratch オプションは混在できます。スクラッチディスクは、これらがコマン
           ドラインに現れる順番で、アプライアンスに追加されます。

       --selinux
           レスキューアプライアンスにおいて SELinux を有効にします。このオプションを使用する前に
           "SELINUX" in guestfs(3) を読むべきです。

       --smp N
           レスキューアプライアンスにおいて N ≥ 2 仮想 CPU を有効にします。

       --suggest
           Inspect the disk image and suggest what mount commands should be used to mount the
           disks.  You should use the --suggest option in a second terminal, then paste the
           commands into another virt-rescue.

           このオプションは --ro を意味します。仮想マシンが起動していたり、他の virt-rescue を実
           行しているときでも安全です。

       -v
       --verbose
           デバッグ用の冗長なメッセージを有効にします。

       -V
       --version
           バージョン番号を表示して、終了します。

       -w
       --rw
           This changes the -a and -d options so that disks are added and mounts are done read-
           write.

           "OPENING DISKS FOR READ AND WRITE" in guestfish(1) 参照。

       -x  libguestfs API 呼び出しのトレースを有効にします。

旧形式のコマンドライン引数

       Previous versions of virt-rescue allowed you to write either:

        virt-rescue disk.img [disk.img ...]

       または

        virt-rescue guestname

       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.

       互換性のため古い形式がまだサポートされています。

ネットワーク

       Adding the --network option enables QEMU user networking in the rescue appliance.  There
       are some differences between user networking and ordinary networking:

       ping does not work
           Because the ICMP ECHO_REQUEST protocol generally requires root in order to send the
           ping packets, and because virt-rescue must be able to run as non-root, QEMU user
           networking is not able to emulate the ping(8) command.  The ping command will appear
           to resolve addresses but will not be able to send or receive any packets.  This does
           not mean that the network is not working.

       cannot receive connections
           QEMU user networking cannot receive incoming connections.

       TCP 接続の作成法
           The virt-rescue appliance needs to be small and so does not include many network
           tools.  In particular there is no telnet(1) command.  You can make TCP connections
           from the shell using the magical /dev/tcp/<hostname>/<port> syntax:

            exec 3<>/dev/tcp/redhat.com/80
            echo "GET /" >&3
            cat <&3

           詳細は bash(1) 参照。

CAPTURING CORE DUMPS

       If you are testing a tool inside virt-rescue and the tool (not virt-rescue) segfaults, it
       can be tricky to capture the core dump outside virt-rescue for later analysis.  This
       section describes one way to do this.

       1.  Create a scratch disk for core dumps:

            truncate -s 4G /tmp/corefiles
            virt-format --partition=mbr --filesystem=ext2 -a /tmp/corefiles
            virt-filesystems -a /tmp/corefiles --all --long -h

       2.  When starting virt-rescue, attach the core files disk last:

            virt-rescue --rw [-a ...] -a /tmp/corefiles

           NB. If you use the --ro option, then virt-rescue will silently not write any core
           files to /tmp/corefiles.

       3.  Inside virt-rescue, mount the core files disk.  Note replace /dev/sdb1 with the last
           disk index.  For example if the core files disk is the last of four disks, you would
           use /dev/sdd1.

            ><rescue> mkdir /tmp/mnt
            ><rescue> mount /dev/sdb1 /tmp/mnt

       4.  Enable core dumps in the rescue kernel:

            ><rescue> echo '/tmp/mnt/core.%p' > /proc/sys/kernel/core_pattern
            ><rescue> ulimit -Hc unlimited
            ><rescue> ulimit -Sc unlimited

       5.  Run the tool that caused the core dump.  The core dump will be written to
           /tmp/mnt/core.PID.

            ><rescue> ls -l /tmp/mnt
            total 1628
            -rw------- 1 root root 1941504 Dec  7 13:13 core.130
            drwx------ 2 root root   16384 Dec  7 13:00 lost+found

       6.  Before exiting virt-rescue, unmount (or at least sync) the disks:

            ><rescue> umount /tmp/mnt
            ><rescue> exit

       7.  Outside virt-rescue, the core dump(s) can be removed from the disk using guestfish(1).
           For example:

            guestfish --ro -a /tmp/corefiles -m /dev/sda1
            ><fs> ll /
            ><fs> download /core.NNN /tmp/core.NNN

環境変数

       Several environment variables affect virt-rescue.  See "ENVIRONMENT VARIABLES" in
       guestfs(3) for the complete list.

ファイル

       $XDG_CONFIG_HOME/libguestfs/libguestfs-tools.conf
       $HOME/.libguestfs-tools.rc
       $XDG_CONFIG_DIRS/libguestfs/libguestfs-tools.conf
       /etc/libguestfs-tools.conf
           This configuration file controls the default read-only or read-write mode (--ro or
           --rw).

           See libguestfs-tools.conf(5).

関連項目

       guestfs(3), guestfish(1), virt-cat(1), virt-edit(1), virt-filesystems(1),
       libguestfs-tools.conf(5), http://libguestfs.org/.

著者

       Richard W.M. Jones http://people.redhat.com/~rjones/

COPYRIGHT

       Copyright (C) 2009-2016 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.