other versions
- jessie 1:1.28.1-1
- jessie-backports 1:1.32.7-1~bpo8+1
- stretch 1:1.34.6-2
- testing 1:1.38.6-2+b1
- unstable 1:1.40.2-1
other languages
guestfs-testing(1) | Virtualization Support | guestfs-testing(1) |
名前¶
guestfs-testing - libguestfs の手動テスト、手助けになります!説明¶
This page has manual tests you can try on libguestfs. Everyone has a slightly different combination of platform, hardware and guests, so this testing is very valuable. Thanks for helping out! Tests marked with a * (asterisk) can destroy data if you're not careful. The others are safe and won't modify anything. Most of these tests will work with any libguestfs ≥ 1.14. Some of these tests (marked) require libguestfs ≥ 1.22. このリンクを使用して見つけたバグを報告できます: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools or post on the mailing list (registration is not required, but if you're not registered then you'll have to wait for a moderator to manually approve your message): https://www.redhat.com/mailman/listinfo/libguestfsテスト¶
libguestfs-test-tool の実行¶
次を実行します:libguestfs-test-toolこのコマンドは、基本的な libguestfs が機能しているか、非常に簡単かつ非破壊的なテストを実行します。root として実行する必要がありません。 If it doesn't print "===== TEST FINISHED OK =====", report it as a bug. It is very important that you include the complete, unedited output of "libguestfs-test-tool" in your bug report. See the "BUGS" section at the end of this page.
KVM アクセラレーションが使用されていることを確認します。¶
If your host has hardware virt acceleration, then with a hot cache libguestfs should be able to start up in a few seconds. Run the following command a few times:time guestfish -a /dev/null runAfter a few runs, the time should settle down to a few seconds (under 5 seconds on fast 64 bit hardware). ハードウェア仮想化を確認する方法: http://virt-tools.org/learning/check-hardware-virt/ 上のコマンドがまったく機能しなければ、 libguestfs-test-tool(1) を使用します。
Check which version of libguestfs, qemu, libvirt, etc is being used.¶
Look at the output of "libguestfs-test-tool" and check:- •
- Which version of libguestfs is being used? Near the beginning of the
output you'll see a line like:
library version: 1.22.0fedora=19,release=1.fc19,libvirt
- •
- Is libvirt being used? You can tell the difference by looking for the
backend:
guestfs_get_backend: direct
または:guestfs_get_backend: libvirt
- •
- Which version of qemu is being used? It may be printed out:
libguestfs: qemu version 1.5
but note that if you're using libvirt then libguestfs doesn't have this information.
- •
- Which kernel is being used? supermin(1) will try to pick the latest
kernel installed on your machine. You can see the version in the appliance
output, eg:
[ 0.000000] Linux version 3.9.2-200.fc18.x86_64 [...]
Try to open a local guest image with guestfish.¶
You can use any guest disk image for this test. Make sure you use the "--ro" flag so that guestfish(1) will open the disk image read-only.guestfish --ro -a /path/to/disk.img -iIf the command is successful, it should print out the guest operating system name and put you at the guestfish "><fs>" prompt. You can use guestfish commands like "ll /" to look inside the disk image. To exit, type "exit". If you get an error, try enabling debugging (add "-v" to the command line). Also make sure that libguestfs-test-tool(1) succeeds.
Try to open a remote guest image with guestfish.¶
Note this test requires libguestfs ≥ 1.22 and qemu ≥ 1.5. You may also have to disable libvirt by setting this:export LIBGUESTFS_BACKEND=directIf you have a disk image available over HTTP/FTP, try to open it.
guestfish --ro -i --format=raw -a http://www.example.com/disk.imgFor SSH you will need to make sure that ssh-agent is set up so you don't need a password to log in to the remote machine. Then a command similar to this should work:
guestfish --ro -i --format=raw \ -a ssh://remote.example.com/path/to/disk.imgIf you get an error, try enabling debugging (add "-v" to the command line). Also make sure that libguestfs-test-tool(1) succeeds.
すべての仮想マシンにおいて virt-alignment-scan を実行します。¶
仮想マシンまたはディスクイメージにおいて virt-alignment-scan(1) を実行します:virt-alignment-scan -a /path/to/disk.imgまたは:
virt-alignment-scan -d GuestDoes the alignment report match how the guest partitions are aligned?
仮想マシンにあるいくつかのファイルにおいて virt-cat を実行します。¶
virt-cat(1) は仮想マシンからファイルを表示できます。 Linux 仮想マシンに対しては、次を試します:virt-cat LinuxGuest /etc/passwd最近の機能は Windows のパスをサポートします、たとえば:
virt-cat WindowsGuest 'c:\windows\win.ini'An even better test is if you have a Windows guest with multiple drives. Do "D:", "E:" etc paths work correctly?
* Copy some files into a shut off guest.¶
virt-copy-in(1) は仮想マシンまたはディスクイメージの中にあるファイルおよびディレクトリーを再帰的にコピーできます。virt-copy-in -d Guest /etc /tmpThis should copy local directory "/etc" to "/tmp/etc" in the guest (recursively). If you boot the guest, can you see all of the copied files and directories? Shut the guest down and try copying multiple files and directories:
virt-copy-in -d Guest /home /etc/issue /tmp
仮想マシンからいくつかのファイルをコピーします¶
virt-copy-out(1) can recursively copy files and directories out of a guest or disk image.virt-copy-out -d Guest /home .Note the final space and period in the command is not a typo. This should copy "/home" from the guest into the current directory.
virt-df を実行します。¶
virt-df(1) はディスク領域を一覧表示します。次を実行します:virt-dfYou can try comparing this to the results from df(1) inside the guest, but there are some provisos:
- •
- 仮想マシンはアイドル状態にある必要があります。
- •
- 仮想マシンのディスクは sync(1) を使用して同期する必要があります。
- •
- Any action such as booting the guest will write log files causing the numbers to change.
Try importing virt-df CSV output into a spreadsheet or database.¶
次を実行します:virt-df --csv > /tmp/report.csvNow try to load this into your favorite spreadsheet or database. Are the results reproduced faithfully in the spreadsheet/database? http://www.postgresql.org/docs/8.1/static/sql-copy.html http://dev.mysql.com/doc/refman/5.1/en/load-data.html
* シャットオフしている仮想マシンにあるファイルを編集します。¶
virt-edit(1) は仮想マシンにあるファイルを編集できます。RHEL または Fedora 仮想マシンにおいてこのコマンドを試します:virt-edit LinuxGuest /etc/sysconfig/network他の Linux 仮想マシンにおいて、次のように他のファイルの編集を試します:
virt-edit LinuxGuest /etc/motdAre the changes seen inside the guest when it is booted?
仮想マシンにあるファイルシステム / パーティション / 論理ボリュームを表示します。¶
virt-filesystems(1) can be used to display filesystems in a guest. Try this command on any disk image or guest:virt-filesystems -a /path/to/disk.img --all --long -hまたは:
virt-filesystems -d Guest --all --long -hDo the results match what is seen in the guest?
すべての仮想マシンにおいて virt-inspector を実行します。¶
Use virt-inspector(1) to get a report on all of your guests or disk images:virt-inspector -a /path/to/disk.img | lessまたは:
virt-inspector -d Guest | lessDo the results match what is actually in the guest?
すべての仮想マシンにおいて virt-ls の監査機能を試します。¶
Linux 仮想マシンにある setuid または setgid プログラムを一覧表示します:virt-ls -lR -d Guest / | grep '^- [42]'Linux 仮想マシンにあるすべての全体書き込み可能なディレクトリーを一覧表示します:
virt-ls -lR -d Guest / | grep '^d ...7'Linux 仮想マシンにあるすべての Unix ドメインソケットを一覧表示します:
virt-ls -lR -d Guest / | grep '^s''.png' で終わるファイル名を持つすべての通常ファイルを表示するには:
virt-ls -lR -d Guest / | grep -i '^-.*\.png$'ホームディレクトリーにある 10MB より大きなファイルを表示します:
virt-ls -lR -d Guest /home | awk '$3 > 10*1024*1024'7日以内に変更されたものをすべて検索します:
virt-ls -lR -d Guest --time-days / | awk '$6 <= 7'24時間以内に変更された通常のファイルを検索します:
virt-ls -lR -d Guest --time-days / | grep '^-' | awk '$6 < 1'Do the results match what is in the guest?
tar ファイルからディスクイメージを作成します。¶
Use virt-make-fs(1) to create a disk image from any tarball that you happen to have:virt-make-fs --partition=mbr --type=vfat /any/tarball.tar.gz output.img'output.img' を既存の仮想マシンにローディスクとして追加します。仮想マシンがファイルを認識できるかを確認します。Windows 仮想マシンを試していると、このテストがとくに有用です。 他のパーティションスキーマを試してください。例: --partition=gpt 他のファイルシステム形式を試してください。例: --type=ntfs, --type=ext2
* 停止状態のディスクイメージまたは仮想マシンにおいて virt-rescue を実行します。¶
停止状態の仮想マシンまたはディスクイメージを検査、復旧、または修復するには virt-rescue(1) を使用します:virt-rescue -a /path/to/disk.imgまたは:
virt-rescue -d Guest仮想マシンを検査するために通常のシェルコマンドを使用できますか?
* 仮想マシンの容量を変更します。¶
仮想マシンのディスク容量を大きくするために virt-resize(1) を使用します。たとえば、ディスクイメージが 30G より小さければ、次を実行して 30G に増やします:truncate -s 30G newdisk.img virt-filesystems -a /path/to/olddisk.img --all --long -h virt-resize /path/to/olddisk.img newdisk.img --expand /dev/sda1 qemu-kvm -m 1024 -hda newdisk.img仮想マシンがまだ起動しますか?他のパーティションの拡張を試します。
* 仮想マシンのディスクをスパースにします。¶
virt-sparsify(1) を使用して、ディスクイメージをよりスパースにします:virt-sparsify /path/to/olddisk.img newdisk.imgIs "newdisk.img" still bootable after sparsifying? Is the resulting disk image smaller (use "du" to check)?
* 停止状態の Linux 仮想マシンを "sysprep" します。¶
Note that this really will mess up an existing guest, so it's better to clone the guest before trying this.virt-sysprep --hostname newhost.example.com -a /path/to/disk.imgsysprep が成功しましたか?起動後、何を変更しましたか、その変更は成功しましたか?
Windows ゲストから Windows レジストリをダンプします。¶
Windows 仮想マシンから Windows レジストリをダンプ出力するには virt-win-reg(1) を使用します。virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\Software' | less virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\System' | lessDoes the output match running "regedit" inside the guest? A recent feature is the ability to dump user registries, so try this, replacing username with the name of a local user in the guest:
virt-win-reg --unsafe-printable-strings WindowsGuest 'HKEY_USERS\username' | less
関連項目¶
guestfs(3), guestfish(1), guestfs-examples(3), http://libguestfs.org/.著者¶
Richard W.M. Jones ("rjones at redhat dot com")COPYRIGHT¶
Copyright (C) 2011-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.
2014-10-18 | libguestfs-1.28.1 |