From 3f89500f41e89566f05d650e35c461956cd73bcd Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:26:04 +0200 Subject: [PATCH] virt-sysprep: add an example and sudo (#15593) * Update virt-sysprep.md * Update virt-sysprep.md * Update virt-sysprep.md * Update virt-sysprep.md * Update virt-sysprep.md * Update pages/common/virt-sysprep.md Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> * Update virt-sysprep.md * Update virt-sysprep.md --------- Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> --- pages/common/virt-sysprep.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/common/virt-sysprep.md b/pages/common/virt-sysprep.md index 087e180468..e69a1490ca 100644 --- a/pages/common/virt-sysprep.md +++ b/pages/common/virt-sysprep.md @@ -7,14 +7,18 @@ `virt-sysprep --list-operations` -- Run all enabled operations but don't actually apply the changes: +- Remove sensitive system data from a virtual machine image: -`virt-sysprep --domain {{vm_name}} --dry-run` +`sudo virt-sysprep --add {{path/to/image.qcow2}}` + +- Specify a virtual machine by its name and run all enabled operations but don't actually apply the changes: + +`sudo virt-sysprep --domain {{vm_name}} --dry-run` - Run only the specified operations: -`virt-sysprep --domain {{vm_name}} --operations {{operation1,operation2,...}}` +`sudo virt-sysprep --domain {{vm_name}} --operations {{operation1,operation2,...}}` - Generate a new `/etc/machine-id` file and enable customizations to be able to change the host name to avoid network conflicts: -`virt-sysprep --domain {{vm_name}} --enable {{customizations}} --hostname {{host_name}} --operation {{machine-id}}` +`sudo virt-sysprep --domain {{vm_name}} --enable {{customizations}} --hostname {{host_name}} --operation {{machine-id}}`