Jump to content
The Unraid Annual Cyber Weekend Sale is here 🔥 ×

[SOLVED] Windows 10 VM issues with Graphic Card - Passthrough


Recommended Posts

Posted

Hello everyone,

I have recently started working with unRaid and would like to build my own server at home. This server will later be used as data storage and for my smarthome. So far I could already implement everything. But there is one thing I am currently failing at. I can't manage to build a Windows VM.

This is my current hardware:

 

Mainboard: MSI Z370M GAMING PRO AC
Processor: Intel Core i5 8400
Graphics Card: 8GB Sapphire Radeon RX 580 Pulse
RAM: 16GB G.Skill DDR4 RAM - DDR4-3200
Case: Corsair Carbide Air 240

 

Parity Disk: WD Red 4TB WD40EFAX
Cache: 970 EVO internal SSD 250 GB NVMe M.2

Data Disk 1: WD Red 4TB WD40EFAX
Data Disk 2: Seagate NAS HDD - 4 TB (ST4000VN000

 

Active Windows install: 970 EVO internal SSD 250 GB NVMe M.2
Windows Data: 860 EVO internal SSD 250GB (data)

 

The hardware previously ran a Windows / Hackintosh dual boot system. Now the computer should only be used as server. I would like to use the existing Windows installation as a VM in unRaid. Using a NUC8i5BEH with macOS I would like to access the Windows VM remotely. I want to use my graphics card for Gaming on the Windows VM. Unfortunately I fail to loop my graphics card through to the Windows VM. As VBIOS I use the following: https://www.techpowerup.com/vgabios/208710/sapphire-rx580-8192-180719 

 

I also made the "multifunction" adjustments to the XML file from this video. https://www.youtube.com/watch?v=QlTVANDndpM&t=505s

 

The Windows VM starts up to the TianoCore screen and then the boot process freezes. It won't continue and i have to turn off the VM hard.

Here is the XML file with my configuration. I have activated VT-D in the Bios. Can somebody help me? 

 

Unfortunately I do not know myself with the matter and therefore I hope for your help.


Pixelpaule

 

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>012b6162-9ec1-271c-352f-c279d1242961</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>12582912</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='3'/>
    <vcpupin vcpu='4' cpuset='4'/>
    <vcpupin vcpu='5' cpuset='5'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/012b6162-9ec1-271c-352f-c279d1242961_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='6' threads='1'/>
    <cache mode='passthrough'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/isos/virtio-win-0.1.173-2.iso'/>
      <target dev='hdb' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/nvme0n1'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='nec-xhci' ports='15'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:c1:ec:6a'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='de'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <rom file='/mnt/cache/isos/Sapphire.RX580.8192.171120.rom'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
</domain>

5546541_Bildschirmfoto2020-07-09um09_57_18.thumb.png.8ac95818f914e14faa279a14bdf9e86f.png

 

This is the Logfile:

-overcommit mem-lock=off \
-smp 6,sockets=1,cores=6,threads=1 \
-uuid 012b6162-9ec1-271c-352f-c279d1242961 \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=32,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=localtime \
-no-hpet \
-no-shutdown \
-boot strict=on \
-device nec-usb-xhci,p2=15,p3=15,id=usb,bus=pci.0,addr=0x7 \
-device ahci,id=sata0,bus=pci.0,addr=0x5 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 \
-blockdev '{"driver":"file","filename":"/mnt/user/isos/virtio-win-0.1.173-2.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}' \
-device ide-cd,bus=sata0.1,drive=libvirt-2-format,id=sata0-0-1 \
-blockdev '{"driver":"host_device","filename":"/dev/nvme0n1","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \
-device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,bootindex=1,write-cache=on \
-netdev tap,fd=35,id=hostnet0,vhost=on,vhostfd=36 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:c1:ec:6a,bus=pci.0,addr=0x3 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,fd=37,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-vnc 0.0.0.0:0,websocket=5700 \
-k de \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
-device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,multifunction=on,addr=0x6,romfile=/mnt/cache/isos/Sapphire.RX580.8192.171120.rom \
-device vfio-pci,host=0000:01:00.1,id=hostdev1,bus=pci.0,addr=0x6.0x1 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
2020-07-09 07:55:26.192+0000: Domain id=1 is tainted: high-privileges
2020-07-09 07:55:26.192+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)
2020-07-09T07:55:27.093210Z qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,id=hostdev0,bus=pci.0,multifunction=on,addr=0x6,romfile=/mnt/cache/isos/Sapphire.RX580.8192.171120.rom: Failed to mmap 0000:01:00.0 BAR 0. Performance may be slow
2020-07-09T07:58:10.680399Z qemu-system-x86_64: terminating on signal 15 from pid 4455 (/usr/sbin/libvirtd)
2020-07-09 07:58:12.081+0000: shutting down, reason=destroyed

 

Posted

Perhaps try this.

Go to your motherboard BIOS and turn on the iGPU. Then connect your monitor to the port on the motherboard and boot up - make sure Unraid boots with the iGPU display.

Then look for SpaceInvader One video on how to dump your vbios and dump your own for the 580. Then try that.

 

Reason: (a) the 580 is notorious on here for not liking passthrough if it has been booted with Unraid and (b) there are 7 different versions of the 580 Pulse and the vbios has to be super specific hence the best way to do it is to dump your own.

  • 1 month later...
Posted

Thank you for your answer. Sorry to be so late, but I've been very busy these past few weeks. The Windows VM is now running on my computer. After I activated the iGPU and created the VBIOS of my graphics card, I could boot the Windows 10 VM without any problems. Even a newly installed Windows VM is now running without problems. Thanks for your help!

  • JorgeB changed the title to [SOLVED] Windows 10 VM issues with Graphic Card - Passthrough

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.

×
×
  • Create New...