Advertisement
Guest User

qemu

a guest
Sep 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. vmname="win-game"
  4.  
  5. if ps -ef | grep qemu-system-x86_64 | grep -q multifunction=on; then
  6. echo "A passthrough VM is already running." &
  7. exit 1
  8. else
  9.  
  10. # use pulseaudio
  11. export QEMU_AUDIO_DRV=pa
  12. export QEMU_PA_SAMPLES=8192
  13. export QEMU_AUDIO_TIMER_PERIOD=99
  14. export QEMU_PA_SERVER=/run/user/1000/pulse/native
  15.  
  16. cp /usr/share/OVMF/OVMF_VARS.fd /tmp/my_vars.fd
  17. qemu-system-x86_64 \
  18. -name $vmname,process=$vmname \
  19. -machine type=q35,accel=kvm \
  20. -cpu host,kvm=off \
  21. -smp 8,sockets=1,cores=4,threads=2 \
  22. -m 8G \
  23. -balloon none \
  24. -rtc clock=host,base=localtime \
  25. -vga none \
  26. -nographic \
  27. -serial none \
  28. -parallel none \
  29. -soundhw hda \
  30. -usb -device usb-host,vendorid=0x046d,productid=0xc52b \
  31. -device vfio-pci,host=02:00.0,multifunction=on \
  32. -device vfio-pci,host=02:00.1 \
  33. -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
  34. -drive if=pflash,format=raw,file=/tmp/my_vars.fd \
  35. -boot order=dc \
  36. -drive id=disk0,if=virtio,cache=none,format=raw,file=/dev/zvol/jet/wingame \
  37. -drive id=disk1,if=virtio,cache=none,format=raw,file=/dev/zvol/tank/wingame \
  38. -drive file=/var/lib/libvirt/images/win10.iso,index=1,media=cdrom \
  39. -drive file=/var/lib/libvirt/images/virtio-win-0.1.160.iso,index=2,media=cdrom \
  40. -netdev user,id=user.0 -device e1000,netdev=user.0
  41. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement