Last active
April 30, 2022 08:18
-
-
Save remoteur/2038c2d45b064524f1e8 to your computer and use it in GitHub Desktop.
decloudify_image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install -y libguestfs-tools | |
virt-filesystems --long -h --all -a rhev-m.init.qcow2 | |
truncate -r rhev-m.init.qcow2 rhev-m.qcow2 | |
truncate -s +100G rhev-m.qcow2 | |
virt-resize --expand /dev/sda1 rhev-m.init.qcow2 rhev-m.qcow2 | |
virt-customize -a rhev-m.qcow2 --root-password password:<pass> | |
virt-customize -a rhev-m.qcow2 --run-command 'yum remove -y cloud-init' | |
virt-customize -a rhev-m.qcow2 --run-command 'sed -i s/^PasswordAuthentication.*/PasswordAuthentication\ yes/ /etc/ssh/sshd_config' | |
virt-customize -a rhev-m.qcow2 --run-command 'sed -i s/^PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment