Live Chat Software by Kayako
Knowledgebase: KVM
Links and scripts from Video: Tutorial: Debian 8, howto passthrough your physical GPU to your virtual Windows7 with KVM and OVMF
Posted by Thang Le Toan on 01 May 2016 03:49 PM

Here are the links and scripts.

https://www.redhat.com/mailman/listinfo/vfio-users
Now is the successor of the archlinux forum part.
https://bbs.archlinux.org/viewtopic.php?id=162768
In Arch Linux You can find a nice and very active community, the first entry is a howto that addresses different configurations.

http://vfio.blogspot.com
In VFIO blog are a lot of information regarding the hardware virtualization.

https://docs.google.com/spreadsheets/d/1LnGpTrXalwGVNy0PWJDURhyxa3sgqkGXmvNCIvIMenk/edit?pli=1#gid=0
a list of working and non-working systems with different Linux distributions

My hardware components:
Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz socket 1150
GA-Z97X-UD3H-BK
16GB DDR3 Memory
512GB SSD
NVIDIA GeForce GTX 780 (ASUS GTX780-DC2OC-3GD5) for passthrugh

To check do the video card supports UEFI Boot.
http://vfio.blogspot.de/2014/08/does-my-graphics-card-rom-support-efi.html


For preparations:

http://kvm-exp.blogspot.de/2015/06/howto-debian-jessie-8-pcistub-config-to.html

VirtIo driver from Fedora
https://fedoraproject.org/wiki/Windows_Virtio_Drivers



Script files:

kvm-install.sh
--------------------------------------------------- begin -------------------------------------------
#!/bin/sh

INSTALLFILE=win7-uefi-x64_system.qcow2
FILESIZE=50G

INSTALLCD=/home/user/Downloads/W7SP1_PRO_DELL.iso
# if you use a hardware CD-ROM drive, check for the device. In most cases it's /dev/sr0
#INSTALLCD=/dev/sr0

DRIVERCD=/home/user/Downloads/virtio-win-0.1.96.iso

# PCI address of the passtrough devices
DEVICE1="01:00.0"
DEVICE2="01:00.1"

# load vfio-pci module
modprobe vfio-pci

for dev in "0000:$DEVICE1" "0000:$DEVICE2"; do
        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
done

# create installation file if not exist
if [ ! -e $INSTALLFILE ]; then
    qemu-img create -f qcow2 $INSTALLFILE $FILESIZE
fi

QEMU_PA_SAMPLES=4096 QEMU_AUDIO_DRV=pa \
qemu-system-x86_64 \
-enable-kvm \
-m 4096 \
-cpu host,kvm=off \
-smp 2,sockets=1,cores=2,threads=1 \
-machine pc-i440fx-2.1,accel=kvm \
-soundhw hda \
-bios /usr/share/ovmf/OVMF.fd `# SID version of OVMF` \
-device vfio-pci,host=$DEVICE1,addr=0x8.0x0,multifunction=on \
-device vfio-pci,host=$DEVICE2,addr=0x8.0x1 \
-vga qxl \
-device virtio-net-pci,netdev=user.0,mac=52:54:00:a0:66:43 \
-netdev user,id=user.0 \
-drive file=$INSTALLCD,if=none,id=drive-ide0-0-0,readonly=on,format=raw \
-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-drive file=$INSTALLFILE,if=none,id=drive-virtio-disk0,format=qcow2,cache=unsafe \
-device virtio-blk-pci,scsi=off,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 \
-drive file=$DRIVERCD,if=none,id=drive-ide0-1-0,readonly=on,format=raw \
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=3 \
-rtc base=localtime,driftfix=slew \
-smb /home/user/Downloads/toinstall \
-usb \
-device usb-tablet \
-device usb-kbd

--------------------------------------------------- end -------------------------------------------

kvm-start.sh
--------------------------------------------------- begin -------------------------------------------
#!/bin/bash

INSTALLFILE=win7-uefi-x64_system.qcow2
IMAGEFILE=win7-uefi-x64_system-01.qcow2
#FILESIZE=50G

# PCI address of the passtrough devices
DEVICE1="01:00.0"
DEVICE2="01:00.1"

# load vfio-pci module
modprobe vfio-pci

for dev in "0000:$DEVICE1" "0000:$DEVICE2"; do
        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
done

# create a imagefile from backingfile file if not exist
if [ ! -e $IMAGEFILE ]; then
    qemu-img create -f qcow2 -o backing_file=$INSTALLFILE,backing_fmt=qcow2 $IMAGEFILE
fi


QEMU_PA_SAMPLES=6144 QEMU_AUDIO_DRV=pa \
taskset -c 0-1 \
qemu-system-x86_64 \
-enable-kvm \
-m 4096 \
-cpu host,kvm=off \
-smp 2,sockets=1,cores=2,threads=1 \
-machine pc-i440fx-2.1,accel=kvm \
-soundhw hda \
-bios /usr/share/ovmf/OVMF.fd `# SID version of OVMF` \
-device vfio-pci,host=$DEVICE1,addr=0x8.0x0,multifunction=on,x-vga=on \
-device vfio-pci,host=$DEVICE2,addr=0x8.0x1 \
-vga none \
-device qxl \
-device virtio-net-pci,netdev=user.0,mac=52:54:00:a0:66:43 \
-netdev user,id=user.0 \
-drive file=$IMAGEFILE,if=none,id=drive-virtio-disk0,format=qcow2,cache=none \
-device virtio-blk-pci,scsi=off,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-rtc base=localtime,driftfix=slew \
-smb /home/user/Downloads/toinstall \
-usb \
-device usb-mouse \
-device usb-kbd
 
--------------------------------------------------- end ------------------------------------------- 

(0 vote(s))
Helpful
Not helpful

Comments (5)
Aly Chiman
22 December 2018 02:05 AM
Hello there,

My name is Aly and I would like to know if you would have any interest to have your website here at atcom.vn promoted as a resource on our blog alychidesign.com ?

We are in the midst of updating our broken link resources to include current and up to date resources for our readers. Our resource links are manually approved allowing us to mark a link as a do-follow link as well
.
If you may be interested please in being included as a resource on our blog, please let me know.

Thanks,
Aly
Marksulge
02 December 2019 09:21 AM
[url=https://elimite2.com/]cost of permethrin cream[/url]
Paulsulge
02 December 2019 03:33 PM
[url=https://elimite2.com/]order elimite online[/url]
Lisasulge
10 December 2019 09:03 PM
[url=http://elimite2.com/]elimite cream price[/url]
Marksulge
17 December 2019 10:49 AM
[url=https://elimite2.com/]where can i buy elimite cream[/url]
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Kayako