virt-customize(1) Virtualization Support virt-customize(1) (NAME) virt-customize - (SYNOPSIS) 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] [--append-line FILE:LINE] [--chmod PERMISSIONS:FILE] [--chown UID:GID:PATH] [--commands-from-file FILENAME] [--copy SOURCE:DEST] [--copy-in LOCALPATH:REMOTEDIR] [--delete PATH] [--edit FILE:EXPR] [--firstboot SCRIPT] [--firstboot-command 'CMD+ARGS'] [--firstboot-install PKG,PKG..] [--hostname HOSTNAME] [--inject-blnsvr METHOD] [--inject-qemu-ga METHOD] [--inject-virtio-win METHOD] [--install PKG,PKG..] [--link TARGET:LINK[:LINK..]] [--mkdir DIR] [--move SOURCE:DEST] [--password USER:SELECTOR] [--root-password SELECTOR] [--run SCRIPT] [--run-command 'CMD+ARGS'] [--scrub FILE] [--ssh-inject USER[:SELECTOR]] [--tar-in TARFILE:REMOTEDIR] [--timezone TIMEZONE] [--touch FILE] [--truncate FILE] [--truncate-recursive PATH] [--uninstall PKG,PKG..] [--update] [--upload FILE:DEST] [--write FILE:CONTENT] [--no-logfile] [--password-crypto md5|sha256|sha512] [--no-selinux-relabel] [--selinux-relabel] virt-customize [ -V | --version ] (WARNING) "virt-customize" . . (DESCRIPTION) virt-customize ( ) . virt-customize (in place) . . . virt-customize (root) . . : virt-sysprep(1) virt-builder(1). (OPTIONS) --help . -a file --add file file . . --format . -a URI --add URI (remote). URI guestfish . "ADDING REMOTE STORAGE" guestfish(1) . --attach ISOFILE libguestfs (attach) . . () (label) ( ISO ) (mount) : mkdir /tmp/mount mount LABEL=EXTRA /tmp/mount --attach ( ISO). --attach-format FORMAT --attach. "FORMAT" "raw" "qcow2" . ISO "raw" . --colors --colours ANSI . tty . ANSI . -c URI --connect URI libvirt URI . libvirt . (-a) libvirt . -d guest --domain guest libvirt. UUID . -n --dry-run ("dry run") . sysprep . --echo-keys virt-customize (echoing) . (Tempest) . --format raw|qcow2|.. --format auto -a . -a . --format auto -a . : virt-customize --format raw -a disk.img (raw) disk.img . virt-customize --format raw -a disk.img --format auto -a another.img disk.img another.img . . (CVE-2010-3851). --key SELECTOR LUKS LUKS . --key NAME:key:KEY_STRING --key UUID:key:KEY_STRING --key all:key:KEY_STRING "NAME" libguestfs ( "/dev/sda1"). "UUID" . "all" . "KEY_STRING" . --key NAME:file:FILENAME --key UUID:file:FILENAME --key all:file:FILENAME FILENAME. --key NAME:clevis --key UUID:clevis --key all:clevis Clevis . (NBDE) "ENCRYPTED DISKS" guestfs(3) . QEMU libguestfs . --keys-from-stdin (stdin). /dev/tty . . -m MB --memsize MB --run. --run --install . : guestfish get-memsize --network --no-network . . --no-network . . "NETWORK" virt-rescue(1) . --no-network --install . virt-customize . --no-network . : 1. (backend) libguestfs . (: "BACKEND" guestfs(3)). 2. ISO . 3. virt-customize . . ( "" ). 4. ( /). -q --quiet . -x . --smp N N >= 2 (vCPU) --run. -v --verbose . -V --version . --wrap . tty . . -x (API) libguestfs. (Customization options) --append-line FILE:LINE "FILE". . "LINE" . ( ) : --append-line '/etc/hosts:10.0.0.1 foo' "10.0.0.1 foo" "10.0.0.1 foo" . "" . . : --append-line '/etc/hosts:10.0.0.1 foo' --append-line '/etc/hosts:10.0.0.2 bar' : --append-line '/etc/hosts:' --append-line '/etc/hosts:10.0.0.1 foo' --chmod PERMISSIONS:FILE "FILE" "PERMISSIONS". : "PERMISSIONS" 0 (octal) 0700 700. --chown UID:GID:PATH (UID) (GID) . : o UID GID . o . : virt-customize --chown '0:0:/var/log/audit.log' : --upload. --commands-from-file FILENAME ( ) . : delete /some/file install some-package password some-user:password:its-new-password "#" . "\" ( ) : edit /some/file:\ s/^OPT=.*/OPT=ok/ --delete /some/file . --copy SOURCE:DEST . (wildcards) . --copy-in LOCALPATH:REMOTEDIR "REMOTEDIR" ( ). . --delete PATH ( ). (glob) . . : virt-customize --delete '/var/log/*.log'. : --upload --scrub. --edit FILE:EXPR "FILE" "EXPR". . Perl 5 . "NON-INTERACTIVE EDITING" virt-edit(1) . --firstboot SCRIPT "SCRIPT" ( root ) . chmod +x . --firstboot-command . --firstboot . . : " (FIRSTBOOT)" --run. --firstboot-command 'CMD+ARGS' ( ) ( root ). --firstboot . . : " (FIRSTBOOT)" --run. --firstboot-install PKG,PKG.. ( ). ( apt yum ) . "INSTALLING PACKAGES" virt-builder(1) . --hostname HOSTNAME (hostname) "HOSTNAME". (FQDN) hostname.domainname . --inject-blnsvr METHOD (blnsvr.exe) . . --inject-virtio-win . VMware ( ) virt-v2v(1) . --inject-qemu-ga METHOD QEMU (QEMU Guest Agent) . qemu (: qemu-ga(8)). Guest Agent . --inject-virtio-win . VMware ( ) virt-v2v(1) . --inject-virtio-win METHOD virtio-win . virtio virtio ( qemu/KVM) . . : ISO ISO virtio-win ( /usr/share/virtio-win/virtio-win.iso). DIR virtio-win ( /usr/share/virtio-win). VMware ( ) virt-v2v(1) . --install PKG,PKG.. ( ). ( apt yum ) . "INSTALLING PACKAGES" virt-builder(1) . : --update --uninstall. --link TARGET:LINK[:LINK..] () "LINK" "TARGET" . --mkdir DIR . "mkdir -p" . --move SOURCE:DEST . . --no-logfile "builder.log" ( ) . . : " (Log file)". --no-selinux-relabel SELinux . SELinux SELinux . ( /.autorelabel .) . SELinux . --password USER:SELECTOR "USER". ( ). "USERS AND PASSWORDS" virt-builder(1) "SELECTOR" . --password-crypto md5|sha256|sha512 virt "md5" "sha256" "sha512" . "sha256" "sha512" glibc >= 2.7 ( crypt(3) ). "md5" ( RHEL 3) . "sha512" libguestfs SHA-512 "md5" . libguestfs . . --edit "/etc/sysconfig/authconfig" ( Fedora RHEL) "/etc/pam.d/common-password" ( Debian Ubuntu) . --root-password SELECTOR (root). "USERS AND PASSWORDS" virt-builder(1) "SELECTOR" . : virt-builder --root-password . --run SCRIPT ( ) "SCRIPT" . chroot . chmod +x . libguestfs . ( ISO) ( ) (--attach). (--upload). --run . . : --firstboot --attach --upload. --run-command 'CMD+ARGS' . chroot . libguestfs . ( ISO) ( ) (--attach). (--upload). --run-command . . : --firstboot --attach --upload. --scrub FILE . --delete : o . o . --selinux-relabel . --ssh-inject USER[:SELECTOR] SSH "USER" ssh . "USER" . "SSH KEYS" virt-builder(1) "SELECTOR" . --ssh-inject . --tar-in TARFILE:REMOTEDIR tar "TARFILE" "REMOTEDIR" ( ). tar ( .tar.gz ). --timezone TIMEZONE "TIMEZONE". "Asia/Tehran" "Europe/London" . --touch FILE touch(1) "FILE" . --truncate FILE "FILE" ( ). . --truncate-recursive PATH "PATH" . --uninstall PKG,PKG.. ( ). ( apt yum ) . . : --install --update. --update "yum update" "apt-get upgrade" . : --install --uninstall. --upload FILE:DEST "FILE" "DEST" . . "DEST" . . "DEST" ( ) . : --mkdir --delete --scrub. --write FILE:CONTENT "CONTENT" "FILE". (FIRSTBOOT) --firstboot --firstboot-command . init init . (Log file) ~root/virt-sysprep-firstboot.log . C:\Program Files\Guestfs\Firstboot\log.txt . (Windows firstboot batch file exit codes) : o 249 . . ( .) o 250 . . o . . (Windows sentinel file) (sentinel file) . ( virt-v2v(1)) . : C:\Program Files\Guestfs\Firstboot\complete (Auxiliary tools) rhsrvany.exe https://github.com/rwmjones/rhsrvany pvvxsvc.exe SUSE VMDP . . rhsrvany.exe pvvxsvc.exe "VIRT_TOOLS_DATA_DIR" ( /usr/share/virt-tools) . --firstboot --script --firstboot --script . . --firstboot script "script" . --script . "yum install" --script () "yum" () ( ) . --firstboot . ( ) --script () () . . (SELINUX) SELinux . "SELINUX" virt-builder(1) . (DEPRECATED OPTIONS) 1.56 subscription-manager : --sm-credentials --sm-register --sm-unregister --sm-attach --sm-remove "DEPRECATED OPTIONS" virt-builder(1) . (EXIT STATUS) 0 1 . (ENVIRONMENT VARIABLES) "VIRT_TOOLS_DATA_DIR" . . ( /usr/share/virt-tools) . : rhsrvany.exe RHSrvAny "firstboot" . --firstboot --firstboot-command . : "https://github.com/rwmjones/rhsrvany" pvvxsvc.exe SUSE VMDP "firstboot" . --firstboot --firstboot-command . "ENVIRONMENT VARIABLES" guestfs(3) . (SEE ALSO) guestfs(3), guestfish(1), virt-builder(1), virt-clone(1), virt-rescue(1), virt-resize(1), virt-sparsify(1), virt-sysprep(1), virsh(1), lvcreate(8), qemu-img(1), scrub(1), http://libguestfs.org, http://libvirt.org. (AUTHORS) Richard W.M. Jones http://people.redhat.com/~rjones (COPYRIGHT) Copyright (C) 2011-2025 Red Hat Inc. (LICENSE) << >> (GNU General Public License) / 2 ( ) . . << >> . : Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. (BUGS) libguestfs : https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools libguestfs : https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools : o libguestfs. o libguestfs ( ). o . o libguestfs-test-tool(1) . guestfs-tools-1.56.0 2026-07-11 virt-customize(1)