Show Table of Contents
22.5. その他のコマンド
このセクションでは、ゲスト仮想マシンのディスクイメージの表示や編集を行う際に使用する guestfish に類するシンプルなツールについて説明します。
virt-catは guestfish のdownloadコマンドに似ています。単一ファイルをダウンロードしてゲスト仮想マシンに表示します。たとえば、以下のようになります。#
virt-cat RHEL3 /etc/ntp.conf | grep ^serverserver 127.127.1.0 # local clockvirt-editは guestfish のeditコマンドに似ています。ゲスト仮想マシン内の単一ファイルをインタラクティブに編集するために使用できます。たとえば、起動しない Linux ベースのゲスト仮想マシンのgrub.confファイルを編集しなければならないとします。#
virt-edit LinuxGuest /boot/grub/grub.confvirt-editには、 単一ファイルに一方的に直接の変更を加えることができる別モードもあります。この非インタラクティブなモードで編集を行う場合は -e オプションを使用します。たとえば、このコマンドでは Linux ゲスト仮想マシンの root パスワードをパスワードなしに変更します。#
virt-edit LinuxGuest /etc/passwd -e 's/^root:.*?:/root::/'virt-lsは guestfish のls、ll、findの各コマンドに似ています。単一ディレクトリーまたは複数ディレクトリーを (再帰的に) 一覧表示するために使用されます。たとえば、以下のコマンドでは Linux ゲスト仮想マシンの /home の下にあるファイルとディレクトリーを再帰的に一覧表示します。#
virt-ls -R LinuxGuest /home/ | less

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.