add Windows10 vm controls

This commit is contained in:
Tyler 2020-05-04 12:40:33 -05:00
parent a9b707cb42
commit be1e2a4b84
2 changed files with 25 additions and 0 deletions

22
tools/kvm/shutdown_vm.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
vm=Windows10
echo "Trying to shutdown $vm"
sudo virsh shutdown $vm
i=0
while [ $i -le 30 ]; do
sleep 1
sudo virsh list | rg $vm > /dev/null
if [ $? -ne 1 ]; then
echo "Still waiting for $vm to terminate..."
((i++))
else
echo "$vm terminated!"
exit 0
fi
done
echo "$vm did not terminate in a timely fashion, destroying instance."
sudo virsh destroy $vm

3
tools/kvm/start_vm.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
sudo virsh start Windows10