#!/bin/bash -e cd "$(dirname "$0")" . ./lib.sh if [ -f hda.qcow2 ]; then echo -e "Disk file exists. Are you sure you don't want" \ "\e[1m\e[31m./run.sh\e[0m?\nCtrl-C to interrupt" >&2 read -r fi qemu-img create -f qcow2 hda.qcow2 40G CMD=( "${CMD[@]}" -drive file=win2k22.iso,index=1,media=cdrom,readonly=on -drive file=virtio.iso,index=2,media=cdrom,readonly=on #-drive file.driver=http,file.filename=http://example.com/image.qcow2 -nic none # you don't want internet access for a windows installation ) "${CMD[@]}"