Created
March 17, 2019 18:41
-
-
Save dln/69fadb1266921867750e87329ba5015d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| args=( | |
| ## Machine | |
| -smp 20 | |
| -m 16G | |
| # -machine type=q35,accel=kvm | |
| -enable-kvm | |
| -cpu host,kvm=off,hv_relaxed,hv_spinlocks=0x1fff,hv_time,hv_vapic,hv_vendor_id=Nvidia43FIX,+kvm_pv_unhalt,+kvm_pv_eoi | |
| -rtc clock=host,base=localtime | |
| -parallel none | |
| -serial none | |
| -mem-path /dev/hugepages | |
| ## Display / SPICE | |
| -display none | |
| -vga qxl | |
| -spice port=5900,addr=0.0.0.0,disable-ticketing,streaming-video=all | |
| ## Input | |
| -device qemu-xhci,id=xhci | |
| -device virtio-tablet,wheel-axis=true | |
| ## USB | |
| -usb | |
| -device usb-host,hostbus=1,hostaddr=3 # eLicenser | |
| -device usb-host,hostbus=3,hostaddr=18 # Focusrite Scarlett 2x2 | |
| -device usb-host,hostbus=5,hostaddr=2 # Akai MPK49 | |
| -device usb-host,hostbus=5,hostaddr=3 # "terminus hub" ? | |
| -device usb-host,hostbus=5,hostaddr=4 # Novation Launchpad Mini | |
| -device usb-host,hostbus=7,hostaddr=4 # Keyboard | |
| -device usb-host,hostbus=7,hostaddr=5 # Mouse | |
| ## GPU | |
| -device vfio-pci,host=42:00.0,multifunction=on,x-vga=on,romfile=/home/dln/GP104-patched.rom | |
| -device vfio-pci,host=42:00.1 | |
| ## Qemu Agent | |
| # -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 | |
| # -device virtio-serial | |
| # -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 | |
| ## Network | |
| -nic bridge,model=virtio-net-pci,mac=52:54:00:12:34:56 | |
| ## UEFI | |
| -drive file=/usr/share/ovmf/x64/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on | |
| -drive file=/home/dln/.config/qemu/windows.nvram,if=pflash,format=raw,unit=1 | |
| ## Storage | |
| -drive file=/dev/disk/by-id/nvme-eui.0025385981b20a42,format=raw,index=1,media=disk,if=virtio,cache=none,aio=native,id=disk0 | |
| -boot c | |
| ) | |
| echo "--- Ensure bridge traffic does not go to netfilter" | |
| sysctl net.bridge.bridge-nf-call-ip6tables=0 | |
| sysctl net.bridge.bridge-nf-call-iptables=0 | |
| sysctl net.bridge.bridge-nf-call-arptables=0 | |
| echo "--- Stealing GPU from VT" | |
| echo 0 > /sys/class/vtconsole/vtcon0/bind || true 2>>/dev/null | |
| echo 0 > /sys/class/vtconsole/vtcon1/bind || true 2>>/dev/null | |
| echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind || true 2>>/dev/null | |
| echo "--- Starting windows VM" | |
| set -x | |
| exec qemu-system-x86_64 ${args[@]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment