Skip to content

Instantly share code, notes, and snippets.

@tuna2134
Last active October 6, 2023 03:27
Show Gist options
  • Save tuna2134/0a85a3185f11025f3ae27f1b5b53ece3 to your computer and use it in GitHub Desktop.
Save tuna2134/0a85a3185f11025f3ae27f1b5b53ece3 to your computer and use it in GitHub Desktop.
cat <<EOF > user-data.yml
ssh_pwauth: true
password: sample
EOF
wget https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2
sudo virt-install --name vm \
--memory 2048 \
--vcpus 2 \
--os-variant rocky9-unknown \
--console pty,target_type=serial \
--extra-args "console=ttyS0" \
--network network=default \
--cloud-init user-data=./user-data.yml \
--import \
--location http://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.2-x86_64-minimal.iso \
--disk path=./Rocky-9-GenericCloud.latest.x86_64.qcow2,device=disk,bus=virtio,format=qcow2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment