Difference between revisions of "Virt-sysprep"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 32: Line 32:
  
  
<pre>
 
virt-sysprep --help
 
virt-sysprep: reset or unconfigure a virtual machine so clones can be made
 
  
  virt-sysprep [--options] -d domname
+
  virt-sysprep --help
 
+
virt-sysprep: reset or unconfigure a virtual machine so clones can be made
virt-sysprep [--options] -a disk.img [-a disk.img ...]
+
 
+
  virt-sysprep [--options] -d domname
A short summary of the options is given below.  For detailed help please
+
read the man page virt-sysprep(1).
+
  virt-sysprep [--options] -a disk.img [-a disk.img ...]
 
+
Options:
+
A short summary of the options is given below.  For detailed help please
  -a, --add <file>                    Add disk image file
+
read the man page virt-sysprep(1).
  --append-line <FILE:LINE>          Append line(s) to the file
+
  -c, --connect <uri>                Set libvirt URI
+
Options:
  --chmod <PERMISSIONS:FILE>          Change the permissions of a file
+
  -a, --add <file>                    Add disk image file
  --color, --colors, --colour, --colours
+
  --append-line <FILE:LINE>          Append line(s) to the file
                                      Use ANSI colour sequences even if not tty
+
  -c, --connect <uri>                Set libvirt URI
  --commands-from-file <FILENAME>    Read customize commands from file
+
  --chmod <PERMISSIONS:FILE>          Change the permissions of a file
  --copy <SOURCE:DEST>                Copy files in disk image
+
  --color, --colors, --colour, --colours
  --copy-in <LOCALPATH:REMOTEDIR>    Copy local files or directories into image
+
                                      Use ANSI colour sequences even if not tty
  -d, --domain <domain>              Set libvirt guest name
+
  --commands-from-file <FILENAME>    Read customize commands from file
  --delete <PATH>                    Delete a file or directory
+
  --copy <SOURCE:DEST>                Copy files in disk image
  -n, --dryrun, --dry-run            Perform a dry run
+
  --copy-in <LOCALPATH:REMOTEDIR>    Copy local files or directories into image
  --echo-keys                        Don’t turn off echo for passphrases
+
  -d, --domain <domain>              Set libvirt guest name
  --edit <FILE:EXPR>                  Edit file using Perl expression
+
  --delete <PATH>                    Delete a file or directory
  --enable <operations>              Enable specific operations
+
  -n, --dryrun, --dry-run            Perform a dry run
  --firstboot <SCRIPT>                Run script at first guest boot
+
  --echo-keys                        Don’t turn off echo for passphrases
  --firstboot-command <'CMD+ARGS'>    Run command at first guest boot
+
  --edit <FILE:EXPR>                  Edit file using Perl expression
  --firstboot-install <PKG,PKG..>    Add package(s) to install at first boot
+
  --enable <operations>              Enable specific operations
  --format <format>                  Set format (default: auto)
+
  --firstboot <SCRIPT>                Run script at first guest boot
  --help                              Display brief help
+
  --firstboot-command <'CMD+ARGS'>    Run command at first guest boot
  --hostname <HOSTNAME>              Set the hostname
+
  --firstboot-install <PKG,PKG..>    Add package(s) to install at first boot
  --install <PKG,PKG..>              Add package(s) to install
+
  --format <format>                  Set format (default: auto)
  --keep-user-accounts <users>        Users to keep
+
  --help                              Display brief help
  --key <SELECTOR>                    Specify a LUKS key
+
  --hostname <HOSTNAME>              Set the hostname
  --keys-from-stdin                  Read passphrases from stdin
+
  --install <PKG,PKG..>              Add package(s) to install
  --link <TARGET:LINK[:LINK..]>      Create symbolic links
+
  --keep-user-accounts <users>        Users to keep
  --list-operations                  List supported operations
+
  --key <SELECTOR>                    Specify a LUKS key
  --mkdir <DIR>                      Create a directory
+
  --keys-from-stdin                  Read passphrases from stdin
  --mount-options <opts>              Set mount options (eg /:noatime;/var:rw,noatime)
+
  --link <TARGET:LINK[:LINK..]>      Create symbolic links
  --move <SOURCE:DEST>                Move files in disk image
+
  --list-operations                  List supported operations
  --network                          Enable appliance network
+
  --mkdir <DIR>                      Create a directory
  --no-logfile                        Scrub build log file
+
  --mount-options <opts>              Set mount options (eg /:noatime;/var:rw,noatime)
  --no-network                        Disable appliance network (default)
+
  --move <SOURCE:DEST>                Move files in disk image
  --no-selinux-relabel                Compatibility option, does nothing
+
  --network                          Enable appliance network
  --operation, --operations <operations>
+
  --no-logfile                        Scrub build log file
                                      Enable/disable specific operations
+
  --no-network                        Disable appliance network (default)
  --password <USER:SELECTOR>          Set user password
+
  --no-selinux-relabel                Compatibility option, does nothing
  --password-crypto <md5|sha256|sha512>
+
  --operation, --operations <operations>
                                      Set password crypto
+
                                      Enable/disable specific operations
  -q, --quiet                        Don’t print progress messages
+
  --password <USER:SELECTOR>          Set user password
  --remove-user-accounts <users>      Users to remove
+
  --password-crypto <md5|sha256|sha512>
  --root-password <SELECTOR>          Set root password
+
                                      Set password crypto
  --run <SCRIPT>                      Run script in disk image
+
  -q, --quiet                        Don’t print progress messages
  --run-command <'CMD+ARGS'>          Run command in disk image
+
  --remove-user-accounts <users>      Users to remove
  --script <script>                  Script or program to run on guest
+
  --root-password <SELECTOR>          Set root password
  --scriptdir <dir>                  Mount point on host
+
  --run <SCRIPT>                      Run script in disk image
  --scrub <FILE>                      Scrub a file
+
  --run-command <'CMD+ARGS'>          Run command in disk image
  --selinux-relabel                  Relabel files with correct SELinux labels
+
  --script <script>                  Script or program to run on guest
  --sm-attach <SELECTOR>              Attach to a subscription-manager pool
+
  --scriptdir <dir>                  Mount point on host
  --sm-credentials <SELECTOR>        Credentials for subscription-manager
+
  --scrub <FILE>                      Scrub a file
  --sm-register                      Register using subscription-manager
+
  --selinux-relabel                  Relabel files with correct SELinux labels
  --sm-remove                        Remove all the subscriptions
+
  --sm-attach <SELECTOR>              Attach to a subscription-manager pool
  --sm-unregister                    Unregister using subscription-manager
+
  --sm-credentials <SELECTOR>        Credentials for subscription-manager
  --ssh-inject <USER[:SELECTOR]>      Inject a public key into the guest
+
  --sm-register                      Register using subscription-manager
  --timezone <TIMEZONE>              Set the default timezone
+
  --sm-remove                        Remove all the subscriptions
  --touch <FILE>                      Run touch on a file
+
  --sm-unregister                    Unregister using subscription-manager
  --truncate <FILE>                  Truncate a file to zero size
+
  --ssh-inject <USER[:SELECTOR]>      Inject a public key into the guest
  --truncate-recursive <PATH>        Recursively truncate all files in directory
+
  --timezone <TIMEZONE>              Set the default timezone
  --uninstall <PKG,PKG..>            Uninstall package(s)
+
  --touch <FILE>                      Run touch on a file
  --update                            Update packages
+
  --truncate <FILE>                  Truncate a file to zero size
  --upload <FILE:DEST>                Upload local file to destination
+
  --truncate-recursive <PATH>        Recursively truncate all files in directory
  -V, --version                      Display version and exit
+
  --uninstall <PKG,PKG..>            Uninstall package(s)
  -v, --verbose                      Enable libguestfs debugging messages
+
  --update                            Update packages
  --write <FILE:CONTENT>              Write file
+
  --upload <FILE:DEST>                Upload local file to destination
  -x                                  Enable tracing of libguestfs calls
+
  -V, --version                      Display version and exit
</pre>
+
  -v, --verbose                      Enable libguestfs debugging messages
 +
  --write <FILE:CONTENT>              Write file
 +
  -x                                  Enable tracing of libguestfs calls
  
 
== Activities ==
 
== Activities ==

Revision as of 07:31, 4 April 2021

virt-sysprep[1] command included in libguestfs-tools package reset, unconfigure or customize a virtual machine so clones can be made.

WARNING: Using virt-sysprep on live virtual machines, or concurrently with other disk editing tools, can be dangerous, potentially causing disk corruption. Virtual Machine must be shut down.

Command examples

  • List operations:
virt-sysprep --list-operations
  • Performs a read-only "dry run" sysprep operation:
virt-sysprep --dry-run TEST_VM_TO_RESET
  • To reset everything:
virt-sysprep -d TEST_VM_TO_RESET
  • To Change name and force to keep user account MY_USERNAME_TO_KEEP
virt-sysprep -d testvm --hostname testvm --enable user-account --keep-user-accounts MY_USERNAME_TO_KEEP
  • virt-sysprep -d bionic[2]

Related commands

Help

virt-sysprep
virt-sysprep: error: you must give either -a or -d options.  Read
virt-sysprep(1) man page for further information.

If reporting bugs, run virt-sysprep with debugging enabled and include the
complete output:

 virt-sysprep -v -x [...]


virt-sysprep --help
virt-sysprep: reset or unconfigure a virtual machine so clones can be made

 virt-sysprep [--options] -d domname

 virt-sysprep [--options] -a disk.img [-a disk.img ...]

A short summary of the options is given below.  For detailed help please
read the man page virt-sysprep(1).

Options:
  -a, --add <file>                    Add disk image file
  --append-line <FILE:LINE>           Append line(s) to the file
  -c, --connect <uri>                 Set libvirt URI
  --chmod <PERMISSIONS:FILE>          Change the permissions of a file
  --color, --colors, --colour, --colours
                                      Use ANSI colour sequences even if not tty
  --commands-from-file <FILENAME>     Read customize commands from file
  --copy <SOURCE:DEST>                Copy files in disk image
  --copy-in <LOCALPATH:REMOTEDIR>     Copy local files or directories into image
  -d, --domain <domain>               Set libvirt guest name
  --delete <PATH>                     Delete a file or directory
  -n, --dryrun, --dry-run             Perform a dry run
  --echo-keys                         Don’t turn off echo for passphrases
  --edit <FILE:EXPR>                  Edit file using Perl expression
  --enable <operations>               Enable specific operations
  --firstboot <SCRIPT>                Run script at first guest boot
  --firstboot-command <'CMD+ARGS'>    Run command at first guest boot
  --firstboot-install <PKG,PKG..>     Add package(s) to install at first boot
  --format <format>                   Set format (default: auto)
  --help                              Display brief help
  --hostname <HOSTNAME>               Set the hostname
  --install <PKG,PKG..>               Add package(s) to install
  --keep-user-accounts <users>        Users to keep
  --key <SELECTOR>                    Specify a LUKS key
  --keys-from-stdin                   Read passphrases from stdin
  --link <TARGET:LINK[:LINK..]>       Create symbolic links
  --list-operations                   List supported operations
  --mkdir <DIR>                       Create a directory
  --mount-options <opts>              Set mount options (eg /:noatime;/var:rw,noatime)
  --move <SOURCE:DEST>                Move files in disk image
  --network                           Enable appliance network
  --no-logfile                        Scrub build log file
  --no-network                        Disable appliance network (default)
  --no-selinux-relabel                Compatibility option, does nothing
  --operation, --operations <operations>
                                      Enable/disable specific operations
  --password <USER:SELECTOR>          Set user password
  --password-crypto <md5|sha256|sha512>
                                      Set password crypto
  -q, --quiet                         Don’t print progress messages
  --remove-user-accounts <users>      Users to remove
  --root-password <SELECTOR>          Set root password
  --run <SCRIPT>                      Run script in disk image
  --run-command <'CMD+ARGS'>          Run command in disk image
  --script <script>                   Script or program to run on guest
  --scriptdir <dir>                   Mount point on host
  --scrub <FILE>                      Scrub a file
  --selinux-relabel                   Relabel files with correct SELinux labels
  --sm-attach <SELECTOR>              Attach to a subscription-manager pool
  --sm-credentials <SELECTOR>         Credentials for subscription-manager
  --sm-register                       Register using subscription-manager
  --sm-remove                         Remove all the subscriptions
  --sm-unregister                     Unregister using subscription-manager
  --ssh-inject <USER[:SELECTOR]>      Inject a public key into the guest
  --timezone <TIMEZONE>               Set the default timezone
  --touch <FILE>                      Run touch on a file
  --truncate <FILE>                   Truncate a file to zero size
  --truncate-recursive <PATH>         Recursively truncate all files in directory
  --uninstall <PKG,PKG..>             Uninstall package(s)
  --update                            Update packages
  --upload <FILE:DEST>                Upload local file to destination
  -V, --version                       Display version and exit
  -v, --verbose                       Enable libguestfs debugging messages
  --write <FILE:CONTENT>              Write file
  -x                                  Enable tracing of libguestfs calls

Activities

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Source: wikiversity

Advertising: