LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

virt-sysprep

Prepare VM images for cloning

TLDR

List available operations
$ virt-sysprep --list-operations
copy
Remove sensitive data
$ sudo virt-sysprep -a [path/to/image.qcow2]
copy
Dry run by domain name
$ sudo virt-sysprep -d [vm_name] -n
copy
Run specific operations
$ sudo virt-sysprep -d [vm_name] --operations [operation1,operation2]
copy
Set hostname and machine-id
$ sudo virt-sysprep -d [vm_name] --enable customizations --hostname [host_name] --operation machine-id
copy

SYNOPSIS

virt-sysprep [OPTIONS]

DESCRIPTION

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.

PARAMETERS

-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

INSTALL

sudo apt install guestfs-tools
copy
sudo dnf install guestfs-tools
copy
sudo pacman -S guestfs-tools
copy
sudo zypper install guestfs-tools
copy
nix profile install nixpkgs#guestfs-tools
copy

CAVEATS

VM must be shut down. Root privileges typically required. Some operations may break the VM if used incorrectly. Always backup images before processing.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid