I've used this sort of script in the past. It's been awhile. I had to run Windows on the metal for about 18 months, for a variety of reasons. Sometimes, being a developer sucks. You have to work with things you don't like. I apologise for my tardiness in responding. I've been grinding Java the last few weeks.
Code:
#!/bin/sh
export QEMU_AUDIO_DRV=pa
/usr/bin/qemu-system-x86_64 -enable-kvm -m 8192 -cpu host,kvm=off \
-smp 3,sockets=1,cores=3,threads=1 \
-machine q35,accel=kvm \
-device qxl \
-usb \
-device usb-mouse \
-device usb-kbd \
-soundhw hda \
-bios /usr/share/seabios/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=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-device vfio-pci,host=04:00.1,bus=root.1,addr=00.1 \
-device virtio-blk-pci,scsi=off,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-device virtio-blk-pci,scsi=off,addr=0x8,drive=drive-virtio-disk1,id=virtio-disk1 \
-drive file=/usr/local/VM/Games.img,if=none,id=drive-virtio-disk1,format=raw,media=disk \
-drive file=/usr/local/VM/DevMach.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,media=disk \
-netdev tap,id=user.0 \
-device virtio-net-pci,netdev=user.0,mac=52:54:00:58:ba:9c \
-boot order=c \
-usbdevice host:9.2 \
-rtc base=localtime,driftfix=slew
wait
The script is far from new, nor is it exceptional in any way. There is one thing I'd like to point out and that is the qxl device. When you are not using Spice with qemu, this creates an X11 window that will capture keyboard and mouse data. Focus can released with keystrokes, so that a third party software like Synergy is not required. You can also avoid Virt-manager/libvirt, which can cause some gaming issues.
Bookmarks