My uefi build script. If you see an error or issue that could cause error 43 please confirm it:
#!/bin/bash
cd /home/dad/qemu/qemu2 sudo ./up.sh tap0
configfile=./vfio-pci1.cfg
vfiobind() { dev="$1" vendor=$(cat /sys/bus/pci/devices/$dev/vendor) device=$(cat /sys/bus/pci/devices/$dev/device) if [ -e /sys/bus/pci/devices/$dev/driver ]; then echo $dev > /sys/bus/pci/devices/$dev/driver/unbind fi echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
}
modprobe vfio-pci
cat $configfile | while read line;do echo $line | grep ^# >/dev/null 2>&1 && continue vfiobind $line done
vmname="windows10vm"
if ps -A | grep -q $vmname; then echo "$vmname is already running." & exit 1
else
# use pulseaudio export QEMU_AUDIO_DRV=pa
cp /usr/share/OVMF/OVMF_VARS.fd /tmp/my_vars.fd
qemu-system-x86_64 \ -name $vmname,process=$vmname \ -machine type=pc-i440fx-2.6,accel=kvm \ -cpu host,kvm=off \ -smp 8,sockets=1,cores=4,threads=2 \ -enable-kvm \ -m 4G \ -mem-path /run/hugepages/kvm \ -mem-prealloc \ -balloon none \ -rtc clock=host,base=localtime \ -serial none \ -parallel none \ -vga none \ -device vfio-pci,host=01:00.0,multifunction=on \ -device vfio-pci,host=01:00.1 \ -drive if=pflash,format=raw,readonly,file=/home/dad/qemu/qemu2/OVMF-pure-efi.fd \ -drive if=pflash,format=raw,file=/tmp/my_vars.fd \ -boot order=dc -boot menu=on \ -device virtio-scsi-pci,id=scsi \ -drive id=disk0,if=virtio,cache=none,format=raw,file=/home/dad/qemu/qemu2/win7.img \ -drive file=/home/dad/qemu/qemu2/virtio-win-0.1.126.iso,id=virtiocd,format=raw,if=none -device ide-cd,bus=ide.1,drive=virtiocd \ -netdev type=tap,id=net0,ifname=tap0,vhost=on,script=no,downscript=no \ -device virtio-net-pci,netdev=net0,mac=00:16:3e:00:01:01 \ -usb -usbdevice host:413c:a503 -usbdevice host:13fe:3100
sudo ./down.sh tap0 exit 0 fi
My uefi build script. If you see an error or issue that could cause error 43 please confirm it:
#!/bin/bash
cd /home/dad/ qemu/qemu2
sudo ./up.sh tap0
configfile= ./vfio- pci1.cfg
vfiobind() {
vendor= $(cat /sys/bus/ pci/devices/ $dev/vendor)
device= $(cat /sys/bus/ pci/devices/ $dev/device) pci/devices/ $dev/driver ]; then
echo $dev > /sys/bus/ pci/devices/ $dev/driver/ unbind pci/drivers/ vfio-pci/ new_id
dev="$1"
if [ -e /sys/bus/
fi
echo $vendor $device > /sys/bus/
}
modprobe vfio-pci
cat $configfile | while read line;do
echo $line | grep ^# >/dev/null 2>&1 && continue
vfiobind $line
done
vmname= "windows10vm"
if ps -A | grep -q $vmname; then
echo "$vmname is already running." &
exit 1
else
# use pulseaudio
export QEMU_AUDIO_DRV=pa
cp /usr/share/ OVMF/OVMF_ VARS.fd /tmp/my_vars.fd
qemu-system-x86_64 \ process= $vmname \ i440fx- 2.6,accel= kvm \ 1,cores= 4,threads= 2 \ base=localtime \ host=01: 00.0,multifunct ion=on \ host=01: 00.1 \ format= raw,readonly, file=/home/ dad/qemu/ qemu2/OVMF- pure-efi. fd \ format= raw,file= /tmp/my_ vars.fd \ scsi-pci, id=scsi \ if=virtio, cache=none, format= raw,file= /home/dad/ qemu/qemu2/ win7.img \ dad/qemu/ qemu2/virtio- win-0.1. 126.iso, id=virtiocd, format= raw,if= none -device ide-cd, bus=ide. 1,drive= virtiocd \ id=net0, ifname= tap0,vhost= on,script= no,downscript= no \ net-pci, netdev= net0,mac= 00:16:3e: 00:01:01 \
-name $vmname,
-machine type=pc-
-cpu host,kvm=off \
-smp 8,sockets=
-enable-kvm \
-m 4G \
-mem-path /run/hugepages/kvm \
-mem-prealloc \
-balloon none \
-rtc clock=host,
-serial none \
-parallel none \
-vga none \
-device vfio-pci,
-device vfio-pci,
-drive if=pflash,
-drive if=pflash,
-boot order=dc -boot menu=on \
-device virtio-
-drive id=disk0,
-drive file=/home/
-netdev type=tap,
-device virtio-
-usb -usbdevice host:413c:a503 -usbdevice host:13fe:3100
sudo ./down.sh tap0
exit 0
fi