Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Blu-ray / DVD ROM Passthrough

Featured Replies

I was trying to get access to my Blu-Ray drive from a Windows 7 VM under XEN. Here is the initial threat: http://lime-technology.com/forum/index.php?topic=32344.0

 

Since jonp gave the advise to give KVM a try ("....with Xen, I can't help much because I'm not touching it much anymore except making sure it "works" from beta to beta.  With KVM though, this is very simple to do using either webvirtmgr or virt-manager.") I migrated my two VMs to KVM and I do see the following messages in syslog (I used VMM on Ubuntu on another machine to passthrough my Adaptec 1220SA that has just the Blu-Ray drive attached):

 

Sep 30 09:45:16 Tower kernel: sata_sil24 0000:03:00.0: enabling device (0400 -> 0403)
Sep 30 09:45:16 Tower kernel: scsi10 : sata_sil24
Sep 30 09:45:16 Tower kernel: scsi11 : sata_sil24
Sep 30 09:45:16 Tower kernel: ata17: SATA max UDMA/100 host m128@0xdfa84000 port 0xdfa80000 irq 16
Sep 30 09:45:16 Tower kernel: ata18: SATA max UDMA/100 host m128@0xdfa84000 port 0xdfa82000 irq 16
Sep 30 09:45:18 Tower php: Stopping libvirtd...
Sep 30 09:45:18 Tower php: 
Sep 30 09:45:18 Tower kernel: ata17: SATA link up 1.5 Gbps (SStatus 113 SControl 0)
Sep 30 09:45:18 Tower kernel: ata17.00: failed to IDENTIFY (INIT_DEV_PARAMS failed, err_mask=0x80)
Sep 30 09:45:20 Tower kernel: ata17: SATA link up 1.5 Gbps (SStatus 113 SControl 0)
Sep 30 09:45:20 Tower kernel: ata17.00: ATAPI: HL-DT-ST BD-RE BH10LS30, K93A7ME5937, 1.02, max UDMA/133
Sep 30 09:45:20 Tower kernel: ata17.00: configured for UDMA/100
Sep 30 09:45:20 Tower kernel: scsi 10:0:0:0: CD-ROM HL-DT-ST BD-RE BH10LS30 1.02 PQ: 0 ANSI: 5
Sep 30 09:45:20 Tower kernel: sr0: scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray
Sep 30 09:45:20 Tower kernel: sr 10:0:0:0: Attached scsi CD-ROM sr0
Sep 30 09:45:20 Tower kernel: sr 10:0:0:0: Attached scsi generic sg2 type 5
Sep 30 09:45:22 Tower kernel: ata18: SATA link down (SStatus 0 SControl 0)

Windows device manager is showing the controller I was able to install the driver but the controller isn't starting up (Code 10). This was working under XEN  :(

 

Was anyone managing to exclusively attached a drive to a VM?

Can you show me your XML for this?  You can get to it under /etc/libvirt/qemu/domainname.xml if you used a virtualization manager to build it.

  • Author

Sure jonp, here you are. It would be great to avoid passing through the controller but only the Blu-ray drive.

Sure jonp, here you are. It would be great to avoid passing through the controller but only the Blu-ray drive.

 

I got you covered.  Here's what I want you to do:

 

Go to command line and type:

 

lsscsi

 

You should get a list like this:

 

[0:0:0:0]    disk    Corsair  Flash Voyager    1100  /dev/sda

[1:0:0:0]    disk    ATA      ST32000542AS    CC34  /dev/sdb

[2:0:0:0]    disk    ATA      ST4000DM000-1F21 CC52  /dev/sdc

[3:0:0:0]    disk    ATA      WDC WD20EARS-00M AB50  /dev/sdd

[6:0:0:0]    disk    ATA      PLEXTOR PX-128M3 1.01  /dev/sde

[7:0:0:0]    disk    ATA      ST4000DM000-1F21 CC52  /dev/sdf

[8:0:0:0]    disk    ATA      WDC WD20EARS-00M AB50  /dev/sdg

[9:0:0:0]    disk    ATA      WDC WD40EZRX-00S 0A80  /dev/sdh

[10:0:0:0]  disk    ATA      ST4000DM000-1F21 CC52  /dev/sdi

[12:0:0:0]  cd/dvd  HL-DT-ST BD-RE  WH14NS40  1.01  /dev/sr0

 

Ok, now look for something that looks like the bolded red part above.  Then you need to transpose the red part into this:

 

<controller type='scsi' index='0' model='virtio-scsi'/>

    <hostdev mode='subsystem' type='scsi'>

      <source>

        <adapter name='scsi_host12'/>

        <address type='scsi' bus='0' target='0' unit='0'/>

      </source>

      <readonly/>

      <address type='drive' controller='0' bus='0' target='0' unit='0'/>

    </hostdev>

 

Put all of the above somewhere in your XML between <devices> and </devices>.  Then use webvirtmgr and create an instance from XML and copy / paste the entire XML content into there.  Should work like a charm and no PCI device pass through necessary.

 

Your complete win7.xml file should look something like this (new part bolded black and red part for text to replace with values from your system):

 

<!--

WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE

OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:

  virsh edit win7

or other application using the libvirt API.

-->

 

<domain type='kvm'>

  <name>win7</name>

  <uuid>de4c018a-ba87-4f55-a702-8fadfc53e147</uuid>

  <description>None</description>

  <memory unit='KiB'>2097152</memory>

  <currentMemory unit='KiB'>2097152</currentMemory>

  <vcpu placement='static'>2</vcpu>

  <resource>

    <partition>/machine</partition>

  </resource>

  <os>

    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>

    <boot dev='cdrom'/>

  </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/cache/.VMs/win7/win7.qcow2'/>

      <target dev='vda' bus='virtio'/>

      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>

    </disk>

    <controller type='scsi' index='0' model='virtio-scsi'/>

    <hostdev mode='subsystem' type='scsi'>

      <source>

        <adapter name='scsi_host12'/>

        <address type='scsi' bus='0' target='0' unit='0'/>

      </source>

      <readonly/>

      <address type='drive' controller='0' bus='0' target='0' unit='0'/>

    </hostdev>

 

    <controller type='sata' index='0'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>

    </controller>

    <controller type='pci' index='0' model='pcie-root'/>

    <controller type='pci' index='1' model='dmi-to-pci-bridge'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>

    </controller>

    <controller type='pci' index='2' model='pci-bridge'>

      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>

    </controller>

    <controller type='usb' index='0' model='none'/>

    <interface type='bridge'>

      <mac address='00:16:3e:a1:bc:a5'/>

      <source bridge='br0'/>

      <model type='virtio'/>

      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>

    </interface>

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

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

    <graphics type='vnc' port='5900' autoport='no' listen='0.0.0.0'>

      <listen type='address' address='0.0.0.0'/>

    </graphics>

    <video>

      <model type='cirrus' vram='9216' heads='1'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>

    </video>

    <hostdev mode='subsystem' type='pci' managed='yes'>

      <driver name='vfio'/>

      <source>

        <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>

      </source>

      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>

    </hostdev>

    <memballoon model='virtio'>

      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>

    </memballoon>

  </devices>

</domain>

  • Author

lsscsi was showing:

[0:0:0:0]    disk    Kingston Reader     SD/MS 0200  /dev/sda 
[0:0:0:1]    disk    Kingston Reader  MicSD/M2 0200  /dev/sdb 
[2:0:0:0]    disk    ATA      TOSHIBA DT01ACA3 ABB0  /dev/sdd 
[2:0:1:0]    disk    ATA      WDC WD30EFRX-68E 0A80  /dev/sde 
[2:0:2:0]    disk    ATA      WDC WD20EARX-00P AB51  /dev/sdf 
[2:0:3:0]    disk    ATA      WDC WD20EARX-00P AB51  /dev/sdg 
[2:0:4:0]    disk    ATA      TOSHIBA DT01ACA3 ABB0  /dev/sdh 
[2:0:5:0]    disk    ATA      WDC WD15EARS-00S 0A80  /dev/sdi 
[2:0:6:0]    disk    ATA      TOSHIBA DT01ACA3 ABB0  /dev/sdj 
[2:0:7:0]    disk    ATA      WDC WD30EFRX-68E 0A82  /dev/sdk 
[4:0:0:0]    disk    ATA      MR2020- 2S-S2R R 18.1  /dev/sdc 
[12:0:0:0]   cd/dvd  HL-DT-ST BD-RE  BH10LS30  1.02  /dev/sr0 

 

I copy & pasted the whole xml part that you attached (with the address 12 from above) into the xml editor of WebVirtManager and saved it. I was getting this error code via WebVirtManager:

internal error: Failed to open /sys/bus/scsi/devices/12:0:0:0/scsi_generic

 

I tried it again 2 times and lsscsi was showing an increment of 2, that means

[14:0:0:0]   cd/dvd  HL-DT-ST BD-RE  BH10LS30  1.02  /dev/sr0 

after the second and

[16:0:0:0]   cd/dvd  HL-DT-ST BD-RE  BH10LS30  1.02  /dev/sr0

after the third try.

 

I have attached the xml and the syslog.

The plot thickens!!  Try this.  Save the XML I gave you somewhere on the server, login via console and type "virsh create win7.xml" (as opposed to copy and paste in web virt mgr).  Just want to see if this is an issue with how libvirt imports the domain.

Oh and when you say XML editor, do you mean you are trying to edit the existing VM?  If so, try creatinh a new "instance" from XML and pasting it in that way.  Editing existing XML from web virt mgr and creating a new instance are a little different in their operation...

  • Author

lsscsi was showing: [20:0:0:0]  cd/dvd  HL-DT-ST BD-RE  BH10LS30  1.02  /dev/sr0. Here are the steps that I took:

  • generated another UUID
  • copied the whole win7 folder - incl. both files - xml and qcow2 into a new directory (windows7)
  • virsh create windows7.xml

Error message:

error: Failed to create domain from windows7.xml
error: internal error: Failed to open /sys/bus/scsi/devices/20:0:0:0/scsi_generic

 

lsscsi is now showing: [22:0:0:0]  cd/dvd  HL-DT-ST BD-RE  BH10LS30  1.02  /dev/sr0

Wtf.  This is really weird. I have a friend of mine who has this working no problem, but I need to take another look at his setup.  We will get to the bottom of this.

  • Author

Thanks jonp, I'm going to try the same procedure tomorrow on my test server. Maybe better luck there.

 

[EDIT] Sorry to say but it's working on my backup server either:

lsscsi:

[0:0:0:0]    disk    Flash    Drive SM_USB20   1100  /dev/sda 
[1:0:1:0]    cd/dvd  HL-DT-ST DVDRAM GH24NS95  RN01  /dev/sr0 
[3:0:0:0]    disk    ATA      KINGSTON SV100S2 225a  /dev/sdb 
[4:0:0:0]    disk    ATA      WDC WD20EARS-00M AB51  /dev/sdc 
[5:0:0:0]    disk    ATA      WDC WD10EAVS-00D 1A01  /dev/sdd 
[6:0:0:0]    disk    ATA      Hitachi HDS72101 A3EA  /dev/sde 
[7:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdf 

I deleted the instance via WebVirtManager and redefined it via "New Instance". Have used /etc/libvirt/qemu/win8.xml as template (copy&paste) and added:

<controller type='scsi' index='0' model='virtio-scsi'/>
    <hostdev mode='subsystem' type='scsi'>
      <source>
        <adapter name='scsi_host1'/>
        <address type='scsi' bus='0' target='1' unit='0'/>
      </source>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>

Full xml file (if have used it with <address type='drive' controller='0' bus='0' target='0' unit='0'/> and <address type='drive' controller='0' bus='1' target='0' unit='0'/>, same result):

internal error: Failed to open /sys/bus/scsi/devices/1:0:1:0/scsi_generic 

<domain type='kvm'>
  <name>win8</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdaa9d</uuid>
  <description>None</description>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='cdrom'/>
  </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/cache/.VMs/win8/win8.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'/>
        <hostdev mode='subsystem' type='scsi'>
          <source>
            <adapter name='scsi_host1'/>
            <address type='scsi' bus='0' target='1' unit='0'/>
          </source>
          <readonly/>
          <address type='drive' controller='0' bus='1' target='0' unit='0'/>
        </hostdev>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='none'/>
    <controller type='ide' index='0'/>
    <interface type='bridge'>
      <mac address='02:16:3e:1a:b3:4a'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Meanwhile lsscsi is showing:

[0:0:0:0]    disk    Flash    Drive SM_USB20   1100  /dev/sda 
[3:0:0:0]    disk    ATA      KINGSTON SV100S2 225a  /dev/sdb 
[4:0:0:0]    disk    ATA      WDC WD20EARS-00M AB51  /dev/sdc 
[5:0:0:0]    disk    ATA      WDC WD10EAVS-00D 1A01  /dev/sdd 
[6:0:0:0]    disk    ATA      Hitachi HDS72101 A3EA  /dev/sde 
[7:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdf 
[13:0:1:0]   cd/dvd  HL-DT-ST DVDRAM GH24NS95  RN01  /dev/sr0 

Weird.... :o

OK, let me make sure I'm hearing you right.  You're telling me this is happening on two separate systems the same way?  Different hardware too (e.g. different DVD drive)? OK, something is definitely out of whack here. 

  • Author

Exactly - please see my signature and you can see what HW/SW environment is involved.

 

[EDIT:] I have just discovered, that I haven't answered all of your questions:

1.) [2:0:0:0]    cd/dvd  HL-DT-ST BD-RE  BH10LS30  1.02  /dev/sr0 (this is the Blu-Ray Drive installed in my production server)

2.) [1:0:1:0]    cd/dvd  HL-DT-ST DVDRAM GH24NS95  RN01  /dev/sr0 is a simple DVD Drive installed in my test/backup server.

 

Btw, have you seen that lsscsi was again showing a different address?

 

 

  • 4 weeks later...
  • Author

I was giving the DVD Drive passthrough another try....strange enough, it was working this time - at least partially.

 

The Red Hat VirtIO SCSI pass-through controller entry in Windows device overview is new. Since then the DVD drive is shown under DVD/CD-ROM-Drives.

 

However, I don't have proper access to it. When I'm loading a CD I see the tracks but it isn't playing any. Instead Windows is showing an I/O Error.

 

[EDIT] Here are the respective syslog entries:

Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Result: hostbyte=0x00 driverbyte=0x08
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Sense Key : 0x5 [current] 
Oct 31 09:28:20 Tower kernel: Info fld=0x0, ILI
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: ASC=0x64 ASCQ=0x0
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0] CDB: 
Oct 31 09:28:20 Tower kernel: cdb[0]=0x28: 28 00 00 00 00 00 00 00 02 00
Oct 31 09:28:20 Tower kernel: end_request: I/O error, dev sr0, sector 0
Oct 31 09:28:20 Tower kernel: Buffer I/O error on device sr0, logical block 0
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Result: hostbyte=0x00 driverbyte=0x08
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Sense Key : 0x5 [current] 
Oct 31 09:28:20 Tower kernel: Info fld=0x0, ILI
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: ASC=0x64 ASCQ=0x0
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0] CDB: 
Oct 31 09:28:20 Tower kernel: cdb[0]=0x28: 28 00 00 00 00 00 00 00 02 00
Oct 31 09:28:20 Tower kernel: end_request: I/O error, dev sr0, sector 0
Oct 31 09:28:20 Tower kernel: Buffer I/O error on device sr0, logical block 0
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Result: hostbyte=0x00 driverbyte=0x08
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Sense Key : 0x5 [current] 
Oct 31 09:28:20 Tower kernel: Info fld=0x0, ILI
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: ASC=0x64 ASCQ=0x0
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0] CDB: 
Oct 31 09:28:20 Tower kernel: cdb[0]=0x28: 28 00 00 00 00 00 00 00 02 00
Oct 31 09:28:20 Tower kernel: end_request: I/O error, dev sr0, sector 0
Oct 31 09:28:20 Tower kernel: Buffer I/O error on device sr0, logical block 0
Oct 31 09:28:20 Tower kernel: sr 3:0:0:0: [sr0]  
Oct 31 09:28:20 Tower kernel: Result: hostbyte=0x00 driverbyte=0x08

 

  • 1 month later...

I am not having any luck with this. Is it because I am using the qemu:arg template? My template will not save when I click "Add XML".

 

 

[0:0:0:0]    disk             Patriot Memory   PMAP  /dev/sda
[1:0:0:0]    disk    ATA      TOSHIBA DT01ACA2 ABB0  /dev/sdb
[2:0:0:0]    disk    ATA      ST31000333AS     CC1F  /dev/sdc
[3:0:0:0]    disk    ATA      WDC WD7500BPKX-0 1A01  /dev/sdd
[4:0:0:0]    disk    ATA      WDC WD10EACS-00Z 1B01  /dev/sde
[5:0:0:0]    cd/dvd  PLEXTOR  DVDR   PX-755A   1.07  /dev/sr0
[6:0:0:0]    disk    ATA      WDC WD30EFRX-68E 0A80  /dev/sdf
[7:0:0:0]    disk    ATA      Samsung SSD 840  BB0Q  /dev/sdg

 

