← 返回命令列表

Linux command

virt-sysprep 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List

virt-sysprep --list-operations

Example

sudo virt-sysprep -a [path/to/image.qcow2]

Dry run

sudo virt-sysprep -d [vm_name] -n

Example

sudo virt-sysprep -d [vm_name] --operations [operation1,operation2]

Example

sudo virt-sysprep -d [vm_name] --enable customizations --hostname [host_name] --operation machine-id

说明

virt-sysprep resets, unconfigures, or customizes a virtual machine image for cloning or deployment. It removes machine-specific data like SSH keys, logs, and persistent device names. This prepares VM images for use as templates by removing identity information that should be unique per machine.

参数

-a, --add _IMAGE_
Add disk image
-d, --domain _VM_
Specify VM by name
-n, --dry-run
Show what would be done without making changes
--operations _OPS_
Run only specified operations
--list-operations
List all supported operations
--hostname _NAME_
Set hostname
--enable _FEATURE_
Enable specific feature

FAQ

What is the virt-sysprep command used for?

virt-sysprep resets, unconfigures, or customizes a virtual machine image for cloning or deployment. It removes machine-specific data like SSH keys, logs, and persistent device names. This prepares VM images for use as templates by removing identity information that should be unique per machine.

How do I run a basic virt-sysprep example?

Run `virt-sysprep --list-operations` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --add _IMAGE_ do in virt-sysprep?

Add disk image