summaryrefslogtreecommitdiff
path: root/create-vm
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-04-05 19:47:51 +0300
committerLars Wirzenius <liw@liw.fi>2020-04-05 19:47:51 +0300
commit20990502b932c9c891d4af7f5ca3fa08e3008339 (patch)
tree0c5d2f722d8236469eaf56a39d7efddb77467870 /create-vm
parent9d9d6e0dc296829e8c54838b4a8725db80abccdc (diff)
downloadick-contractor-20990502b932c9c891d4af7f5ca3fa08e3008339.tar.gz
Change: setup to create a nested VM and run a build
Diffstat (limited to 'create-vm')
-rwxr-xr-xcreate-vm24
1 files changed, 24 insertions, 0 deletions
diff --git a/create-vm b/create-vm
new file mode 100755
index 0000000..aabc56e
--- /dev/null
+++ b/create-vm
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -eu
+
+name=worker
+
+cp worker.img temp.img
+image=temp.img
+
+virsh -c qemu:///system net-autostart default
+virsh -c qemu:///system net-start default || true
+
+virt-install \
+ --connect qemu:///system \
+ --quiet \
+ --name="$name" \
+ --memory=4096 \
+ --cpu=host-model-only \
+ --import \
+ --os-variant=debian9 \
+ --disk="path=$image,cache=none" \
+ --network="network=default" \
+ --graphics=spice \
+ --noautoconsole