.\" Automatically generated by Podwrapper::Man 1.40.2 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "guestfs-testing 1" .TH guestfs-testing 1 "2019-02-07" "libguestfs-1.40.2" "Virtualization Support" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "名前" .IX Header "名前" guestfs-testing \- libguestfs の手動テスト、手助けになります! .SH "説明" .IX Header "説明" 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! .PP Tests marked with a \fB*\fR (asterisk) can \fBdestroy data\fR if you're not careful. The others are safe and won't modify anything. .PP These tests \fBrequire libguestfs ≥ 1.22\fR. .PP このリンクを使用して見つけたバグを報告できます: .PP https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools .PP or post on the mailing list (registration is \fBnot\fR required, but if you're not registered then you'll have to wait for a moderator to manually approve your message): .PP https://www.redhat.com/mailman/listinfo/libguestfs .SH "テスト" .IX Header "テスト" .SS "libguestfs-test-tool の実行" .IX Subsection "libguestfs-test-tool の実行" 次を実行します: .PP .Vb 1 \& libguestfs\-test\-tool .Ve .PP このコマンドは、基本的な libguestfs が機能しているか、非常に簡単かつ非破壊的なテストを実行します。root として実行する必要がありません。 .PP If it \fIdoesn't\fR print \f(CW\*(C`===== TEST FINISHED OK =====\*(C'\fR, report it as a bug. It is very important that you include the \fBcomplete, unedited\fR output of \&\f(CW\*(C`libguestfs\-test\-tool\*(C'\fR in your bug report. See the \*(L"\s-1BUGS\*(R"\s0 section at the end of this page. .SS "\s-1KVM\s0 アクセラレーションが使用されていることを確認します。" .IX Subsection "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: .PP .Vb 1 \& time guestfish \-a /dev/null run .Ve .PP After a few runs, the time should settle down to a few seconds (under 3 seconds on fast 64 bit hardware). .PP 上のコマンドがまったく機能しなければ、 \fBlibguestfs\-test\-tool\fR\|(1) を使用します。 .SS "Check which version of libguestfs, qemu, libvirt, etc is being used." .IX Subsection "Check which version of libguestfs, qemu, libvirt, etc is being used." Look at the output of \f(CW\*(C`libguestfs\-test\-tool\*(C'\fR and check: .IP "\(bu" 4 Which version of libguestfs is being used? Near the beginning of the output you'll see a line like: .Sp .Vb 1 \& library version: 1.22.0fedora=19,release=1.fc19,libvirt .Ve .IP "\(bu" 4 Is libvirt being used? You can tell the difference by looking for the backend: .Sp .Vb 1 \& guestfs_get_backend: direct .Ve .Sp または: .Sp .Vb 1 \& guestfs_get_backend: libvirt .Ve .IP "\(bu" 4 Which version of qemu is being used? It may be printed out: .Sp .Vb 1 \& libguestfs: qemu version 1.5 .Ve .IP "\(bu" 4 Which kernel is being used? \fBsupermin\fR\|(1) will try to pick the latest kernel installed on your machine. You can see the version in the appliance output, eg: .Sp .Vb 1 \& [ 0.000000] Linux version 3.9.2\-200.fc18.x86_64 [...] .Ve .SS "Try to open a local guest image with guestfish." .IX Subsection "Try to open a local guest image with guestfish." You can use any guest disk image for this test. Make sure you use the \&\f(CW\*(C`\-\-ro\*(C'\fR flag so that \fBguestfish\fR\|(1) will open the disk image read-only. .PP .Vb 1 \& guestfish \-\-ro \-a /path/to/disk.img \-i .Ve .PP If the command is successful, it should print out the guest operating system name and put you at the guestfish \f(CW\*(C`>\*(C'\fR prompt. You can use guestfish commands like \f(CW\*(C`ll /\*(C'\fR to look inside the disk image. To exit, type \f(CW\*(C`exit\*(C'\fR. .PP If you get an error, try enabling debugging (add \f(CW\*(C`\-v\*(C'\fR to the command line). Also make sure that \fBlibguestfs\-test\-tool\fR\|(1) succeeds. .SS "Try to open a remote guest image with guestfish." .IX Subsection "Try to open a remote guest image with guestfish." You may also have to disable libvirt by setting this: .PP .Vb 1 \& export LIBGUESTFS_BACKEND=direct .Ve .PP If you have a disk image available over \s-1HTTP/FTP,\s0 try to open it. .PP .Vb 1 \& guestfish \-\-ro \-i \-\-format=raw \-a http://www.example.com/disk.img .Ve .PP For \s-1SSH\s0 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: .PP .Vb 2 \& guestfish \-\-ro \-i \-\-format=raw \e \& \-a ssh://remote.example.com/path/to/disk.img .Ve .PP If you get an error, try enabling debugging (add \f(CW\*(C`\-v\*(C'\fR to the command line). Also make sure that \fBlibguestfs\-test\-tool\fR\|(1) succeeds. .SS "すべての仮想マシンにおいて virt-alignment-scan を実行します。" .IX Subsection "すべての仮想マシンにおいて virt-alignment-scan を実行します。" 仮想マシンまたはディスクイメージにおいて \fBvirt\-alignment\-scan\fR\|(1) を実行します: .PP .Vb 1 \& virt\-alignment\-scan \-a /path/to/disk.img .Ve .PP または: .PP .Vb 1 \& virt\-alignment\-scan \-d Guest .Ve .PP Does the alignment report match how the guest partitions are aligned? .SS "仮想マシンにあるいくつかのファイルにおいて virt-cat を実行します。" .IX Subsection "仮想マシンにあるいくつかのファイルにおいて virt-cat を実行します。" \&\fBvirt\-cat\fR\|(1) は仮想マシンからファイルを表示できます。 Linux 仮想マシンに対しては、次を試します: .PP .Vb 1 \& virt\-cat LinuxGuest /etc/passwd .Ve .PP 最近の機能は Windows のパスをサポートします、たとえば: .PP .Vb 1 \& virt\-cat WindowsGuest \*(Aqc:\ewindows\ewin.ini\*(Aq .Ve .PP An even better test is if you have a Windows guest with multiple drives. Do \&\f(CW\*(C`D:\*(C'\fR, \f(CW\*(C`E:\*(C'\fR etc paths work correctly? .SS "\fB*\fP Copy some files into a \fBshut off\fP guest." .IX Subsection "* Copy some files into a shut off guest." \&\fBvirt\-copy\-in\fR\|(1) は仮想マシンまたはディスクイメージの中にあるファイルおよびディレクトリーを再帰的にコピーできます。 .PP .Vb 1 \& virt\-copy\-in \-d Guest /etc /tmp .Ve .PP This should copy local directory \fI/etc\fR to \fI/tmp/etc\fR in the guest (recursively). If you boot the guest, can you see all of the copied files and directories? .PP Shut the guest down and try copying multiple files and directories: .PP .Vb 1 \& virt\-copy\-in \-d Guest /home /etc/issue /tmp .Ve .SS "仮想マシンからいくつかのファイルをコピーします" .IX Subsection "仮想マシンからいくつかのファイルをコピーします" \&\fBvirt\-copy\-out\fR\|(1) can recursively copy files and directories out of a guest or disk image. .PP .Vb 1 \& virt\-copy\-out \-d Guest /home . .Ve .PP Note the final space and period in the command is not a typo. .PP This should copy \fI/home\fR from the guest into the current directory. .SS "virt-df を実行します。" .IX Subsection "virt-df を実行します。" \&\fBvirt\-df\fR\|(1) はディスク領域を一覧表示します。次を実行します: .PP .Vb 1 \& virt\-df .Ve .PP You can try comparing this to the results from \fBdf\fR\|(1) inside the guest, but there are some provisos: .IP "\(bu" 4 仮想マシンはアイドル状態にある必要があります。 .IP "\(bu" 4 仮想マシンのディスクは \fBsync\fR\|(1) を使用して同期する必要があります。 .IP "\(bu" 4 Any action such as booting the guest will write log files causing the numbers to change. .PP We don’t guarantee that the numbers will be identical even under these circumstances. They should be similar. It would indicate a bug if you saw greatly differing numbers. .SS "Try importing virt-df \s-1CSV\s0 output into a spreadsheet or database." .IX Subsection "Try importing virt-df CSV output into a spreadsheet or database." 次を実行します: .PP .Vb 1 \& virt\-df \-\-csv > /tmp/report.csv .Ve .PP Now try to load this into your favorite spreadsheet or database. Are the results reproduced faithfully in the spreadsheet/database? .PP http://www.postgresql.org/docs/8.1/static/sql\-copy.html http://dev.mysql.com/doc/refman/5.1/en/load\-data.html .SS "\fB*\fP \fBシャットオフ\fPしている仮想マシンにあるファイルを編集します。" .IX Subsection "* シャットオフしている仮想マシンにあるファイルを編集します。" \&\fBvirt\-edit\fR\|(1) は仮想マシンにあるファイルを編集できます。RHEL または Fedora 仮想マシンにおいてこのコマンドを試します: .PP .Vb 1 \& virt\-edit LinuxGuest /etc/sysconfig/network .Ve .PP 他の Linux 仮想マシンにおいて、次のように他のファイルの編集を試します: .PP .Vb 1 \& virt\-edit LinuxGuest /etc/motd .Ve .PP Are the changes seen inside the guest when it is booted? .SS "仮想マシンにあるファイルシステム / パーティション / 論理ボリュームを表示します。" .IX Subsection "仮想マシンにあるファイルシステム / パーティション / 論理ボリュームを表示します。" \&\fBvirt\-filesystems\fR\|(1) can be used to display filesystems in a guest. Try this command on any disk image or guest: .PP .Vb 1 \& virt\-filesystems \-a /path/to/disk.img \-\-all \-\-long \-h .Ve .PP または: .PP .Vb 1 \& virt\-filesystems \-d Guest \-\-all \-\-long \-h .Ve .PP Do the results match what is seen in the guest? .SS "すべての仮想マシンにおいて virt-inspector を実行します。" .IX Subsection "すべての仮想マシンにおいて virt-inspector を実行します。" Use \fBvirt\-inspector\fR\|(1) to get a report on all of your guests or disk images: .PP .Vb 1 \& virt\-inspector \-a /path/to/disk.img | less .Ve .PP または: .PP .Vb 1 \& virt\-inspector \-d Guest | less .Ve .PP Do the results match what is actually in the guest? .PP If you have an unusual guest (a rare Linux distro, a very new version of Windows), does virt-inspector recognize it? If not, then it's probably a bug. .SS "すべての仮想マシンにおいて virt-ls の監査機能を試します。" .IX Subsection "すべての仮想マシンにおいて virt-ls の監査機能を試します。" Linux 仮想マシンにある setuid または setgid プログラムを一覧表示します: .PP .Vb 1 \& virt\-ls \-lR \-d Guest / | grep \*(Aq^\- [42]\*(Aq .Ve .PP Linux 仮想マシンにあるすべての全体書き込み可能なディレクトリーを一覧表示します: .PP .Vb 1 \& virt\-ls \-lR \-d Guest / | grep \*(Aq^d ...7\*(Aq .Ve .PP Linux 仮想マシンにあるすべての Unix ドメインソケットを一覧表示します: .PP .Vb 1 \& virt\-ls \-lR \-d Guest / | grep \*(Aq^s\*(Aq .Ve .PP List all regular files with filenames ending in ‘.png’: .PP .Vb 1 \& virt\-ls \-lR \-d Guest / | grep \-i \*(Aq^\-.*\e.png$\*(Aq .Ve .PP ホームディレクトリーにある 10MB より大きなファイルを表示します: .PP .Vb 1 \& virt\-ls \-lR \-d Guest /home | awk \*(Aq$3 > 10*1024*1024\*(Aq .Ve .PP 7日以内に変更されたものをすべて検索します: .PP .Vb 1 \& virt\-ls \-lR \-d Guest \-\-time\-days / | awk \*(Aq$6 <= 7\*(Aq .Ve .PP 24時間以内に変更された通常のファイルを検索します: .PP .Vb 1 \& virt\-ls \-lR \-d Guest \-\-time\-days / | grep \*(Aq^\-\*(Aq | awk \*(Aq$6 < 1\*(Aq .Ve .PP Do the results match what is in the guest? .SS "tar ファイルからディスクイメージを作成します。" .IX Subsection "tar ファイルからディスクイメージを作成します。" Use \fBvirt\-make\-fs\fR\|(1) to create a disk image from any tarball that you happen to have: .PP .Vb 1 \& virt\-make\-fs \-\-partition=mbr \-\-type=vfat /any/tarball.tar.gz output.img .Ve .PP Add ‘output.img’ as a raw disk to an existing guest. Check the guest can see the files. This test is particularly useful if you try it with a Windows guest. .PP 他のパーティションスキーマを試してください。例: \fI\-\-partition=gpt\fR .PP 他のファイルシステム形式を試してください。例: \fI\-\-type=ntfs\fR, \fI\-\-type=ext2\fR .SS "\fB*\fP \fB停止状態\fPのディスクイメージまたは仮想マシンにおいて virt-rescue を実行します。" .IX Subsection "* 停止状態のディスクイメージまたは仮想マシンにおいて virt-rescue を実行します。" \&\fB停止状態\fRの仮想マシンまたはディスクイメージを検査、復旧、または修復するには \fBvirt\-rescue\fR\|(1) を使用します: .PP .Vb 1 \& virt\-rescue \-a /path/to/disk.img .Ve .PP または: .PP .Vb 1 \& virt\-rescue \-d Guest .Ve .PP 仮想マシンを検査するために通常のシェルコマンドを使用できますか? .SS "\fB*\fP 仮想マシンの容量を変更します。" .IX Subsection "* 仮想マシンの容量を変更します。" 仮想マシンのディスク容量を大きくするために \fBvirt\-resize\fR\|(1) を使用します。たとえば、ディスクイメージが 30G より小さければ、次を実行して 30G に増やします: .PP .Vb 4 \& 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 .Ve .PP 仮想マシンがまだ起動しますか?他のパーティションの拡張を試します。 .SS "\fB*\fP 仮想マシンのディスクをスパースにします。" .IX Subsection "* 仮想マシンのディスクをスパースにします。" \&\fBvirt\-sparsify\fR\|(1) を使用して、ディスクイメージをよりスパースにします: .PP .Vb 1 \& virt\-sparsify /path/to/olddisk.img newdisk.img .Ve .PP Is \fInewdisk.img\fR still bootable after sparsifying? Is the resulting disk image smaller (use \f(CW\*(C`du\*(C'\fR to check)? .SS "Build and boot a guest" .IX Subsection "Build and boot a guest" Using \fBvirt\-builder\fR\|(1), choose a guest from the list: .PP .Vb 1 \& virt\-builder \-l .Ve .PP build it: .PP .Vb 1 \& virt\-builder \-o disk.img [os\-version from list above] .Ve .PP and boot it: .PP .Vb 1 \& qemu\-kvm \-cpu host \-m 2048 \-drive file=disk.img,format=raw .Ve .PP Does it boot? .ie n .SS "\fB*\fP ""Sysprep"" a \fBshut off\fP Linux guest." .el .SS "\fB*\fP ``Sysprep'' a \fBshut off\fP Linux guest." .IX Subsection "* Sysprep a shut off Linux guest." \&\fBNote\fR that this really will mess up an existing guest, so it's better to clone the guest before trying this. .PP .Vb 1 \& virt\-sysprep \-\-hostname newhost.example.com \-a /path/to/disk.img .Ve .PP sysprep が成功しましたか?起動後、何を変更しましたか、その変更は成功しましたか? .SS "Windows ゲストから Windows レジストリをダンプします。" .IX Subsection "Windows ゲストから Windows レジストリをダンプします。" Windows 仮想マシンから Windows レジストリをダンプ出力するには \fBvirt\-win\-reg\fR\|(1) を使用します。 .PP .Vb 2 \& virt\-win\-reg \-\-unsafe\-printable\-strings WindowsGuest \*(AqHKLM\eSoftware\*(Aq | \& less \& \& virt\-win\-reg \-\-unsafe\-printable\-strings WindowsGuest \*(AqHKLM\eSystem\*(Aq | \& less .Ve .PP Does the output match running \f(CW\*(C`regedit\*(C'\fR inside the guest? .PP A recent feature is the ability to dump user registries, so try this, replacing \fIusername\fR with the name of a local user in the guest: .PP .Vb 2 \& virt\-win\-reg \-\-unsafe\-printable\-strings WindowsGuest \*(AqHKEY_USERS\eusername\*(Aq | \& less .Ve .SH "関連項目" .IX Header "関連項目" \&\fBguestfs\fR\|(3), \fBguestfish\fR\|(1), \fBguestfs\-examples\fR\|(3), http://libguestfs.org/. .SH "著者" .IX Header "著者" Richard W.M. Jones (\f(CW\*(C`rjones at redhat dot com\*(C'\fR) .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2011\-2012 Red Hat Inc. .SH "LICENSE" .IX Header "LICENSE" .SH "BUGS" .IX Header "BUGS" To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools .PP To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools .PP When reporting a bug, please supply: .IP "\(bu" 4 The version of libguestfs. .IP "\(bu" 4 Where you got libguestfs (eg. which Linux distro, compiled from source, etc) .IP "\(bu" 4 Describe the bug accurately and give a way to reproduce it. .IP "\(bu" 4 Run \fBlibguestfs\-test\-tool\fR\|(1) and paste the \fBcomplete, unedited\fR output into the bug report.