Skip to content

Instantly share code, notes, and snippets.

@3d24rd0
Created June 23, 2015 18:16
Show Gist options
  • Save 3d24rd0/0a815c0ab09d04d1249f to your computer and use it in GitHub Desktop.
Save 3d24rd0/0a815c0ab09d04d1249f to your computer and use it in GitHub Desktop.
#!/bin/bash
echo -n "Binding devices..."
sudo vfio-bind 0000:01:00.0 0000:01:00.1 0000:00:19.0
echo "Starting Synergy"
#sudo systemctl start synergys@trimm
echo -n "Disabling display VGA1..."
xrandr --output VIRTUAL1 --off --output DP1 --off --output HDMI3 --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI2 --off --output HDMI1 --off --output VGA1 --off
echo -n "Starting VIRTUAL machine..."
sudo qemu-system-x86_64 \
-enable-kvm \
-M q35 \
-m 16384 \
-cpu host \
-smp 6,sockets=1,cores=6,threads=1 \
-bios /usr/share/qemu/bios.bin \
-vga none \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=01:00.1,bus=root.1,addr=00.1 \
-nographic \
-device ahci,bus=pcie.0,id=ahci \
-drive file=/var/lib/libvirt/images/Windows8.1.img,id=disk,format=raw \
-device ide-hd,bus=ahci.0,drive=disk \
-device vfio-pci,host=00:19.0,bus=pcie.0
echo "Done"
#sudo systemctl stop synergys@trimm
echo -n "Restoring display VGA1.."
xrandr --output VIRTUAL1 --off --output DP1 --off --output HDMI3 --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI2 --off --output HDMI1 --off --output VGA1 --mode 1920x1080 --pos 0x0 --rotate normal
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment