Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- configfile=/etc/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
- cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd /tmp/my_vars.fdd
- qemu-system-x86_64 \
- -enable-kvm \
- -m 12288 \
- -cpu host,kvm=off \
- -vga none \
- -smp 4,sockets=1,cores=4,threads=1 \
- -device ioh3420,bus=pci.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
- -device vfio-pci,host=03:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
- -device vfio-pci,host=03:00.1,bus=root.1,addr=00.1 \
- -device vfio-pci,host=08:00.0,bus=pci.0 \
- -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
- -drive if=pflash,format=raw,file=/tmp/my_vars.fd
- -drive file=/home/navihawk/windows1.img,id=disk,format=raw -device ide-hd,bus=ide.0,drive=disk \
- -drive file=/home/navihawk/Downloads/Win10_English_x64.iso,id=isocd -device ide-cd,bus=ide.1,drive=isocd \
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement