virt-sysprep(1) Virtualization Support virt-sysprep(1) (NAME) virt-sysprep - (SYNOPSIS) virt-sysprep [--colors] [--colours] [-c URI] [--connect URI] [-n] [--dry-run] [--enable OPERATIONS] [--operations OPERATIONS] [--echo-keys] [--format raw|qcow2] [--key SELECTOR] [--keys-from-stdin] [--mount-options] [-q] [--quiet] [--network] [--no-network] [-v] [--verbose] [--wrap] [-x] -d domname | -a disk.img [-a disk.img ...] virt-sysprep --list-operations virt-sysprep --version virt-sysprep -V (WARNING) "virt-sysprep" . . (DESCRIPTION) Virt-sysprep (Clone) (Template) . SSH MAC . Virt-sysprep SSH . . Virt-sysprep (in place) . . . virt-sysprep (root) . . root root virt-sysprep . "Sysprep" " " (system preparation) . sysprep.exe . ( Virt-sysprep .) (OPTIONS) --help . -a file --add file file . . --format . -a URI --add URI . URI guestfish . "ADDING REMOTE STORAGE" guestfish(1) . --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 . --enable operations sysprep . : --enable ssh-hostkeys,udev-persistent-net "ssh-hostkeys" "udev-persistent-net" . --enable sysprep ( --list-operations ). --enable sysprep . --list-operations virt-sysprep . " (OPERATIONS)" . --operation operations --operations operations sysprep . : --operations ssh-hostkeys,udev-persistent-net "ssh-hostkeys" "udev-persistent-net" . --operations ( --operations --enable ) "-" "defaults" "all" . : --operations firewall-rules,defaults,-tmp-files "firewall-rules" ( ) "tmp-files" . --operations --operations . --operations sysprep ( --list-operations ). --operations sysprep . virt-sysprep --list-operations . " (OPERATIONS)" . --echo-keys virt-sysprep . (Tempest) . --format raw|qcow2|.. --format auto -a . -a . --format auto -a . : virt-sysprep --format raw -a disk.img raw ( ) disk.img . virt-sysprep --format raw -a disk.img --format auto -a another.img raw ( ) disk.img another.img . (raw) . (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 . . --list-operations virt-sysprep. : $ virt-sysprep --list-operations bash-history * Remove the bash history in the guest cron-spool * Remove user at-jobs and cron-jobs dhcp-client-state * Remove DHCP client leases dhcp-server-state * Remove DHCP server leases [etc] --enable . "*" . . 1.17.33 libguestfs ( ) . --mount-options mp:opts[;mp:opts;...] libguestfs . . UFS (BSD) . "mountpoint:options" (semicolon) . (shell) . : --mount-options "/:noatime" "noatime" . : --mount-options "/:noatime;/var:rw,nodiratime" /var "rw,nodiratime" . -q --quiet . -x . --network --no-network . virt-sysprep . --network --install --update . virt-builder(1) . -v --verbose . -V --version . --wrap (Wrap) . tty . . -x (tracing) (API) libguestfs. --append-line FILE:LINE ( "customize" ) "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 ( "customize" ) "FILE" "PERMISSIONS". : "PERMISSIONS" () () 0 0700 700. --chown UID:GID:PATH ( "customize" ) (UID) (GID) . : o UID GID . o . : virt-customize --chown '0:0:/var/log/audit.log' : --upload. --commands-from-file FILENAME ( "customize" ) ( ). : delete /some/file install some-package password some-user:password:its-new-password "#" (comment) . "\" ( ) : edit /some/file:\ s/^OPT=.*/OPT=ok/ --delete /some/file . --copy SOURCE:DEST ( "customize" ) . (wildcards) . --copy-in LOCALPATH:REMOTEDIR ( "customize" ) "REMOTEDIR" ( ). . --delete PATH ( "customize" ) . ( ). (shell glob) . . : virt-customize --delete '/var/log/*.log'. : --upload --scrub. --edit FILE:EXPR ( "customize" ) "FILE" "EXPR". . Perl 5 . "NON-INTERACTIVE EDITING" virt-edit(1) . --firstboot SCRIPT ( "customize" ) "SCRIPT" ( root ) . chmod +x . --firstboot-command . --firstboot . . : "FIRSTBOOT" virt-customize(1) --run. --firstboot-command 'CMD+ARGS' ( "customize" ) ( ) ( root ). --firstboot . . : "FIRSTBOOT" virt-customize(1) --run. --firstboot-install PKG,PKG.. ( "customize" ) ( ). ( apt yum ) . "INSTALLING PACKAGES" virt-builder(1) . --hostname HOSTNAME ( "customize" ) (hostname) "HOSTNAME". (FQDN) . --inject-blnsvr METHOD ( "customize" ) (blnsvr.exe) . firstboot . --inject-virtio-win . VMware ( ) virt-v2v(1) . --inject-qemu-ga METHOD ( "customize" ) (QEMU Guest Agent) . qemu ( qemu-ga(8) ). firstboot . --inject-virtio-win . VMware virt-v2v(1) . --inject-virtio-win METHOD ( "customize" ) 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.. ( "customize" ) ( ). ( apt yum ) . "INSTALLING PACKAGES" virt-builder(1) . : --update --uninstall. --keep-user-accounts USERS ( "user-account" ) . . : --keep-user-accounts mary "mary" . . --link TARGET:LINK[:LINK..] ( "customize" ) () "LINK" "TARGET" . --mkdir DIR ( "customize" ) . "mkdir -p" . --move SOURCE:DEST ( "customize" ) . (wildcards) . --no-logfile ( "customize" ) (Scrub) "builder.log" ( ) . . : "LOG FILE". --no-selinux-relabel ( "customize" ) SELinux . SELinux SELinux . ( /.autorelabel (touch) .) . SELinux . --password USER:SELECTOR ( "customize" ) "USER". ( ). "SELECTOR" "USERS AND PASSWORDS" virt-builder(1) . --password-crypto md5|sha256|sha512 ( "customize" ) 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) . --remove-user-accounts USERS ( "user-account" ) . . : --remove-user-accounts bob,eve "bob" "eve" . . --root-password SELECTOR ( "customize" ) root. "SELECTOR" "USERS AND PASSWORDS" virt-builder(1) . : virt-builder --root-password . --run SCRIPT ( "customize" ) ( ) "SCRIPT" . (appliance) chroot . chmod +x . libguestfs . ( ISO) ( ) (--attach). (--upload). --run . . : --firstboot --attach --upload. --run-command 'CMD+ARGS' ( "customize" ) . chroot . libguestfs . ( ISO) (--attach). (--upload). --run-command . . : --firstboot --attach --upload. --script SCRIPT ( "script" ) "SCRIPT" . . . : $PATH . --scriptdir SCRIPTDIR ( "script" ) ( ) "script" () --script . : "SCRIPTDIR" . --scriptdir . --scrub FILE ( "customize" ) . --delete : o . o . --selinux-relabel ( "customize" ) . --ssh-inject USER[:SELECTOR] ( "customize" ) ssh "USER" ssh . "USER" . "SELECTOR" "SSH KEYS" virt-builder(1) . --ssh-inject . --tar-in TARFILE:REMOTEDIR ( "customize" ) tar "TARFILE" "REMOTEDIR" ( ). tar ( .tar.gz ). --timezone TIMEZONE ( "customize" ) "TIMEZONE". "Europe/London" "Asia/Tehran" . --touch FILE ( "customize" ) touch(1) "FILE" . --truncate FILE ( "customize" ) "FILE" ( ). . --truncate-recursive PATH ( "customize" ) "PATH" () . --uninstall PKG,PKG.. ( "customize" ) ( ). ( apt yum ) . . : --install --update. --update ( "customize" ) "yum update" "apt-get upgrade" . : --install --uninstall. --upload FILE:DEST ( "customize" ) "FILE" "DEST" . . "DEST" . . "DEST" ( ) . : --mkdir --delete --scrub. --write FILE:CONTENT ( "customize" ) "CONTENT" "FILE". (OPERATIONS) --enable/--operations sysprep . virt-sysprep "virt-sysprep --list-operations" . "*" . --enable/--operations sysprep . --enable/--operations . : virt-sysprep --operations ssh-hostkeys,udev-persistent-net [etc..] virt-sysprep . virt-sysprep . "*" = --enable/--operations . abrt-data * ABRT. ABRT "/var/spool/abrt/". backup-files * . : . *.bak . *~ : . /etc . /root . /srv . /tmp . /var bash-history * bash . bash "root" ".bash_history" . bash-history "/root" "/home/*" bash . blkid-tab * (tab) blkid . ca-certificates (CA) . CA . crash-data * kexec-tools. kdump. cron-spool * at cron . customize * . virt-customize(1) . dhcp-client-state * DHCP (). dhcp-server-state * DHCP (). dovecot-data * Dovecot ( ). firewall-rules (). "/etc/sysconfig/iptables" firewalld "/etc/firewalld/*/*" . . . flag-reconfiguration . "/.unconfigured" (touch) . fs-uuids UUID . UUID . fs-uuids fs-uuids UUID ( "/etc/fstab" ) . . : https://bugzilla.redhat.com/show_bug.cgi?id=991641 ipa-client * IPA. IPA ( - Identity, Policy, Audit). IPA (unenroll) . "ipa-client" . kerberos-data (Kerberos) . kerberos-hostkeytab * host keytab . logfiles * . : . /etc/Pegasus/*.cnf . /etc/Pegasus/*.crt . /etc/Pegasus/*.csr . /etc/Pegasus/*.pem . /etc/Pegasus/*.srl . /root/anaconda-ks.cfg . /root/anaconda-post.log . /root/initial-setup-ks.cfg . /root/install.log . /root/install.log.syslog . /root/original-ks.cfg . /var/cache/fontconfig/* . /var/cache/gdm/* . /var/cache/man/* . /var/lib/AccountService/users/* . /var/lib/fprint/* . /var/lib/logrotate.status . /var/log/*.log* . /var/log/BackupPC/LOG . /var/log/ConsoleKit/* . /var/log/anaconda.syslog . /var/log/anaconda/* . /var/log/apache2/*_log . /var/log/apache2/*_log-* . /var/log/apt/* . /var/log/aptitude* . /var/log/audit/* . /var/log/btmp* . /var/log/ceph/*.log . /var/log/chrony/*.log . /var/log/cron* . /var/log/cups/*_log* . /var/log/debug* . /var/log/dmesg* . /var/log/exim4/* . /var/log/faillog* . /var/log/firewalld* . /var/log/gdm/* . /var/log/glusterfs/*glusterd.vol.log . /var/log/glusterfs/glusterfs.log . /var/log/grubby* . /var/log/httpd/*log . /var/log/installer/* . /var/log/jetty/jetty-console.log . /var/log/journal/* . /var/log/lastlog* . /var/log/libvirt/libvirtd.log . /var/log/libvirt/libxl/*.log . /var/log/libvirt/lxc/*.log . /var/log/libvirt/qemu/*.log . /var/log/libvirt/uml/*.log . /var/log/lightdm/* . /var/log/mail/* . /var/log/maillog* . /var/log/messages* . /var/log/ntp . /var/log/ntpstats/* . /var/log/ppp/connect-errors . /var/log/rhsm/* . /var/log/sa/* . /var/log/secure* . /var/log/setroubleshoot/*.log . /var/log/spooler* . /var/log/squid/*.log . /var/log/syslog* . /var/log/tallylog* . /var/log/tuned/tuned.log . /var/log/wtmp* . /var/log/xferlog* . /var/named/data/named.run lvm-system-devices * system.devices LVM2. LVM2 (PV) WWID "/etc/lvm/devices/system.devices" . WWID "lvm pvscan" . "/etc/lvm/devices/system.devices" . lvm-uuids * UUID PV VG LVM2. (PV) (VG) LVM2 UUID PV VG . machine-id * (machine ID). . (stateless) . mail-spool * (mail spool). net-hostname * HOSTNAME DHCP_HOSTNAME . "ifcfg-*" . net-hwaddr * HWADDR ( /MAC ). "ifcfg-*" . net-nmconn * NetworkManager ( ). "/etc/NetworkManager/system-connections/*.nmconnection" . pacct-log * (process accounting). pacct . package-manager-cache * () . pam-data * PAM . passwd-backups * /etc/passwd- . : . /etc/group- . /etc/gshadow- . /etc/passwd- . /etc/shadow- . /etc/subgid- . /etc/subuid- puppet-data-log * Puppet. rh-subscription-manager * (RH Subscription Manager). rhn-systemid * RHN. rpm-db * RPM . RPM . RPM . samba-db-log * (Samba). script * . "script" . FUSE . "fuse" . --script . . : "rm etc/resolv.conf" DNS "rm /etc/resolv.conf" . --scriptdir . : --firstboot ( ) . --script . smolt-uuid * UUID Smolt. ssh-hostkeys * SSH . SSH ( ) . IP ssh : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! ssh-userdir * ".ssh" . ".ssh" "root" ".ssh" . ssh-userdir "/root" "/home/*" ssh . sssd-db-log * sssd. tmp-files * . "/tmp" "/var/tmp" . udev-persistent-net * udev. udev MAC ( eth0) . MAC . MAC ( eth0) MAC ( eth1) . udev . user-account . . "root" . --remove-user-accounts . utmp * utmp. . (ramdisk) . yum-uuid * UUID yum. Yum UUID UUID . zsh-history * zsh . zsh "root" ".zsh_history" . zsh-history "/root" "/home/*" zsh . (SECURITY) . (FAQ) LUKS . virt-sysprep . " (OPERATIONS)" . . (undelete) . --scrub . virt-sparsify(1) . scrub(1) inode . (Random seed) ( ) virt-sysprep . SSH TCP . customize : cp template.img newguest.img virt-sysprep --enable customize -a newguest.img (NOTES) SELinux SELinux . "SELINUX" virt-builder(1) . Windows >= 8 " " (fast startup) virt-sysprep . "WINDOWS HIBERNATION AND WINDOWS 8 FAST STARTUP" guestfs(3) . (EXIT STATUS) 0 1 . (ENVIRONMENT VARIABLES) "VIRT_TOOLS_DATA_DIR" (firstboot) . . ( /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-customize(1), virt-rescue(1), virt-resize(1), virt-sparsify(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 Wanlong Gao, Fujitsu Ltd. (COPYRIGHT) Copyright (C) 2011-2025 Red Hat Inc. Copyright (C) 2012 Fujitsu Ltd. (LICENSE) (GNU General Public License) ( ) / . . . : 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-sysprep(1)