Skip to content

Instantly share code, notes, and snippets.

@0xSheepdog
Last active January 14, 2024 03:20
Show Gist options
  • Save 0xSheepdog/c6b4db2ca4765dc732f65d6a6e8d50d1 to your computer and use it in GitHub Desktop.
Save 0xSheepdog/c6b4db2ca4765dc732f65d6a6e8d50d1 to your computer and use it in GitHub Desktop.
howto customize libvirt guest disk image before deployment
# This script provides examples for using the 'virt-customize' command to modify
# a libvirt guest disk image. It demonstrates a few common items as well as
# runs a shell script with more in-depth commands that will be run on the
# appliance and saved to the disk image. See my 'customize-guest.sh' gist for
# an example of the type of script you may use.
# gist.github.com/0xSheepdog/07284a9b1a1a3e2d30cc63a40a89cb77
$ virt-customize \
-a rocky-9.0-x86_64.qcow2 \
--root-password password:S3CRETPA$SW0RD \
--uninstall cloud-init \
--run-command "systemctl disable firewalld.service" \
--run customize-guest.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment