You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
934 B
Plaintext

4 years ago
#!/bin/bash
echo "Starting Network"
virsh --connect=qemu:///system net-start default
echo "Starting VM"
virsh --connect=qemu:///system start win10
echo "Starting Scream"
scream -o pulse -i virbr0 &
echo "Starting Looking Glass"
looking-glass-client -s no -K 120 -d yes -g egl -a -M no egl:vsync yes &
4 years ago
while [ "$command" != "stop" ]; do
read command
done
sudo whoami
4 years ago
echo "Stopping VM..."
#stop
virsh --connect=qemu:///system shutdown win10
echo "Killing Looking Glass and Scream..."
kill -9 $(jobs -p)
vmstate=$(virsh --connect=qemu:///system domstate win10)
echo "Waiting for shutdown..."
while [ "$vmstate" != "shut off" ]; do
sleep 1
vmstate=$(virsh --connect=qemu:///system domstate win10)
done
sleep 1
echo "VM is off, unbinding from vfio-pci"
sudo unbind 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
sleep 1
sudo modprobe nvidia NVreg_DynamicPowerManagement=0x02
sleep 2
sudo systemctl start bumblebeed
sleep 1
clrgpu