summaryrefslogtreecommitdiff
path: root/createvm.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-07-18 14:35:53 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2019-07-18 14:35:53 +0200
commitff449bdafaf5c67e4e9882bd87e7dea1d8728c46 (patch)
tree719ba41d979abf578c97c8471bf09b71192fbf6c /createvm.sh
parent879798d7e4b70c1fdc8040f4798a6cdeaf6e6d21 (diff)
downloadarchauto-ff449bdafaf5c67e4e9882bd87e7dea1d8728c46.tar.gz
archauto-ff449bdafaf5c67e4e9882bd87e7dea1d8728c46.tar.bz2
Diffstat (limited to 'createvm.sh')
-rwxr-xr-xcreatevm.sh31
1 files changed, 20 insertions, 11 deletions
diff --git a/createvm.sh b/createvm.sh
index 0edf671..747e4f6 100755
--- a/createvm.sh
+++ b/createvm.sh
@@ -1,5 +1,13 @@
#!/bin/bash
+# configuration
+
+NAME=arch64
+HOST=192.168.130.1
+NETMASK=255.255.255.0
+PREFIX=24
+CLIENT=192.168.130.3
+
vm_is_running() {
if [ "$(virsh domstate $1 2>/dev/null)" == "running" ]; then
return 0
@@ -14,22 +22,23 @@ wait_for_vm_to_stop() {
done
}
-NAME=archlinux
-
-mount -o loop,ro archlive/out/archlinux-2016.09.30-dual.iso archiso
+mount -o loop,ro archlinux-2019.07.01-x86_64.iso archiso
-darkhttpd . --port 8080 &
+#cp archiso/arch/boot/x86_64/vmlinuz .
+#cp archiso/arch/boot/x86_64/archiso.img .
-virt-install --name ${NAME} -r 1024 --vcpus=1 --os-type=linux --os-variant=virtio26 \
- --disk pool=local,size=2,format=qcow2 --network network=virt0,model=virtio \
- --vnc --vncport=5901 --noreboot --noautoconsole \
- --boot kernel=vmlinuz,initrd=archiso.img,kernel_args="archisobasedir=archiso/arch archiso_http_srv=http://eurobuild3.lan:8080/ script=http://eurobuild3.lan:8080/archauto.sh ip=dhcp" &
+#darkhttpd . --port 8088 &
-sleep 5
+virt-install --name ${NAME} -r 1536 --vcpus=1 --os-type=linux --os-variant=fedora29 \
+ --disk pool=default,size=4,format=qcow2 --network bridge=br0,model=virtio \
+ --vnc --vncport=5901 --noreboot \
+ --boot kernel=archiso/arch/boot/x86_64/vmlinuz,initrd=archiso/arch/boot/x86_64/archiso.img,kernel_args="archisobasedir=archiso/arch archiso_http_srv=http://${HOST}:8088/ script=http://${HOST}:8088/archauto.sh ip=${CLIENT}:::${NETMASK}:${NAME}::off nomodeset i915.modeset=0" &
+# --noautoconsole
+sleep 15
virsh start ${NAME}
-sleep 5
+sleep 15
wait_for_vm_to_stop ${NAME}
@@ -43,5 +52,5 @@ virsh start ${NAME}
rm -f ${NAME}-new.xml ${NAME}.xml
-pkill darkhttpd
+#pkill darkhttpd
umount archiso