Sample xml file for windows 8.1 and GPU/USB passtrough


Recommended Posts

This line don't look right

 

    <qemu:arg value='kvm-pci-assign,host=01:00.0,bus=root.1,addr=00.0'/>

 

 

 

I have this, you don't have exactly same function

    <qemu:arg value='kvm-pci-assign,host=04:00.0,bus=root.1,addr=00.0,multifunction=on'/>

 

 

Try first only with GPU

 

 

Maybe this # make some issue, is this good to comment out lines in XML ?

Sent from my iPad using Tapatalk HD

Link to comment
  • Replies 110
  • Created
  • Last Reply

Top Posters In This Topic

I changed my xml to better match yours, and removed the vnc section and tried again.  I can't connect via vpn, but it's still not outputting to my TV :(

 

<domain type='kvm'>
  <name>windows7</name>
  <uuid>3baf925d-74d8-4806-a6fe-330d911f28ce</uuid>

  <memory unit='GB'>4</memory>
  <currentMemory unit='GB'>4</currentMemory>

  <vcpu>2</vcpu>

  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <loader>/usr/share/qemu/bios-256k.bin</loader>
    <boot dev='hd'/>
  </os>

  <features>
    <acpi/>
    <apic/>
  </features>
  
  <clock offset='localtime'/>
  
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>

  <devices>
<!-- VIRTUAL DISK (IMG)-->
    <disk type='file' device='disk'>
  <driver name='qemu' type='qcow2'/>
      <source file='/mnt/cache/VM/Windows7/windows7.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>

<!-- VIRTUAL CD-ROM (ISO) -->
    <disk type='file' device='cdrom'>
      <source file='/mnt/user/backup/Programs/Windows_ISOs/Windows7rc21.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>

<!-- VIRTUAL CD-ROM (ISO) -->
    <disk type="file" device="cdrom">
      <source file="/mnt/cache/VM/Windows7/virtio-win-0.1-81.iso" />
      <target dev="sdd" bus="sata" />
      <readonly />
    </disk>

    <controller type='sata' index='0'>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='usb' index='0' model='none'>
    </controller>

<!--    <graphics type='vnc' port='5900'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>-->

    <video>
      <model type='vmvga' vram='9216' heads='1'/>
    </video>

    <interface type='bridge'>
      <source bridge='br0'/>
      <mac address='00:16:3e:c7:c7:c7'/>
    </interface>

    <emulator>/usr/bin/qemu-system-x86_64</emulator>

    <input type='mouse' bus='ps2'/>

  </devices>
  <seclabel type='none'/>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=01:00.0,bus=root.1,addr=00.0,multifunction=on'/>
<!--    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=01:00.1,bus=root.1,addr=00.0,multifunction=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=09:00.0,bus=pcie.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=14:00.0,bus=pcie.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=00:1b.0,bus=pcie.0'/>-->
  </qemu:commandline>

</domain>

 

I also tried removing the extra lines completely (instead of putting <-- and --> to coment them out), but it's not any better.

 

I wonder if I need to pass the PCI controller in addition to the PCI devices for some reason.

 

I really don't see any big differences between our xml files at this point.  I'm not sure what to try next.

Link to comment

Have you installed windows first without passing trough GPU? if not try to install windows completed first, the  you can try pass-trough GPU.

And your PCI devices from syslinux belong to pci-stub? you have verified that ?

 

 

BUT, it could be a W7 issue as well

 

 

 

//Peter

Link to comment

Yeah, I've installed windows 7 and applied all updates with the VNC connection.  I waited until that was done to try GPU passthru.

 

I'm not exactly sure what this means, or how to verify...

 

your PCI devices from syslinux belong to pci-stub? you have verified that ?

 

I suppose it could be a windows 7 issue, but since none of the devices are being passed, I suspect it's my error at this point.

 

I don't have the patience to try installing windows 8 just to test either, so unless someone has more tips, it seems I'll need to wait for the next beta, which I believe will have more functionality for passthru of devices.

 

Hopefully it won't be much longer :)

Link to comment

check pci devices with

 

lspci -kn

look for pci-stub for the devices you would pass trough

 

01:00.0 0100: 1000:0058 (rev 08)
        Subsystem: 1014:0394
        Kernel driver in use: mptsas
        Kernel modules: mptsas
03:00.0 0200: 10ec:8168 (rev 06)
        Subsystem: 1849:8168
        Kernel driver in use: r8169
        Kernel modules: r8169
04:00.0 0300: 1002:68f9
        Subsystem: 1682:304e
        Kernel driver in use: pci-stub
04:00.1 0403: 1002:aa68
        Subsystem: 1682:aa68
        Kernel driver in use: pci-stub

 

Link to comment

Ah, ok.

 

Yes, all (and only) the devices I want to pass are shown in that output.  i remove anything not shown as pci-stub, and am left with this...

 

root@media:/mnt/cache/VM/Windows7# lspci -kn
00:00.0 0600: 8086:0c00 (rev 06)
        Subsystem: 1849:0c00
        Kernel driver in use: hsw_uncore
00:14.0 0c03: 8086:8c31 (rev 04)
        Subsystem: 1849:8c31
        Kernel driver in use: pci-stub
00:1b.0 0403: 8086:8c20 (rev 04)
        Subsystem: 1849:1020
        Kernel driver in use: pci-stub
01:00.0 0300: 1002:68da
        Subsystem: 1682:3080
        Kernel driver in use: pci-stub
01:00.1 0403: 1002:aa60
        Subsystem: 1682:aa60
        Kernel driver in use: pci-stub
09:00.0 0480: 1131:7160 (rev 02)
        Subsystem: 1461:3055
        Kernel driver in use: pci-stub

Link to comment

I fired up a W7 VM.......... installing right now.

 

We will see later if it is OK to pass trough the GPU

//Peter

 

Thanks for taking the time to test this.  If it works for you, I'll be happy to know that it can work, and very irritated that it just doesn't work for me ;)

 

