aboutsummaryrefslogtreecommitdiff
path: root/vm/alpine-x86_64.sh
diff options
context:
space:
mode:
Diffstat (limited to 'vm/alpine-x86_64.sh')
-rw-r--r--vm/alpine-x86_64.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/vm/alpine-x86_64.sh b/vm/alpine-x86_64.sh
new file mode 100644
index 0000000..814977a
--- /dev/null
+++ b/vm/alpine-x86_64.sh
@@ -0,0 +1,29 @@
+: ${VM_CACHE:?} ${VM_DATA:?}
+
+alpine_url=https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-virt-3.14.1-x86_64.iso
+
+iso_path=$VM_CACHE/alpine.iso
+
+image_path=$VM_DATA/alpine.qcow2
+
+
+if [ ! -f $iso_path ]; then
+ curl -L -o $iso_path $alpine_url
+fi
+
+if [ ! -f $image_path ]; then
+ qemu-img create -f qcow2 $image_path 20G
+fi
+
+exec qemu-system-x86_64 \
+ -enable-kvm \
+ -cpu host \
+ -hda $image_path \
+ -cdrom $iso_path \
+ -m 2G \
+ -device e1000,netdev=net0 \
+ -netdev user,id=net0 \
+ -usb \
+ -device usb-tablet \
+ -nographic \
+ "$@"