<controller type='scsi' index='0' model='virtio-scsi'/>
    <hostdev mode='subsystem' type='scsi'>
      <source>
        <adapter name='scsi_host5'/>
        <address type='scsi' bus='0' target='0' unit='0'/>
      </source>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>Windows-8-Nvidia-DVD2</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdba9d</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='2' cores='2' threads='1'/>
  </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='raw'/>
      <source file='/mnt/vmdisk/vm_images/default/windows8.img'/>
      <target dev='hda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </disk>
    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:00:00:04'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </interface>
    <controller type='scsi' index='0' model='virtio-scsi'/>
        <hostdev mode='subsystem' type='scsi'>
          <source>
            <adapter name='scsi_host5'/>
            <address type='scsi' bus='0' target='0' unit='0'/>
          </source>
          <readonly/>
          <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>
    <input type='tablet' bus='usb'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </memballoon>
  </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=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1a.0,bus=root.1,addr=00.1'/>
  </qemu:commandline>
</domain>

So I got it working by using the following code, DVD drive shows up in windows, now to test and see if it will play something.

 

    <hostdev mode='subsystem' type='scsi' managed='no'>
      <source>
        <adapter name='scsi_host5'/>
        <address bus='0' target='0' unit='0'/>
      </source>
      <readonly/>
      <alias name='hostdev1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>

  • Author

archedraft, if you are using Windows, please don't miss to install the virtio pass-through controller driver (see screenshot).

 

I do see the drive in explorer, device manager, etc. but still no luck accessing the drive e.g. with MakeMKV:

Fehler 'SCSI-Fehler - ILLEGAL REQUEST:INVALID FIELD IN CDB' trat auf während der Übertragung des SCSI-Befehls 460200010..00100 zu Laufwerk 'SPTI:\Device\CdRom0'

 

Also VLD doesn't play any DVD

QEMU 2.2 (recently released) has improved the virtio-scsi passthrough so that may solve these issues.  This will be included in one of the future beta versions.

  • Author

Good news, thanks eschultz.

Thought I would respond and say that my dvd drive also does not function properly. It loads the cd fine but once you try and do anything with the cd it freaks out. Hopefully the new QEMU fixes the issues, it's not critical to have the dvd drive but I would like to have the option.

  • 2 months later...
  • Author

As far as I can see, we have QEMU 2.2 implemented in Beta13. Is there anything that I missed, as I can't see that the issue has disappeared. Any advise? Thanks a lot.

As far as I can see, we have QEMU 2.2 implemented in Beta13. Is there anything that I missed, as I can't see that the issue has disappeared. Any advise? Thanks a lot.

 

Might have some updated things for you to try after we get to beta14.  Laser focused on getting that release out right now.

  • 2 weeks later...

You can try the rawio='yes' attribute in the hostdev tag (and possibly managed='no'):

 

<devices>
  ...

  <controller type='scsi' index='0' model='virtio-scsi'/>

  <hostdev mode='subsystem' type='scsi' managed='no' rawio='yes'>
    <source>
      <adapter name='scsi_host12'/>
      <address type='scsi' bus='0' target='0' unit='0'/>
    </source>
    <readonly/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  </hostdev>

  ...
</devices>

  • Author

Thanks eschultz, I added the rawio item, but no changes. I see the drive, directories and files but as soon as I'm starting e.g. MakeMKV it is showing the same error:

Fehler 'SCSI-Fehler - ILLEGAL REQUEST:INVALID FIELD IN CDB' trat auf während der Übertragung des SCSI-Befehls 460200010..00100 zu Laufwerk 'SPTI:\Device\CdRom0'

Same result on both servers. No errors in unRAID log. Can I help investigating in any way? Please advise. Thanks a lot.

  • 3 months later...

Any update on this? Were you able to get it working? I'd like to move from ESXi to unRAID for my Windows VM that has a BD-ROM attached.

Any update on this? Were you able to get it working? I'd like to move from ESXi to unRAID for my Windows VM that has a BD-ROM attached.

It's working for me, but only with certain software and reduced speed compared to not virtualized windows.

Dvdfab and anydvd HD works. Makemkv does not work. It can scan the disc and find tracks, but gets stuck analysing the segments and never starts copying to disk.

Power DVD worked, but lagged a lot.

Hopefully I can get a USB 3 to sata adapter to work when passing through the USB 3 controller.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.