FYI, I was able to successfully passthru the GPU and other devices to a windows 7 VM with XEN in beta5, so I know my hardware is capable.

Link to comment

not today, not since making so many changes.  I've kept trimming down the xml file and just tried again with the xml below, but still no luck.

 

<domain type='kvm'>
  <name>windows7</name>
  <uuid>3baf925d-74d8-4806-a6fe-330d911f28ce</uuid>

  <memory unit='GB'>4</memory>
  <currentMemory unit='GB'>4</currentMemory>

  <vcpu>2</vcpu>

  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <boot dev='hd'/>
  </os>

  <features>
    <acpi/>
    <apic/>
  </features>
  
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>

  <devices>
<!-- VIRTUAL DISK (IMG)-->
    <disk type='file' device='disk'>
  <driver name='qemu' type='qcow2'/>
      <source file='/mnt/cache/VM/Windows7/windows7.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>

<!-- VIRTUAL CD-ROM (ISO) -->
    <disk type='file' device='cdrom'>
      <source file='/mnt/user/backup/Programs/Windows_ISOs/Windows7rc21.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>

<!-- VIRTUAL CD-ROM (ISO) -->
    <disk type="file" device="cdrom">
      <source file="/mnt/cache/VM/Windows7/virtio-win-0.1-81.iso" />
      <target dev="sdd" bus="sata" />
      <readonly />
    </disk>

    <controller type='sata' index='0'>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='usb' index='0' model='none'>
    </controller>

    <interface type='bridge'>
      <source bridge='br0'/>
      <mac address='00:16:3e:c7:c7:c7'/>
    </interface>

    <emulator>/usr/bin/qemu-system-x86_64</emulator>

    <input type='mouse' bus='ps2'/>

  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=01:00.0,bus=root.1,addr=00.0,multifunction=on'/>
<qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=01:00.1,bus=root.1,addr=00.1,multifunction=on'/>
  </qemu:commandline>

</domain>

 

I'm 'testing' this by whether or not windows shows up on my monitor.  I see the bootup text from when unRAID boots, and that's never gone away, so I don't think the windows video signal is getting passed thru.

Link to comment

I have these lines, some different than yours.

 

 <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=04:00.0,bus=root.1,addr=00.0,multifunction=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='kvm-pci-assign,host=04:00.1,bus=root.1,addr=00.1'/>

Link to comment

please try change this line

 

 <memballoon model='none'/>

to

 

 <memballoon model='virtio'/>

 

I think this is necessary, then install the virtio driver on the new system unit that shows up in the device manager.

 

I have GPU pass trough to W7, but it made some conflicts, so it cant be started..... going look more into this tomorrow.

 

//Peter

Link to comment

please try change this line

 

 <memballoon model='none'/>

to

 

 <memballoon model='virtio'/>

 

I think this is necessary, then install the virtio driver on the new system unit that shows up in the device manager.

 

I have GPU pass trough to W7, but it made some conflicts, so it cant be started..... going look more into this tomorrow.

 

//Peter

 

I had actually removed that line earlier, as I wasn't sure what it did, and it seemed like it was for allowing memory to grow as necessary, which I don't think I need right now.  However, I added it back in, and made a few more changes to the xml.  Windows started fine, and seems to be running very fast.  I have access to my unRAID shares, and the network seems fine also.

 

However, I don't have any devices being passed thru to the VM.  I'm out of ideas at this point :(

Link to comment

Success with vfio-pci on W7

 

First i bind the PCI device to vfio-pc ( I have a script for that)

 

00:1d.0 0c03: 8086:1e26 (rev 04)
        Subsystem: 1849:1e26
        Kernel driver in use: vfio-pci
04:00.0 0300: 1002:68f9
        Subsystem: 1682:304e
        Kernel driver in use: vfio-pci
04:00.1 0403: 1002:aa68
        Subsystem: 1682:aa68
        Kernel driver in use: vfio-pci

 

 

### Group 11 ###
    00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
### Group 14 ###
    04:00.0 VGA compatible controller: AMD/ATI [Advanced Micro Devices, Inc.] Cedar [Radeon HD 5000/6000/7350 Series]
    04:00.1 Audio device: AMD/ATI [Advanced Micro Devices, Inc.] Cedar HDMI Audio [Radeon HD 5400/6300 Series]


 

 

then edit /etc/libvirt/qemu.conf

and add the vfio groups that belongs to the devices above. (11 & 14 is my device)

 

Almost everything is disabled in this config file

 

cgroup_device_acl = [
    "/dev/null", "/dev/full", "/dev/zero",
    "/dev/random", "/dev/urandom",
    "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
    "/dev/rtc","/dev/vfio/11","/dev/vfio/14","/dev/hpet", "/dev/vfio/vfio"
]

 

then

/etc/rc.d/rc.libvirt stop
/etc/rc.d/rc.libvirt start

 

 

my new xml file

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows7</name>
  <uuid>cc411d71-1463-4db7-bf36-d364c0cdaa9d</uuid>
  <memory unit='GB'>2</memory>
  <currentMemory unit='GB'>2</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <boot dev='hd'/>
  </os>
<features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/vm_disk/KVM/windows7/windows7.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vm_disk/KVM/ISO/sv_windows_7_ultimate_with_sp1_x64_dvd_u_677400.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vm_disk/KVM/ISO/virtio-win-0.1-81.iso'/>
      <target dev='sdd' bus='sata'/>
      <readonly/>
    </disk>
    <controller type='sata' index='0'>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='usb' index='0' model='none'>
    </controller>
    <interface type='bridge'>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <memballoon model='virtio'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.1,bus=root.1,addr=00.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1d.0,bus=pcie.0'/>
  </qemu:commandline>
</domain>

 

I needed to remove this lines

  <video>
      <model type='vga' vram='9216' heads='1'/>
    </video>

 

virsh create windows7.xml

 

 

Sucess!!

//Peter

W7.JPG.39632507b86fa438d1344f5272752cc4.JPG

Link to comment

archedraft. It's only some lines that needs to be change to fit others configurations, and KVM it's Much  better than Xen! You don't need the script to enable/disable the GPU when shutting down the VM, overall KVM is better. We only need LT add correct configuration files for QEMU

 

 

Sent from my iPhone using Tapatalk 2

Link to comment

 

Success with vfio-pci on W7

 

First i bind the PCI device to vfio-pc ( I have a script for that)

 

 

Can/will you share your script?  I'm still not able to passthru anything to windows7

yes :-) when I am satisfied with this, later today maybe

 

 

Sent from my iPhone using Tapatalk 2

Link to comment

 

Success with vfio-pci on W7

 

First i bind the PCI device to vfio-pc ( I have a script for that)

 

 

Can/will you share your script?  I'm still not able to passthru anything to windows7

yes :-) when I am satisfied with this, later today maybe

 

 

Sent from my iPhone using Tapatalk 2

 

Thanks, I appreciate it!  It seems you and I are the only ones actively interested in pursuing KVM at the moment, and you're the only one having success ;)

Link to comment

Yeah, I just meant right now, we're the only customers working on using KVM with windows & GPU passthru.  I know LT is working on updating the patches and options for KVM (and XEN) in the next beta.  I hope they are able to release a beta (soon?) that has everything on the back end straightened out so that it's somewhat easy to get this working, and doesn't require such dedication to research to have a chance.

 

If they can get something that makes KVM as easy as XEN is/was to manage in the GUI, that will be a good next step.

 

If they can get some kind of 'wizard' or guided walk thru to help you set the right settings and options for you, then build the xml file in the background, that would be better still.

 

Either way, hopefully we can get a new beta with the updates to KVM and XEN implemented, so I (we) can get this working without so much trouble, then move on to the core features they have announced.

 

If they let more people get KVM and XEN working, they will get more feedback on what still needs improved, and can keep improving.

Link to comment

Yeah, I just meant right now, we're the only customers working on using KVM with windows & GPU passthru.  I know LT is working on updating the patches and options for KVM (and XEN) in the next beta.  I hope they are able to release a beta (soon?) that has everything on the back end straightened out so that it's somewhat easy to get this working, and doesn't require such dedication to research to have a chance.

 

If they can get something that makes KVM as easy as XEN is/was to manage in the GUI, that will be a good next step.

 

If they can get some kind of 'wizard' or guided walk thru to help you set the right settings and options for you, then build the xml file in the background, that would be better still.

 

Either way, hopefully we can get a new beta with the updates to KVM and XEN implemented, so I (we) can get this working without so much trouble, then move on to the core features they have announced.

 

If they let more people get KVM and XEN working, they will get more feedback on what still needs improved, and can keep improving.

 

Let me be clear on one thing, we do not want ANYONE to have to rely on SSH/console access to take advantage of these features.  However, this also isn't a "simple feature" to just throw in there.  We need to do more research and testing beforehand.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.