VMs/win2k22/create.sh
2024-02-27 17:33:02 +01:00

22 lines
562 B
Bash
Executable File

#!/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[@]}"