1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911
|
.\" 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-building 1"
.TH guestfs-building 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-building \- How to build libguestfs from source
.SH "説明"
.IX Header "説明"
This manual page describes how to build libguestfs from source.
.PP
The main steps are:
.IP "\(bu" 4
Install the requirements.
.IP "\(bu" 4
Build, either from the git repository or from a tarball.
.IP "\(bu" 4
Run the tests.
.IP "\(bu" 4
Run the tools from the source directory, or install.
.SH "REQUIREMENTS"
.IX Header "REQUIREMENTS"
.SS "Short cut for Fedora or Red Hat Enterprise Linux (\s-1RHEL\s0) users"
.IX Subsection "Short cut for Fedora or Red Hat Enterprise Linux (RHEL) users"
On Fedora, use \fBdnf\fR\|(8) to install all the requirements:
.PP
.Vb 2
\& dnf builddep libguestfs
\& dnf install autoconf automake libtool gettext\-devel
.Ve
.PP
On systems still using \fByum\fR\|(8), do:
.PP
.Vb 2
\& yum\-builddep libguestfs
\& yum install autoconf automake libtool gettext\-devel
.Ve
.SS "Short cut for Debian or Ubuntu users"
.IX Subsection "Short cut for Debian or Ubuntu users"
Use \s-1APT\s0 to install all the requirements:
.PP
.Vb 2
\& apt\-get build\-dep libguestfs
\& apt\-get install autoconf automake libtool\-bin gettext
.Ve
.PP
If that command doesn't work, take a look at the Debian source package
http://packages.debian.org/source/libguestfs, at the list of
\&\f(CW\*(C`build\-depends\*(C'\fR and \f(CW\*(C`build\-depends\-indep\*(C'\fR, and install everything listed
there.
.SS "Full list of requirements"
.IX Subsection "Full list of requirements"
.IP "\fIappliance/packagelist.in\fR" 4
.IX Item "appliance/packagelist.in"
Install as many package names found in this file as possible. (It is not
strictly required to install all of them).
.Sp
\&\fINote\fR: If you build libguestfs followed by installing appliance packages,
the build will not pick them up automatically, even if you do \f(CW\*(C`make clean\*(C'\fR. You have to do this command to clean the old supermin appliance
and force a new one to be prepared:
.Sp
.Vb 1
\& make \-C appliance clean\-supermin\-appliance
.Ve
.IP "qemu ≥ 1.3.0" 4
.IX Item "qemu ≥ 1.3.0"
\&\fIRequired\fR.
.IP "qemu-img ≥ 1.3.0" 4
.IX Item "qemu-img ≥ 1.3.0"
\&\fIRequired\fR. Virt\-p2v and virt\-v2v requires qemu-img ≥ 2.2.0.
.IP "kernel ≥ 2.6.34" 4
.IX Item "kernel ≥ 2.6.34"
\&\fIRequired\fR. The following features must be enabled: \f(CW\*(C`virtio\-pci\*(C'\fR,
\&\f(CW\*(C`virtio\-serial\*(C'\fR, \f(CW\*(C`virtio\-block\*(C'\fR, \f(CW\*(C`virtio\-net\*(C'\fR.
.IP "supermin ≥ 5.1.0" 4
.IX Item "supermin ≥ 5.1.0"
\&\fIRequired\fR. For alternatives, see \*(L"\s-1USING A PREBUILT BINARY APPLIANCE\*(R"\s0
below.
.IP "glibc" 4
.IX Item "glibc"
\&\fIRequired\fR. We use the custom printf formatters extension of glibc (see
\&\*(L"\s-1DAEMON CUSTOM PRINTF FORMATTERS\*(R"\s0 in \fBguestfs\-hacking\fR\|(1)).
.IP "\s-1XDR\s0 (tirpc, glibc or other)" 4
.IX Item "XDR (tirpc, glibc or other)"
\&\fIRequired\fR. We use the \s-1XDR\s0 implementation from \f(CW\*(C`<rpc/xdr.h>\*(C'\fR,
which may come from glibc, tirpc or another library.
.Sp
The \f(CW\*(C`rpcgen\*(C'\fR tool is optional, except if you want to compile from git
and/or patch libguestfs with new APIs.
.IP "Gcc or Clang" 4
.IX Item "Gcc or Clang"
\&\fIRequired\fR. We use \f(CW\*(C`_\|_attribute_\|_((cleanup))\*(C'\fR which is a \s-1GCC\s0 extension
also supported by Clang.
.IP "Perl" 4
.IX Item "Perl"
\&\fIRequired\fR. Various build steps and tests are written in Perl. Perl is
not needed at runtime except if you need to run a small number of virt tools
which are still written in Perl.
.ie n .IP "Perl ""Pod::Man""" 4
.el .IP "Perl \f(CWPod::Man\fR" 4
.IX Item "Perl Pod::Man"
.PD 0
.ie n .IP "Perl ""Pod::Simple""" 4
.el .IP "Perl \f(CWPod::Simple\fR" 4
.IX Item "Perl Pod::Simple"
.PD
\&\fIRequired\fR. Part of Perl core.
.IP "OCaml ≥ 4.01" 4
.IX Item "OCaml ≥ 4.01"
.PD 0
.IP "OCaml findlib" 4
.IX Item "OCaml findlib"
.PD
\&\fIRequired\fR.
.IP "autoconf" 4
.IX Item "autoconf"
.PD 0
.IP "automake" 4
.IX Item "automake"
.IP "gettext" 4
.IX Item "gettext"
.PD
\&\fIRequired\fR if compiling from git. Optional if compiling from tarball.
.IP "cpio" 4
.IX Item "cpio"
\&\fIRequired\fR.
.IP "gperf" 4
.IX Item "gperf"
\&\fIRequired\fR.
.IP "flex" 4
.IX Item "flex"
.PD 0
.IP "bison" 4
.IX Item "bison"
.PD
\&\fIRequired\fR.
.IP "Perl-compatible Regular Expressions (\s-1PCRE\s0) library" 4
.IX Item "Perl-compatible Regular Expressions (PCRE) library"
\&\fIRequired\fR.
.IP "genisoimage" 4
.IX Item "genisoimage"
\&\fIRequired\fR.
.IP "libxml2" 4
.IX Item "libxml2"
\&\fIRequired\fR.
.IP "ncurses" 4
.IX Item "ncurses"
\&\fIRequired\fR.
.IP "augeas ≥ 1.0.0" 4
.IX Item "augeas ≥ 1.0.0"
\&\fIRequired\fR.
.IP "xz" 4
.IX Item "xz"
\&\fIRequired\fR.
.IP "Jansson ≥ 2.7" 4
.IX Item "Jansson ≥ 2.7"
\&\fIRequired\fR.
.IP "po4a" 4
.IX Item "po4a"
\&\fIRequired\fR if compiling from git. Optional if compiling from tarball.
.IP "hivex ≥ 1.2.7" 4
.IX Item "hivex ≥ 1.2.7"
.PD 0
.IP "ocaml-hivex" 4
.IX Item "ocaml-hivex"
.PD
\&\fIRequired\fR. ocaml-hivex is the OCaml binding for hivex, which is required
when building the daemon.
.IP "libmagic" 4
.IX Item "libmagic"
\&\fIRequired\fR. This is the library used by the \fBfile\fR\|(1) command.
.IP "libvirt ≥ 0.10.2" 4
.IX Item "libvirt ≥ 0.10.2"
Optional. Always use the latest possible version of libvirt.
.IP "xmllint" 4
.IX Item "xmllint"
Optional. Used only for tests.
.IP "libconfig" 4
.IX Item "libconfig"
Optional. Used to parse libguestfs’s own config files,
eg. \fI/etc/libguestfs\-tools.conf\fR.
.IP "libselinux" 4
.IX Item "libselinux"
Optional. Used by the libvirt backend to securely
confine the appliance (sVirt).
.IP "Berkeley \s-1DB\s0 utils (db_dump, db_load, etc)" 4
.IX Item "Berkeley DB utils (db_dump, db_load, etc)"
Optional. Usually found in a package called \f(CW\*(C`db\-utils\*(C'\fR, \f(CW\*(C`db4\-utils\*(C'\fR,
\&\f(CW\*(C`db4.X\-utils\*(C'\fR etc.
.IP "systemtap" 4
.IX Item "systemtap"
Optional. For userspace probes.
.IP "readline" 4
.IX Item "readline"
Optional. For nicer command line editing in \fBguestfish\fR\|(1).
.IP "acl" 4
.IX Item "acl"
Optional. Library and programs for handling \s-1POSIX\s0 ACLs.
.IP "libcap" 4
.IX Item "libcap"
Optional. Library and programs for handling Linux capabilities.
.IP "libldm" 4
.IX Item "libldm"
Optional. Library and \fBldmtool\fR\|(1) for handling Windows Dynamic Disks.
.IP "sd-journal" 4
.IX Item "sd-journal"
Optional. Library for accessing systemd journals.
.IP "gdisk" 4
.IX Item "gdisk"
Optional. \s-1GPT\s0 disk support.
.IP "netpbm" 4
.IX Item "netpbm"
Optional. Render icons from guests.
.IP "icoutils" 4
.IX Item "icoutils"
Optional. Render icons from Windows guests.
.ie n .IP "Perl ""Expect""" 4
.el .IP "Perl \f(CWExpect\fR" 4
.IX Item "Perl Expect"
Optional. Perl module used to test \fBvirt\-rescue\fR\|(1).
.IP "\s-1FUSE\s0" 4
.IX Item "FUSE"
Optional. \fBfusermount\fR\|(1), libfuse and kernel module are all needed if you
want \fBguestmount\fR\|(1) and/or mount-local support.
.IP "static glibc" 4
.IX Item "static glibc"
Optional. Used only for testing.
.IP "qemu-nbd" 4
.IX Item "qemu-nbd"
.PD 0
.IP "nbdkit" 4
.IX Item "nbdkit"
.PD
Optional. qemu-nbd is used for testing.
.Sp
\&\fBvirt\-p2v\fR\|(1) requires either qemu-nbd or nbdkit, but these only need to be
present on the virt\-p2v \s-1ISO,\s0 they do not need to be installed at compile
time.
.IP "uml_mkcow" 4
.IX Item "uml_mkcow"
Optional. For the \s-1UML\s0 backend.
.IP "curl" 4
.IX Item "curl"
Optional. Used by virt-builder for downloads.
.IP "\s-1GNU\s0 Privacy Guard (GnuPG, gpg) v1 or v2" 4
.IX Item "GNU Privacy Guard (GnuPG, gpg) v1 or v2"
Optional. Used by virt-builder for checking digital signatures.
.IP "liblzma" 4
.IX Item "liblzma"
Optional. If available, virt-builder will use this library for fast,
parallel uncompression of templates.
.IP "Gtk ≥ 2.24, or 3" 4
.IX Item "Gtk ≥ 2.24, or 3"
Optional.
.Sp
Used by the virt\-p2v graphical user interface.
.Sp
Either Gtk 2 or Gtk 3 can be used. If you want to select a specific version
of Gtk, use \f(CW\*(C`./configure \-\-with\-gtk=2\*(C'\fR or \f(CW\*(C`./configure \-\-with\-gtk=3\*(C'\fR.
.IP "D\-Bus" 4
.IX Item "D-Bus"
Optional.
.Sp
If the D\-Bus low level C \s-1API\s0 is available, virt\-p2v can send a D\-Bus message
to logind to inhibit power saving (sleep, suspend, etc) during P2V
conversions.
.Sp
If this \s-1API\s0 is not available at build time, then very long conversions might
be interrupted if the physical machine goes to sleep.
.IP "zip" 4
.IX Item "zip"
.PD 0
.IP "unzip" 4
.IX Item "unzip"
.PD
Optional. Used by virt\-v2v to handle \s-1OVA\s0 files.
.IP "python-evtx" 4
.IX Item "python-evtx"
Optional. Used by \fBvirt\-log\fR\|(1) to parse Windows Event Log files.
.IP "OCaml gettext" 4
.IX Item "OCaml gettext"
Optional. For localizing OCaml virt tools.
.IP "ocaml-ounit ≥ 2.0.0" 4
.IX Item "ocaml-ounit ≥ 2.0.0"
Optional. For testing the common OCaml modules.
.IP "ocaml-libvirt ≥ 0.6.1.5" 4
.IX Item "ocaml-libvirt ≥ 0.6.1.5"
Optional. For building the optional virt\-v2v test harness.
.ie n .IP "Perl ""Module::Build"" ≥ 0.19" 4
.el .IP "Perl \f(CWModule::Build\fR ≥ 0.19" 4
.IX Item "Perl Module::Build ≥ 0.19"
.PD 0
.ie n .IP "Perl ""Test::More""" 4
.el .IP "Perl \f(CWTest::More\fR" 4
.IX Item "Perl Test::More"
.PD
Optional. Used to build and test the Perl bindings.
.IP "Python ≥ 2.2" 4
.IX Item "Python ≥ 2.2"
Optional. Used to build the Python bindings. For building Python 2 or
Python 3 bindings, see \*(L"\s-1BUILDING PYTHON 2 AND PYTHON 3 BINDINGS\*(R"\s0 below.
.ie n .IP "Python ""unittest""" 4
.el .IP "Python \f(CWunittest\fR" 4
.IX Item "Python unittest"
Optional. Used to run the Python testsuite.
.IP "Ruby" 4
.IX Item "Ruby"
.PD 0
.IP "rake" 4
.IX Item "rake"
.IP "rubygem-minitest" 4
.IX Item "rubygem-minitest"
.IP "rubygem-rdoc" 4
.IX Item "rubygem-rdoc"
.PD
Optional. Used to build the Ruby bindings.
.IP "Java ≥ 1.6" 4
.IX Item "Java ≥ 1.6"
Optional. Java, \s-1JNI\s0 and jpackage-utils are needed for building Java
bindings.
.IP "\s-1GHC\s0" 4
.IX Item "GHC"
Optional. Used to build the Haskell bindings.
.IP "\s-1PHP\s0" 4
.IX Item "PHP"
.PD 0
.IP "phpize" 4
.IX Item "phpize"
.PD
Optional. Used to build the \s-1PHP\s0 bindings.
.IP "glib2" 4
.IX Item "glib2"
.PD 0
.IP "gobject-introspection" 4
.IX Item "gobject-introspection"
.IP "gjs" 4
.IX Item "gjs"
.PD
Optional. Used to build and test the GObject bindings.
.IP "\s-1LUA\s0" 4
.IX Item "LUA"
Optional. Used to build the \s-1LUA\s0 bindings.
.IP "Erlang" 4
.IX Item "Erlang"
.PD 0
.IP "erl_interface" 4
.IX Item "erl_interface"
.PD
Optional. Used to build the Erlang bindings.
.IP "golang ≥ 1.1.1" 4
.IX Item "golang ≥ 1.1.1"
Optional. Used to build the Go bindings.
.IP "valgrind" 4
.IX Item "valgrind"
Optional. For testing memory problems.
.ie n .IP "Perl ""Sys::Virt""" 4
.el .IP "Perl \f(CWSys::Virt\fR" 4
.IX Item "Perl Sys::Virt"
Optional.
.IP "libvirt-python" 4
.IX Item "libvirt-python"
Optional. For testing Python libvirt/libguestfs interactions.
.ie n .IP "Perl ""Win::Hivex""" 4
.el .IP "Perl \f(CWWin::Hivex\fR" 4
.IX Item "Perl Win::Hivex"
Optional. Used by the \fBvirt\-win\-reg\fR\|(1) tool.
.ie n .IP "Perl ""Pod::Usage""" 4
.el .IP "Perl \f(CWPod::Usage\fR" 4
.IX Item "Perl Pod::Usage"
Optional. Used by some Perl virt tools.
.ie n .IP "Perl ""libintl""" 4
.el .IP "Perl \f(CWlibintl\fR" 4
.IX Item "Perl libintl"
Optional.
.IP "bash-completion" 4
.IX Item "bash-completion"
Optional. For tab-completion of commands in bash.
.IP "libtsk" 4
.IX Item "libtsk"
Optional. Library for filesystem forensics analysis.
.IP "yara" 4
.IX Item "yara"
Optional. Tool for categorizing files based on their content.
.SH "BUILDING FROM GIT"
.IX Header "BUILDING FROM GIT"
You will need to install additional dependencies \f(CW\*(C`autoconf\*(C'\fR, \f(CW\*(C`automake\*(C'\fR,
\&\f(CW\*(C`gettext\*(C'\fR, OCaml findlib and po4a when building from git.
.PP
.Vb 4
\& git clone https://github.com/libguestfs/libguestfs
\& cd libguestfs
\& ./autogen.sh
\& make
.Ve
.SH "BUILDING FROM TARBALLS"
.IX Header "BUILDING FROM TARBALLS"
Tarballs are downloaded from http://download.libguestfs.org/. Stable
tarballs are signed with the GnuPG key for \f(CW\*(C`rich@annexia.org\*(C'\fR, see
https://pgp.mit.edu/pks/lookup?op=vindex&search=0x91738F73E1B768A0. The
fingerprint is \f(CW\*(C`F777 4FB1 AD07 4A7E 8C87 67EA 9173 8F73 E1B7 68A0\*(C'\fR.
.PP
Download and unpack the tarball.
.PP
.Vb 3
\& cd libguestfs\-1.xx.yy
\& ./configure
\& make
.Ve
.SH "RUNNING THE TESTS"
.IX Header "RUNNING THE TESTS"
\&\fB\s-1DO NOT\s0 run the tests as root!\fR Libguestfs can be built and tested as
non-root. Running the tests as root could even be dangerous, don't do it.
.PP
To sanity check that the build worked, do:
.PP
.Vb 1
\& make quickcheck
.Ve
.PP
To run the basic tests, do:
.PP
.Vb 1
\& make check
.Ve
.PP
There are many more tests you can run. See \fBguestfs\-hacking\fR\|(1) for
details.
.SH "INSTALLING"
.IX Header "INSTALLING"
\&\fB\s-1DO NOT\s0 use \f(CB\*(C`make install\*(C'\fB!\fR You'll end up with conflicting versions of
libguestfs installed, and this causes constant headaches for users. See the
next section for how to use the \fI./run\fR script instead.
.PP
Distro packagers can use:
.PP
.Vb 1
\& make INSTALLDIRS=vendor DESTDIR=[temp\-build\-dir] install
.Ve
.SH "THE ./run SCRIPT"
.IX Header "THE ./run SCRIPT"
You can run \fBguestfish\fR\|(1), \fBguestmount\fR\|(1) and the virt tools without
needing to install them by using the \fI./run\fR script in the top directory.
This script works by setting several environment variables.
.PP
例:
.PP
.Vb 1
\& ./run guestfish [usual guestfish args ...]
\&
\& ./run virt\-inspector [usual virt\-inspector args ...]
.Ve
.PP
The \fI./run\fR script adds every libguestfs binary to the \f(CW$PATH\fR, so the
above examples run guestfish and virt-inspector from the build directory
(not the globally installed guestfish if there is one).
.PP
You can use the script from any directory. If you wanted to run your own
libguestfs-using program, then the following command will also work:
.PP
.Vb 1
\& /path/to/libguestfs/run ./my_program [...]
.Ve
.PP
You can also run the C programs under valgrind like this:
.PP
.Vb 1
\& ./run valgrind [valgrind opts...] virt\-cat [virt\-cat opts...]
.Ve
.PP
or under gdb:
.PP
.Vb 1
\& ./run gdb \-\-args virt\-cat [virt\-cat opts...]
.Ve
.PP
This also works with sudo (eg. if you need root access for libvirt or to
access a block device):
.PP
.Vb 1
\& sudo ./run virt\-cat \-d LinuxGuest /etc/passwd
.Ve
.PP
To set environment variables, you can either do:
.PP
.Vb 1
\& LIBGUESTFS_HV=/my/qemu ./run guestfish
.Ve
.PP
または:
.PP
.Vb 1
\& ./run env LIBGUESTFS_HV=/my/qemu guestfish
.Ve
.SH "\fIlocal*\fP FILES"
.IX Header "local* FILES"
Files in the top source directory that begin with the prefix \fIlocal*\fR are
ignored by git. These files can contain local configuration or scripts that
you need to build libguestfs.
.PP
I have a file called \fIlocalconfigure\fR which is a simple wrapper around
\&\fIautogen.sh\fR containing local configure customizations that I need. It
looks like this:
.PP
.Vb 5
\& . localenv
\& ./autogen.sh \e
\& \-C \e
\& \-\-enable\-werror \e
\& "$@"
.Ve
.PP
So I can use this to build libguestfs:
.PP
.Vb 1
\& ./localconfigure && make
.Ve
.PP
If there is a file in the top build directory called \fIlocalenv\fR, then it
will be sourced by \f(CW\*(C`make\*(C'\fR. This file can contain any local environment
variables needed, eg. for skipping tests:
.PP
.Vb 4
\& # 代替の python バイナリを使用します。
\& export PYTHON=python3
\& # このテストを飛ばします。これは壊れています。
\& export SKIP_TEST_BTRFS_FSCK=1
.Ve
.PP
Note that \fIlocalenv\fR is included by the top Makefile (so it’s a Makefile
fragment). But if it is also sourced by your \fIlocalconfigure\fR script then
it is used as a shell script.
.SH "SELECTED ./configure SETTINGS"
.IX Header "SELECTED ./configure SETTINGS"
There are many \f(CW\*(C`./configure\*(C'\fR options. Use:
.PP
.Vb 1
\& ./configure \-\-help
.Ve
.PP
to list them all. This section covers some of the more important ones.
.IP "\fB\-\-disable\-appliance \-\-disable\-daemon\fR" 4
.IX Item "--disable-appliance --disable-daemon"
See \*(L"\s-1USING A PREBUILT BINARY APPLIANCE\*(R"\s0 below.
.IP "\fB\-\-disable\-erlang\fR" 4
.IX Item "--disable-erlang"
.PD 0
.IP "\fB\-\-disable\-gobject\fR" 4
.IX Item "--disable-gobject"
.IP "\fB\-\-disable\-golang\fR" 4
.IX Item "--disable-golang"
.IP "\fB\-\-disable\-haskell\fR" 4
.IX Item "--disable-haskell"
.IP "\fB\-\-disable\-lua\fR" 4
.IX Item "--disable-lua"
.IP "\fB\-\-disable\-ocaml\fR" 4
.IX Item "--disable-ocaml"
.IP "\fB\-\-disable\-perl\fR" 4
.IX Item "--disable-perl"
.IP "\fB\-\-disable\-php\fR" 4
.IX Item "--disable-php"
.IP "\fB\-\-disable\-python\fR" 4
.IX Item "--disable-python"
.IP "\fB\-\-disable\-ruby\fR" 4
.IX Item "--disable-ruby"
.PD
Disable specific language bindings, even if \f(CW\*(C`./configure\*(C'\fR finds all the
necessary libraries are installed so that they could be compiled.
.Sp
Note that disabling OCaml (bindings) or Perl will have the knock-on effect
of disabling parts of the test suite and some tools.
.Sp
OCaml is required to build libguestfs and this requirement cannot be
removed. Using \fI\-\-disable\-ocaml\fR only disables the bindings and OCaml
tools.
.IP "\fB\-\-disable\-fuse\fR" 4
.IX Item "--disable-fuse"
Disable \s-1FUSE\s0 support in the \s-1API\s0 and the \fBguestmount\fR\|(1) tool.
.IP "\fB\-\-disable\-gnulib\-tests\fR" 4
.IX Item "--disable-gnulib-tests"
On some platforms the GNUlib test suite can be flaky. This disables it,
since errors in the GNUlib test suite are often not important.
.IP "\fB\-\-disable\-static\fR" 4
.IX Item "--disable-static"
Don’t build a static linked version of the libguestfs library.
.IP "\fB\-\-enable\-install\-daemon\fR" 4
.IX Item "--enable-install-daemon"
Normally \fBguestfsd\fR\|(8) is not installed by \f(CW\*(C`make install\*(C'\fR, since that
wouldn't be useful (instead it is \*(L"installed\*(R" inside the supermin
appliance). However if packagers are building \*(L"libguestfs live\*(R" then they
should use this option.
.IP "\fB\-\-enable\-werror\fR" 4
.IX Item "--enable-werror"
This turns compiler warnings into errors (ie. \f(CW\*(C`\-Werror\*(C'\fR). Use this for
development, especially when submitting patches. It should generally \fInot\fR
be used for production or distro builds.
.IP "\fB\-\-with\-default\-backend=libvirt\fR" 4
.IX Item "--with-default-backend=libvirt"
This controls the default method that libguestfs uses to run qemu (see
\&\*(L"\s-1BACKEND\*(R"\s0 in \fBguestfs\fR\|(3)). If not specified, the default backend is \f(CW\*(C`direct\*(C'\fR,
which means libguestfs runs qemu directly.
.Sp
Fedora and Red Hat Enterprise Linux (\s-1RHEL\s0) ≥ 7 use this flag to change
the default backend to \f(CW\*(C`libvirt\*(C'\fR, because (especially in \s-1RHEL\s0) the policy
is not to allow any program to run qemu except via libvirt.
.Sp
Note that despite this setting, all backends are built into libguestfs, and
you can override the backend at runtime by setting the
\&\f(CW$LIBGUESTFS_BACKEND\fR environment variable (or using \s-1API\s0 methods).
.IP "\fB\-\-with\-distro=REDHAT|DEBIAN|...\fR" 4
.IX Item "--with-distro=REDHAT|DEBIAN|..."
Libguestfs needs to know which Linux distro is in use so it can choose
package names for the appliance correctly (see for example
\&\fIappliance/packagelist.in\fR). It normally does this automatically.
.Sp
However if you can building or packaging libguestfs on a new distro then you
can use \fI\-\-with\-distro\fR to specify that the distro is similar to an
existing one (eg. \fI\-\-with\-distro=REDHAT\fR if the distro is a new Red Hat or
CentOS derivative).
.Sp
Note that if your distro is completely new then it may still require
upstream modifications.
.ie n .IP "\fB\-\-with\-extra=""\fR\fIdistroname\fR=\fIversion\fR,libvirt,...\fB""\fR" 4
.el .IP "\fB\-\-with\-extra=``\fR\fIdistroname\fR=\fIversion\fR,libvirt,...\fB''\fR" 4
.IX Item "--with-extra=""distroname=version,libvirt,..."""
.PD 0
.ie n .IP "\fB\-\-with\-extra=""local""\fR" 4
.el .IP "\fB\-\-with\-extra=``local''\fR" 4
.IX Item "--with-extra=local"
.PD
This option controls the \*(L"extra\*(R" field returned by
\&\*(L"guestfs_version\*(R" in \fBguestfs\fR\|(3) and also printed by virt tools' \fI\-\-version\fR
option. It is a free text field, but a good idea is to encode a
comma-separated list of facts such as the distro name and version, whether
libvirt is the default backend, and anything else that may help with
debugging problems raised by users.
.Sp
For custom and/or local builds, this can be set to \f(CW\*(C`local\*(C'\fR to indicate this
is \fInot\fR a distro build.
.IP "\fB\-\-without\-libvirt\fR" 4
.IX Item "--without-libvirt"
Compile libguestfs without libvirt support, even if libvirt development
libraries are installed.
.IP "\fB\-\-with\-gtk=2\fR" 4
.IX Item "--with-gtk=2"
This option forces virt\-p2v to be built against Gtk 2, which is currently
the most widely tested configuration.
.ie n .IP "\fB\-\-with\-qemu=""\fRbin1 bin2 ...\fB""\fR" 4
.el .IP "\fB\-\-with\-qemu=``\fRbin1 bin2 ...\fB''\fR" 4
.IX Item "--with-qemu=""bin1 bin2 ..."""
Provide an alternate qemu binary (or list of binaries). This can be
overridden at runtime by setting the \f(CW\*(C`LIBGUESTFS_HV\*(C'\fR environment variable.
.IP "\fB\-\-with\-supermin\-packager\-config=\fR\fIyum.conf\fR" 4
.IX Item "--with-supermin-packager-config=yum.conf"
This passes the \fI\-\-packager\-config\fR option to \fBsupermin\fR\|(1).
.Sp
The most common use for this is to build the appliance using an alternate
repository (instead of using the installed yum/dnf/apt/etc configuration to
find and download packages). You might need to use this if you want to
build libguestfs without having a network connection. Examples of using
this can be found in the Fedora \f(CW\*(C`libguestfs.spec\*(C'\fR file (see \*(L"\s-1BUILDING A
PACKAGE FOR FEDORA\*(R"\s0 below for resources).
.ie n .IP "\fB\-\-with\-supermin\-extra\-options=""\fR\-\-opt1 \-\-opt2 ...\fB""\fR" 4
.el .IP "\fB\-\-with\-supermin\-extra\-options=``\fR\-\-opt1 \-\-opt2 ...\fB''\fR" 4
.IX Item "--with-supermin-extra-options=""--opt1 --opt2 ..."""
Pass additional options to \fBsupermin\fR\|(1). See \fIappliance/make.sh.in\fR to
understand precisely what this does.
.IP "\fB\s-1PYTHON\s0\fR" 4
.IX Item "PYTHON"
This environment variable may be set to point to a python binary
(eg. \f(CW\*(C`python3\*(C'\fR). When \f(CW\*(C`./configure\*(C'\fR runs, it inspects this python binary
to find the version of Python, the location of Python libraries and so on.
See \*(L"\s-1BUILDING PYTHON 2 AND PYTHON 3 BINDINGS\*(R"\s0 below.
.IP "\fB\s-1SUPERMIN\s0\fR" 4
.IX Item "SUPERMIN"
This environment variable can be set to choose an alternative \fBsupermin\fR\|(1)
binary. This might be used, for example, if you want to use a newer
upstream version of supermin than is packaged for your distro, or if
supermin is not packaged at all. On \s-1RHEL 7,\s0 you must set
\&\f(CW\*(C`SUPERMIN=/usr/bin/supermin5\*(C'\fR when compiling libguestfs.
.SH "NOTES ABOUT QEMU AND KVM"
.IX Header "NOTES ABOUT QEMU AND KVM"
A common problem is with broken or incompatible qemu releases.
.PP
Different versions of qemu have problems booting the appliance for different
reasons. This varies between versions of qemu, and Linux distributions
which add their own patches.
.PP
If you find a problem, you could try using your own qemu built from source
(qemu is very easy to build from source), with a \*(L"qemu wrapper\*(R". See
\&\*(L"\s-1QEMU WRAPPERS\*(R"\s0 in \fBguestfs\fR\|(3).
.PP
By default the configure script will look for qemu-kvm (\s-1KVM\s0 support). \s-1KVM\s0
is much faster than using plain qemu.
.PP
You may also need to enable \s-1KVM\s0 support for non-root users, by following
these instructions:
http://www.linux\-kvm.org/page/FAQ#How_can_I_use_kvm_with_a_non\-privileged_user.3F
.PP
On some systems, this will work too:
.PP
.Vb 1
\& chmod 0666 /dev/kvm
.Ve
.PP
On some systems, the chmod will not survive a reboot, and you will need to
make edits to the udev configuration.
.SH "USING CLANG (LLVM) INSTEAD OF GCC"
.IX Header "USING CLANG (LLVM) INSTEAD OF GCC"
.Vb 3
\& export CC=clang
\& ./configure
\& make
.Ve
.SH "USING A PREBUILT BINARY APPLIANCE"
.IX Header "USING A PREBUILT BINARY APPLIANCE"
To understand what the libguestfs appliance means, see
\&\fBguestfs\-internals\fR\|(1).
.PP
If you are using non-Linux, or a Linux distribution that does not have
\&\fBsupermin\fR\|(1) support, or simply if you don't want to build your own
libguestfs appliance, then you can use one of the prebuilt binary appliances
that we supply: http://libguestfs.org/download/binaries/appliance
.PP
Build libguestfs like this:
.PP
.Vb 2
\& ./configure \-\-disable\-appliance \-\-disable\-daemon
\& make
.Ve
.PP
Set \f(CW$LIBGUESTFS_PATH\fR to the path where you unpacked the appliance
tarball, eg:
.PP
.Vb 1
\& export LIBGUESTFS_PATH=/usr/local/lib/guestfs/appliance
.Ve
.PP
and run the libguestfs programs and virt tools in the normal way, eg. using
the \fI./run\fR script (see above).
.SH "BUILDING PYTHON 2 AND PYTHON 3 BINDINGS"
.IX Header "BUILDING PYTHON 2 AND PYTHON 3 BINDINGS"
The \fI./configure\fR script detects the currently installed version of Python
using whatever program is called \f(CW\*(C`python\*(C'\fR in the current \f(CW$PATH\fR.
Libguestfs will build Python 2 or Python 3 bindings as appropriate.
.PP
You can override this behaviour by specifying an alternate Python binary,
eg:
.PP
.Vb 1
\& PYTHON=/usr/bin/python3 ./configure
.Ve
.PP
To build parallel Python 2 and Python 3 bindings, you will need to build
libguestfs twice. The second time, you can disable all the other bindings
and tools and just build the Python bindings. See the Fedora spec file (see
below) for a complete example of how to do this.
.SH "BUILDING A PACKAGE FOR FEDORA"
.IX Header "BUILDING A PACKAGE FOR FEDORA"
The Fedora spec file is stored under:
http://pkgs.fedoraproject.org/cgit/rpms/libguestfs.git/
.PP
Libguestfs is built in Fedora using the ordinary Fedora build system (Koji).
.SH "BUILDING A PACKAGE FOR RED HAT ENTERPRISE LINUX"
.IX Header "BUILDING A PACKAGE FOR RED HAT ENTERPRISE LINUX"
Red Hat Enterprise Linux (\s-1RHEL\s0) builds of libguestfs are heavily patched.
There are broadly two types of patches we apply:
.IP "\(bu" 4
We disable many features that we do not wish to support for \s-1RHEL\s0 customers.
For example, the \*(L"libguestfs live\*(R" feature is disabled.
.IP "\(bu" 4
We backport upstream features.
.PP
The patches we apply to \s-1RHEL\s0 releases are available publically in the
upstream git repository, in a branch called \f(CW\*(C`rhel\-x.y\*(C'\fR
.PP
For example, the \s-1RHEL 7.3\s0 patches are available here:
https://github.com/libguestfs/libguestfs/commits/rhel\-7.3
.PP
The sources and spec files for \s-1RHEL\s0 versions of libguestfs are available on
https://git.centos.org/project/rpms, and see also
https://wiki.centos.org/Sources.
.SH "BUILDING i686 32 BIT VIRT\-P2V"
.IX Header "BUILDING i686 32 BIT VIRT-P2V"
\&\fI(This section only applies on the x86\-64 architecture.)\fR
.PP
Building a 32 bit virt\-p2v (i686) binary improves compatibility with older
hardware. See \fBvirt\-p2v\-make\-disk\fR\|(1) for details. Although virt\-p2v is a
simple Gtk application, it is not especially easy to build just virt\-p2v as
a 32 bit application on a 64 bit host. Usually the simplest way is to use a
32 bit chroot or even a 32 bit virtual machine to build libguestfs.
.PP
On Fedora you can use the \fBmock\fR\|(1) tool. For example:
.PP
.Vb 1
\& fedpkg mockbuild \-\-root fedora\-23\-i386
.Ve
.PP
This will result in a \fIvirt\-v2v\-*.i686.rpm\fR file which can be unpacked to
extract the 32 bit virt\-p2v binary.
.PP
The binary may be compressed to either \fIp2v/virt\-p2v.i686.xz\fR, or
\&\fI\f(CI$libdir\fI/virt\-p2v/virt\-p2v.i686.xz\fR or
\&\fI\f(CI$VIRT_P2V_DATA_DIR\fI/virt\-p2v.i686.xz\fR as appropriate. This enables the
\&\fBvirt\-p2v\-make\-disk\fR\|(1) \fI\-\-arch\fR option.
.SH "関連項目"
.IX Header "関連項目"
\&\fBguestfs\fR\|(3), \fBguestfs\-examples\fR\|(3), \fBguestfs\-hacking\fR\|(1),
\&\fBguestfs\-internals\fR\|(1), \fBguestfs\-performance\fR\|(1),
\&\fBguestfs\-release\-notes\fR\|(1), \fBguestfs\-testing\fR\|(1),
\&\fBlibguestfs\-test\-tool\fR\|(1), \fBlibguestfs\-make\-fixed\-appliance\fR\|(1),
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) 2009\-2019 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.
|