.\" 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 "virt-customize 1" .TH virt-customize 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 "名前" virt-customize \- Customize a virtual machine .SH "書式" .IX Header "書式" .Vb 7 \& virt\-customize \& [ \-a disk.img [ \-a disk.img ... ] | \-d domname ] \& [\-\-attach ISOFILE] [\-\-attach\-format FORMAT] \& [ \-c URI | \-\-connect URI ] [ \-n | \-\-dry\-run ] \& [ \-\-format FORMAT] [ \-m MB | \-\-memsize MB ] \& [ \-\-network | \-\-no\-network ] \& [ \-q | \-\-quiet ] [\-\-smp N] [ \-v | \-\-verbose ] [\-x] \& \& \& \& virt\-customize [ \-V | \-\-version ] .Ve .SH "説明" .IX Header "説明" Virt-customize can customize a virtual machine (disk image) by installing packages, editing configuration files, and so on. .PP Virt-customize modifies the guest or disk image \fIin place\fR. The guest must be shut down. If you want to preserve the existing contents of the guest, \&\fIyou must snapshot, copy or clone the disk first\fR. .PP You do \fInot\fR need to run virt-customize as root. In fact we'd generally recommend that you don't. .PP Related tools include: \fBvirt\-sysprep\fR\|(1) and \fBvirt\-builder\fR\|(1). .SH "オプション" .IX Header "オプション" .IP "\fB\-\-help\fR" 4 .IX Item "--help" 簡単なヘルプを表示します。 .IP "\fB\-a\fR file" 4 .IX Item "-a file" .PD 0 .IP "\fB\-\-add\fR file" 4 .IX Item "--add file" .PD 仮想マシンからディスクイメージの \fIfile\fR を追加します。 .Sp ディスクイメージの形式は自動的に検出されます。強制的に特定の形式を使用するには \fI\-\-format\fR オプションを使用します。 .IP "\fB\-a\fR \s-1URI\s0" 4 .IX Item "-a URI" .PD 0 .IP "\fB\-\-add\fR \s-1URI\s0" 4 .IX Item "--add URI" .PD Add a remote disk. The \s-1URI\s0 format is compatible with guestfish. See \&\*(L"\s-1ADDING REMOTE STORAGE\*(R"\s0 in \fBguestfish\fR\|(1). .IP "\fB\-\-attach\fR \s-1ISOFILE\s0" 4 .IX Item "--attach ISOFILE" The given disk is attached to the libguestfs appliance. This is used to provide extra software repositories or other data for customization. .Sp You probably want to ensure the volume(s) or filesystems in the attached disks are labelled (or use an \s-1ISO\s0 volume name) so that you can mount them by label in your run-scripts: .Sp .Vb 2 \& mkdir /tmp/mount \& mount LABEL=EXTRA /tmp/mount .Ve .Sp You can have multiple \fI\-\-attach\fR options, and the format can be any disk format (not just an \s-1ISO\s0). .IP "\fB\-\-attach\-format\fR \s-1FORMAT\s0" 4 .IX Item "--attach-format FORMAT" Specify the disk format for the next \fI\-\-attach\fR option. The \f(CW\*(C`FORMAT\*(C'\fR is usually \f(CW\*(C`raw\*(C'\fR or \f(CW\*(C`qcow2\*(C'\fR. Use \f(CW\*(C`raw\*(C'\fR for ISOs. .IP "\fB\-\-colors\fR" 4 .IX Item "--colors" .PD 0 .IP "\fB\-\-colours\fR" 4 .IX Item "--colours" .PD Use \s-1ANSI\s0 colour sequences to colourize messages. This is the default when the output is a tty. If the output of the program is redirected to a file, \&\s-1ANSI\s0 colour sequences are disabled unless you use this option. .IP "\fB\-c\fR \s-1URI\s0" 4 .IX Item "-c URI" .PD 0 .IP "\fB\-\-connect\fR \s-1URI\s0" 4 .IX Item "--connect URI" .PD libvirt を使用していると、指定された \fI\s-1URI\s0\fR に接続します。 省略すると、デフォルトの libvirt ハイパーバイザーに接続します。 .Sp ゲストのブロックデバイスを直接指定していると((\fI\-a\fR))、libvirt は何も使用されません。 .IP "\fB\-d\fR guest" 4 .IX Item "-d guest" .PD 0 .IP "\fB\-\-domain\fR guest" 4 .IX Item "--domain guest" .PD 名前付きの libvirt 仮想マシンからすべてのディスクを追加します。 名前の代わりに仮想マシンの \s-1UUID\s0 を使用できます。 .IP "\fB\-n\fR" 4 .IX Item "-n" .PD 0 .IP "\fB\-\-dry\-run\fR" 4 .IX Item "--dry-run" .PD Perform a read-only \*(L"dry run\*(R" on the guest. This runs the sysprep operation, but throws away any changes to the disk at the end. .IP "\fB\-\-echo\-keys\fR" 4 .IX Item "--echo-keys" When prompting for keys and passphrases, virt-customize normally turns echoing off so you cannot see what you are typing. If you are not worried about Tempest attacks and there is no one else in the room you can specify this flag to see what you are typing. .IP "\fB\-\-format\fR raw|qcow2|.." 4 .IX Item "--format raw|qcow2|.." .PD 0 .IP "\fB\-\-format\fR auto" 4 .IX Item "--format auto" .PD The default for the \fI\-a\fR option is to auto-detect the format of the disk image. Using this forces the disk format for \fI\-a\fR options which follow on the command line. Using \fI\-\-format auto\fR switches back to auto-detection for subsequent \fI\-a\fR options. .Sp 例: .Sp .Vb 1 \& virt\-customize \-\-format raw \-a disk.img .Ve .Sp forces raw format (no auto-detection) for \fIdisk.img\fR. .Sp .Vb 1 \& virt\-customize \-\-format raw \-a disk.img \-\-format auto \-a another.img .Ve .Sp forces raw format (no auto-detection) for \fIdisk.img\fR and reverts to auto-detection for \fIanother.img\fR. .Sp 仮想マシンのディスクイメージが信頼できない raw 形式である場合、 ディスク形式を指定するためにこのオプションを使用すべきです。 これにより、悪意のある仮想マシンにより起こり得る セキュリティ問題を回避できます (\s-1CVE\-2010\-3851\s0)。 .IP "\fB\-\-key\fR \s-1SELECTOR\s0" 4 .IX Item "--key SELECTOR" Specify a key for \s-1LUKS,\s0 to automatically open a \s-1LUKS\s0 device when using the inspection. \f(CW\*(C`SELECTOR\*(C'\fR can be in one of the following formats: .RS 4 .ie n .IP "\fB\-\-key\fR ""DEVICE"":key:KEY_STRING" 4 .el .IP "\fB\-\-key\fR \f(CWDEVICE\fR:key:KEY_STRING" 4 .IX Item "--key DEVICE:key:KEY_STRING" Use the specified \f(CW\*(C`KEY_STRING\*(C'\fR as passphrase. .ie n .IP "\fB\-\-key\fR ""DEVICE"":file:FILENAME" 4 .el .IP "\fB\-\-key\fR \f(CWDEVICE\fR:file:FILENAME" 4 .IX Item "--key DEVICE:file:FILENAME" Read the passphrase from \fI\s-1FILENAME\s0\fR. .RE .RS 4 .RE .IP "\fB\-\-keys\-from\-stdin\fR" 4 .IX Item "--keys-from-stdin" Read key or passphrase parameters from stdin. The default is to try to read passphrases from the user by opening \fI/dev/tty\fR. .IP "\fB\-m\fR \s-1MB\s0" 4 .IX Item "-m MB" .PD 0 .IP "\fB\-\-memsize\fR \s-1MB\s0" 4 .IX Item "--memsize MB" .PD Change the amount of memory allocated to \fI\-\-run\fR scripts. Increase this if you find that \fI\-\-run\fR scripts or the \fI\-\-install\fR option are running out of memory. .Sp The default can be found with this command: .Sp .Vb 1 \& guestfish get\-memsize .Ve .IP "\fB\-\-network\fR" 4 .IX Item "--network" .PD 0 .IP "\fB\-\-no\-network\fR" 4 .IX Item "--no-network" .PD Enable or disable network access from the guest during the installation. .Sp Enabled is the default. Use \fI\-\-no\-network\fR to disable access. .Sp The network only allows outgoing connections and has other minor limitations. See \*(L"\s-1NETWORK\*(R"\s0 in \fBvirt\-rescue\fR\|(1). .Sp If you use \fI\-\-no\-network\fR then certain other options such as \fI\-\-install\fR will not work. .Sp This does not affect whether the guest can access the network once it has been booted, because that is controlled by your hypervisor or cloud environment and has nothing to do with virt-customize. .Sp Generally speaking you should \fInot\fR use \fI\-\-no\-network\fR. But here are some reasons why you might want to: .RS 4 .IP "1." 4 Because the libguestfs backend that you are using doesn't support the network. (See: \*(L"\s-1BACKEND\*(R"\s0 in \fBguestfs\fR\|(3)). .IP "2." 4 Any software you need to install comes from an attached \s-1ISO,\s0 so you don't need the network. .IP "3." 4 You don’t want untrusted guest code trying to access your host network when running virt-customize. This is particularly an issue when you don't trust the source of the operating system templates. (See \*(L"\s-1SECURITY\*(R"\s0 below). .IP "4." 4 You don’t have a host network (eg. in secure/restricted environments). .RE .RS 4 .RE .IP "\fB\-q\fR" 4 .IX Item "-q" .PD 0 .IP "\fB\-\-quiet\fR" 4 .IX Item "--quiet" .PD Don’t print log messages. .Sp To enable detailed logging of individual file operations, use \fI\-x\fR. .IP "\fB\-\-smp\fR N" 4 .IX Item "--smp N" Enable N ≥ 2 virtual CPUs for \fI\-\-run\fR scripts to use. .IP "\fB\-v\fR" 4 .IX Item "-v" .PD 0 .IP "\fB\-\-verbose\fR" 4 .IX Item "--verbose" .PD デバッグ用の冗長なメッセージを有効にします。 .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 .IP "\fB\-\-version\fR" 4 .IX Item "--version" .PD バージョン番号を表示して、終了します。 .IP "\fB\-x\fR" 4 .IX Item "-x" libguestfs \s-1API\s0 呼び出しのトレースを有効にします。 .SS "Customization options" .IX Subsection "Customization options" .IP "\fB\-\-append\-line\fR \s-1FILE:LINE\s0" 4 .IX Item "--append-line FILE:LINE" Append a single line of text to the \f(CW\*(C`FILE\*(C'\fR. If the file does not already end with a newline, then one is added before the appended line. Also a newline is added to the end of the \f(CW\*(C`LINE\*(C'\fR string automatically. .Sp For example (assuming ordinary shell quoting) this command: .Sp .Vb 1 \& \-\-append\-line \*(Aq/etc/hosts:10.0.0.1 foo\*(Aq .Ve .Sp will add either \f(CW\*(C`10.0.0.1 foo⏎\*(C'\fR or \f(CW\*(C`⏎10.0.0.1 foo⏎\*(C'\fR to the file, the latter only if the existing file does not already end with a newline. .Sp \&\f(CW\*(C`⏎\*(C'\fR represents a newline character, which is guessed by looking at the existing content of the file, so this command does the right thing for files using Unix or Windows line endings. It also works for empty or non-existent files. .Sp To insert several lines, use the same option several times: .Sp .Vb 2 \& \-\-append\-line \*(Aq/etc/hosts:10.0.0.1 foo\*(Aq \& \-\-append\-line \*(Aq/etc/hosts:10.0.0.2 bar\*(Aq .Ve .Sp To insert a blank line before the appended line, do: .Sp .Vb 2 \& \-\-append\-line \*(Aq/etc/hosts:\*(Aq \& \-\-append\-line \*(Aq/etc/hosts:10.0.0.1 foo\*(Aq .Ve .IP "\fB\-\-chmod\fR \s-1PERMISSIONS:FILE\s0" 4 .IX Item "--chmod PERMISSIONS:FILE" Change the permissions of \f(CW\*(C`FILE\*(C'\fR to \f(CW\*(C`PERMISSIONS\*(C'\fR. .Sp \&\fINote\fR: \f(CW\*(C`PERMISSIONS\*(C'\fR by default would be decimal, unless you prefix it with \f(CW0\fR to get octal, ie. use \f(CW0700\fR not \f(CW700\fR. .IP "\fB\-\-commands\-from\-file\fR \s-1FILENAME\s0" 4 .IX Item "--commands-from-file FILENAME" Read the customize commands from a file, one (and its arguments) each line. .Sp Each line contains a single customization command and its arguments, for example: .Sp .Vb 3 \& delete /some/file \& install some\-package \& password some\-user:password:its\-new\-password .Ve .Sp Empty lines are ignored, and lines starting with \f(CW\*(C`#\*(C'\fR are comments and are ignored as well. Furthermore, arguments can be spread across multiple lines, by adding a \f(CW\*(C`\e\*(C'\fR (continuation character) at the of a line, for example .Sp .Vb 2 \& edit /some/file:\e \& s/^OPT=.*/OPT=ok/ .Ve .Sp The commands are handled in the same order as they are in the file, as if they were specified as \fI\-\-delete /some/file\fR on the command line. .IP "\fB\-\-copy\fR \s-1SOURCE:DEST\s0" 4 .IX Item "--copy SOURCE:DEST" Copy files or directories recursively inside the guest. .Sp Wildcards cannot be used. .IP "\fB\-\-copy\-in\fR \s-1LOCALPATH:REMOTEDIR\s0" 4 .IX Item "--copy-in LOCALPATH:REMOTEDIR" Copy local files or directories recursively into the disk image, placing them in the directory \f(CW\*(C`REMOTEDIR\*(C'\fR (which must exist). .Sp Wildcards cannot be used. .IP "\fB\-\-delete\fR \s-1PATH\s0" 4 .IX Item "--delete PATH" Delete a file from the guest. Or delete a directory (and all its contents, recursively). .Sp You can use shell glob characters in the specified path. Be careful to escape glob characters from the host shell, if that is required. For example: .Sp .Vb 1 \& virt\-customize \-\-delete \*(Aq/var/log/*.log\*(Aq. .Ve .Sp See also: \fI\-\-upload\fR, \fI\-\-scrub\fR. .IP "\fB\-\-edit\fR \s-1FILE:EXPR\s0" 4 .IX Item "--edit FILE:EXPR" Edit \f(CW\*(C`FILE\*(C'\fR using the Perl expression \f(CW\*(C`EXPR\*(C'\fR. .Sp 表現がシェルにより変更されるのを防ぐために、適切に引用符でくくるよう注意してください。 .Sp このオプションは Perl 5 がインストールされているときのみ利用可能であることに注意してください。 .Sp See \*(L"NON-INTERACTIVE \s-1EDITING\*(R"\s0 in \fBvirt\-edit\fR\|(1). .IP "\fB\-\-firstboot\fR \s-1SCRIPT\s0" 4 .IX Item "--firstboot SCRIPT" Install \f(CW\*(C`SCRIPT\*(C'\fR inside the guest, so that when the guest first boots up, the script runs (as root, late in the boot process). .Sp The script is automatically chmod +x after installation in the guest. .Sp The alternative version \fI\-\-firstboot\-command\fR is the same, but it conveniently wraps the command up in a single line script for you. .Sp You can have multiple \fI\-\-firstboot\fR options. They run in the same order that they appear on the command line. .Sp Please take a look at \*(L"\s-1FIRST BOOT SCRIPTS\*(R"\s0 in \fBvirt\-builder\fR\|(1) for more information and caveats about the first boot scripts. .Sp See also \fI\-\-run\fR. .IP "\fB\-\-firstboot\-command\fR '\s-1CMD+ARGS\s0'" 4 .IX Item "--firstboot-command 'CMD+ARGS'" Run command (and arguments) inside the guest when the guest first boots up (as root, late in the boot process). .Sp You can have multiple \fI\-\-firstboot\fR options. They run in the same order that they appear on the command line. .Sp Please take a look at \*(L"\s-1FIRST BOOT SCRIPTS\*(R"\s0 in \fBvirt\-builder\fR\|(1) for more information and caveats about the first boot scripts. .Sp See also \fI\-\-run\fR. .IP "\fB\-\-firstboot\-install\fR \s-1PKG,PKG..\s0" 4 .IX Item "--firstboot-install PKG,PKG.." Install the named packages (a comma-separated list). These are installed when the guest first boots using the guest’s package manager (eg. apt, yum, etc.) and the guest’s network connection. .Sp For an overview on the different ways to install packages, see \&\*(L"\s-1INSTALLING PACKAGES\*(R"\s0 in \fBvirt\-builder\fR\|(1). .IP "\fB\-\-hostname\fR \s-1HOSTNAME\s0" 4 .IX Item "--hostname HOSTNAME" Set the hostname of the guest to \f(CW\*(C`HOSTNAME\*(C'\fR. You can use a dotted hostname.domainname (\s-1FQDN\s0) if you want. .IP "\fB\-\-install\fR \s-1PKG,PKG..\s0" 4 .IX Item "--install PKG,PKG.." Install the named packages (a comma-separated list). These are installed during the image build using the guest’s package manager (eg. apt, yum, etc.) and the host’s network connection. .Sp For an overview on the different ways to install packages, see \&\*(L"\s-1INSTALLING PACKAGES\*(R"\s0 in \fBvirt\-builder\fR\|(1). .Sp See also \fI\-\-update\fR, \fI\-\-uninstall\fR. .IP "\fB\-\-link\fR TARGET:LINK[:LINK..]" 4 .IX Item "--link TARGET:LINK[:LINK..]" Create symbolic link(s) in the guest, starting at \f(CW\*(C`LINK\*(C'\fR and pointing at \&\f(CW\*(C`TARGET\*(C'\fR. .IP "\fB\-\-mkdir\fR \s-1DIR\s0" 4 .IX Item "--mkdir DIR" Create a directory in the guest. .Sp This uses \f(CW\*(C`mkdir \-p\*(C'\fR so any intermediate directories are created, and it also works if the directory already exists. .IP "\fB\-\-move\fR \s-1SOURCE:DEST\s0" 4 .IX Item "--move SOURCE:DEST" Move files or directories inside the guest. .Sp Wildcards cannot be used. .IP "\fB\-\-no\-logfile\fR" 4 .IX Item "--no-logfile" Scrub \f(CW\*(C`builder.log\*(C'\fR (log file from build commands) from the image after building is complete. If you don't want to reveal precisely how the image was built, use this option. .Sp See also: \*(L"\s-1LOG FILE\*(R"\s0. .IP "\fB\-\-password\fR \s-1USER:SELECTOR\s0" 4 .IX Item "--password USER:SELECTOR" Set the password for \f(CW\*(C`USER\*(C'\fR. (Note this option does \fInot\fR create the user account). .Sp See \*(L"\s-1USERS AND PASSWORDS\*(R"\s0 in \fBvirt\-builder\fR\|(1) for the format of the \f(CW\*(C`SELECTOR\*(C'\fR field, and also how to set up user accounts. .IP "\fB\-\-password\-crypto\fR md5|sha256|sha512" 4 .IX Item "--password-crypto md5|sha256|sha512" When the virt tools change or set a password in the guest, this option sets the password encryption of that password to \f(CW\*(C`md5\*(C'\fR, \f(CW\*(C`sha256\*(C'\fR or \f(CW\*(C`sha512\*(C'\fR. .Sp \&\f(CW\*(C`sha256\*(C'\fR and \f(CW\*(C`sha512\*(C'\fR require glibc ≥ 2.7 (check \fBcrypt\fR\|(3) inside the guest). .Sp \&\f(CW\*(C`md5\*(C'\fR will work with relatively old Linux guests (eg. \s-1RHEL 3\s0), but is not secure against modern attacks. .Sp The default is \f(CW\*(C`sha512\*(C'\fR unless libguestfs detects an old guest that didn't have support for \s-1SHA\-512,\s0 in which case it will use \f(CW\*(C`md5\*(C'\fR. You can override libguestfs by specifying this option. .Sp Note this does not change the default password encryption used by the guest when you create new user accounts inside the guest. If you want to do that, then you should use the \fI\-\-edit\fR option to modify \&\f(CW\*(C`/etc/sysconfig/authconfig\*(C'\fR (Fedora, \s-1RHEL\s0) or \f(CW\*(C`/etc/pam.d/common\-password\*(C'\fR (Debian, Ubuntu). .IP "\fB\-\-root\-password\fR \s-1SELECTOR\s0" 4 .IX Item "--root-password SELECTOR" Set the root password. .Sp See \*(L"\s-1USERS AND PASSWORDS\*(R"\s0 in \fBvirt\-builder\fR\|(1) for the format of the \f(CW\*(C`SELECTOR\*(C'\fR field, and also how to set up user accounts. .Sp Note: In virt-builder, if you \fIdon't\fR set \fI\-\-root\-password\fR then the guest is given a \fIrandom\fR root password. .IP "\fB\-\-run\fR \s-1SCRIPT\s0" 4 .IX Item "--run SCRIPT" Run the shell script (or any program) called \f(CW\*(C`SCRIPT\*(C'\fR on the disk image. The script runs virtualized inside a small appliance, chrooted into the guest filesystem. .Sp The script is automatically chmod +x. .Sp If libguestfs supports it then a limited network connection is available but it only allows outgoing network connections. You can also attach data disks (eg. \s-1ISO\s0 files) as another way to provide data (eg. software packages) to the script without needing a network connection (\fI\-\-attach\fR). You can also upload data files (\fI\-\-upload\fR). .Sp You can have multiple \fI\-\-run\fR options. They run in the same order that they appear on the command line. .Sp See also: \fI\-\-firstboot\fR, \fI\-\-attach\fR, \fI\-\-upload\fR. .IP "\fB\-\-run\-command\fR '\s-1CMD+ARGS\s0'" 4 .IX Item "--run-command 'CMD+ARGS'" Run the command and arguments on the disk image. The command runs virtualized inside a small appliance, chrooted into the guest filesystem. .Sp If libguestfs supports it then a limited network connection is available but it only allows outgoing network connections. You can also attach data disks (eg. \s-1ISO\s0 files) as another way to provide data (eg. software packages) to the script without needing a network connection (\fI\-\-attach\fR). You can also upload data files (\fI\-\-upload\fR). .Sp You can have multiple \fI\-\-run\-command\fR options. They run in the same order that they appear on the command line. .Sp See also: \fI\-\-firstboot\fR, \fI\-\-attach\fR, \fI\-\-upload\fR. .IP "\fB\-\-scrub\fR \s-1FILE\s0" 4 .IX Item "--scrub FILE" Scrub a file from the guest. This is like \fI\-\-delete\fR except that: .RS 4 .IP "\(bu" 4 It scrubs the data so a guest could not recover it. .IP "\(bu" 4 It cannot delete directories, only regular files. .RE .RS 4 .RE .IP "\fB\-\-selinux\-relabel\fR" 4 .IX Item "--selinux-relabel" Relabel files in the guest so that they have the correct SELinux label. .Sp This will attempt to relabel files immediately, but if the operation fails this will instead touch \fI/.autorelabel\fR on the image to schedule a relabel operation for the next time the image boots. .Sp You should only use this option for guests which support SELinux. .IP "\fB\-\-sm\-attach\fR \s-1SELECTOR\s0" 4 .IX Item "--sm-attach SELECTOR" Attach to a pool using \f(CW\*(C`subscription\-manager\*(C'\fR. .Sp See \*(L"SUBSCRIPTION-MANAGER\*(R" in \fBvirt\-builder\fR\|(1) for the format of the \&\f(CW\*(C`SELECTOR\*(C'\fR field. .IP "\fB\-\-sm\-credentials\fR \s-1SELECTOR\s0" 4 .IX Item "--sm-credentials SELECTOR" Set the credentials for \f(CW\*(C`subscription\-manager\*(C'\fR. .Sp See \*(L"SUBSCRIPTION-MANAGER\*(R" in \fBvirt\-builder\fR\|(1) for the format of the \&\f(CW\*(C`SELECTOR\*(C'\fR field. .IP "\fB\-\-sm\-register\fR" 4 .IX Item "--sm-register" Register the guest using \f(CW\*(C`subscription\-manager\*(C'\fR. .Sp This requires credentials being set using \fI\-\-sm\-credentials\fR. .IP "\fB\-\-sm\-remove\fR" 4 .IX Item "--sm-remove" Remove all the subscriptions from the guest using \f(CW\*(C`subscription\-manager\*(C'\fR. .IP "\fB\-\-sm\-unregister\fR" 4 .IX Item "--sm-unregister" Unregister the guest using \f(CW\*(C`subscription\-manager\*(C'\fR. .IP "\fB\-\-ssh\-inject\fR USER[:SELECTOR]" 4 .IX Item "--ssh-inject USER[:SELECTOR]" Inject an ssh key so the given \f(CW\*(C`USER\*(C'\fR will be able to log in over ssh without supplying a password. The \f(CW\*(C`USER\*(C'\fR must exist already in the guest. .Sp See \*(L"\s-1SSH KEYS\*(R"\s0 in \fBvirt\-builder\fR\|(1) for the format of the \f(CW\*(C`SELECTOR\*(C'\fR field. .Sp You can have multiple \fI\-\-ssh\-inject\fR options, for different users and also for more keys for each user. .IP "\fB\-\-timezone\fR \s-1TIMEZONE\s0" 4 .IX Item "--timezone TIMEZONE" Set the default timezone of the guest to \f(CW\*(C`TIMEZONE\*(C'\fR. Use a location string like \f(CW\*(C`Europe/London\*(C'\fR .IP "\fB\-\-touch\fR \s-1FILE\s0" 4 .IX Item "--touch FILE" This command performs a \fBtouch\fR\|(1)\-like operation on \f(CW\*(C`FILE\*(C'\fR. .IP "\fB\-\-truncate\fR \s-1FILE\s0" 4 .IX Item "--truncate FILE" This command truncates \f(CW\*(C`FILE\*(C'\fR to a zero-length file. The file must exist already. .IP "\fB\-\-truncate\-recursive\fR \s-1PATH\s0" 4 .IX Item "--truncate-recursive PATH" This command recursively truncates all files under \f(CW\*(C`PATH\*(C'\fR to zero-length. .IP "\fB\-\-uninstall\fR \s-1PKG,PKG..\s0" 4 .IX Item "--uninstall PKG,PKG.." Uninstall the named packages (a comma-separated list). These are removed during the image build using the guest’s package manager (eg. apt, yum, etc.). Dependent packages may also need to be uninstalled to satisfy the request. .Sp See also \fI\-\-install\fR, \fI\-\-update\fR. .IP "\fB\-\-update\fR" 4 .IX Item "--update" Do the equivalent of \f(CW\*(C`yum update\*(C'\fR, \f(CW\*(C`apt\-get upgrade\*(C'\fR, or whatever command is required to update the packages already installed in the template to their latest versions. .Sp See also \fI\-\-install\fR, \fI\-\-uninstall\fR. .IP "\fB\-\-upload\fR \s-1FILE:DEST\s0" 4 .IX Item "--upload FILE:DEST" Upload local file \f(CW\*(C`FILE\*(C'\fR to destination \f(CW\*(C`DEST\*(C'\fR in the disk image. File owner and permissions from the original are preserved, so you should set them to what you want them to be in the disk image. .Sp \&\f(CW\*(C`DEST\*(C'\fR could be the final filename. This can be used to rename the file on upload. .Sp If \f(CW\*(C`DEST\*(C'\fR is a directory name (which must already exist in the guest) then the file is uploaded into that directory, and it keeps the same name as on the local filesystem. .Sp See also: \fI\-\-mkdir\fR, \fI\-\-delete\fR, \fI\-\-scrub\fR. .IP "\fB\-\-write\fR \s-1FILE:CONTENT\s0" 4 .IX Item "--write FILE:CONTENT" Write \f(CW\*(C`CONTENT\*(C'\fR to \f(CW\*(C`FILE\*(C'\fR. .SH "SELinux" .IX Header "SELinux" For guests which make use of SELinux, special handling for them might be needed when using operations which create new files or alter existing ones. .PP For further details, see \*(L"\s-1SELINUX\*(R"\s0 in \fBvirt\-builder\fR\|(1). .SH "終了ステータス" .IX Header "終了ステータス" このプログラムは、成功すると 0 を返します。または、エラーが起きると 1 を返します。 .SH "環境変数" .IX Header "環境変数" .ie n .IP """VIRT_TOOLS_DATA_DIR""" 4 .el .IP "\f(CWVIRT_TOOLS_DATA_DIR\fR" 4 .IX Item "VIRT_TOOLS_DATA_DIR" This can point to the directory containing data files used for Windows firstboot installation. .Sp Normally you do not need to set this. If not set, a compiled-in default will be used (something like \fI/usr/share/virt\-tools\fR). .Sp This directory may contain the following files: .RS 4 .IP "\fIrhsrvany.exe\fR" 4 .IX Item "rhsrvany.exe" This is the RHSrvAny Windows binary, used to install a \*(L"firstboot\*(R" script in Windows guests. It is required if you intend to use the \fI\-\-firstboot\fR or \&\fI\-\-firstboot\-command\fR options with Windows guests. .Sp See also: \f(CW\*(C`https://github.com/rwmjones/rhsrvany\*(C'\fR .IP "\fIpvvxsvc.exe\fR" 4 .IX Item "pvvxsvc.exe" This is a Windows binary shipped with \s-1SUSE VMDP,\s0 used to install a \&\*(L"firstboot\*(R" script in Windows guests. It is required if you intend to use the \fI\-\-firstboot\fR or \fI\-\-firstboot\-command\fR options with Windows guests. .RE .RS 4 .RE .PP 他の環境変数は \*(L"環境変数\*(R" in \fBguestfs\fR\|(3) を参照してください。 .SH "関連項目" .IX Header "関連項目" \&\fBguestfs\fR\|(3), \fBguestfish\fR\|(1), \fBvirt\-builder\fR\|(1), \fBvirt\-clone\fR\|(1), \&\fBvirt\-rescue\fR\|(1), \fBvirt\-resize\fR\|(1), \fBvirt\-sparsify\fR\|(1), \&\fBvirt\-sysprep\fR\|(1), \fBvirsh\fR\|(1), \fBlvcreate\fR\|(8), \fBqemu\-img\fR\|(1), \&\fBscrub\fR\|(1), http://libguestfs.org/, http://libvirt.org/. .SH "著者" .IX Header "著者" Richard W.M. Jones http://people.redhat.com/~rjones/ .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2011\-2019 Red Hat Inc. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA 02110\-1301 USA.\s0 .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.