Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- vmname="win-game"
- if ps -ef | grep qemu-system-x86_64 | grep -q multifunction=on; then
- echo "A passthrough VM is already running." &
- exit 1
- else
- # use pulseaudio
- export QEMU_AUDIO_DRV=pa
- export QEMU_PA_SAMPLES=8192
- export QEMU_AUDIO_TIMER_PERIOD=99
- export QEMU_PA_SERVER=/run/user/1000/pulse/native
- cp /usr/share/OVMF/OVMF_VARS.fd /tmp/my_vars.fd
- qemu-system-x86_64 \
- -name $vmname,process=$vmname \
- -machine type=q35,accel=kvm \
- -cpu host,kvm=off \
- -smp 8,sockets=1,cores=4,threads=2 \
- -m 8G \
- -balloon none \
- -rtc clock=host,base=localtime \
- -vga none \
- -nographic \
- -serial none \
- -parallel none \
- -soundhw hda \
- -usb -device usb-host,vendorid=0x046d,productid=0xc52b \
- -device vfio-pci,host=02:00.0,multifunction=on \
- -device vfio-pci,host=02:00.1 \
- -drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
- -drive if=pflash,format=raw,file=/tmp/my_vars.fd \
- -boot order=dc \
- -drive id=disk0,if=virtio,cache=none,format=raw,file=/dev/zvol/jet/wingame \
- -drive id=disk1,if=virtio,cache=none,format=raw,file=/dev/zvol/tank/wingame \
- -drive file=/var/lib/libvirt/images/win10.iso,index=1,media=cdrom \
- -drive file=/var/lib/libvirt/images/virtio-win-0.1.160.iso,index=2,media=cdrom \
- -netdev user,id=user.0 -device e1000,netdev=user.0
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement