Jump to content
testdasi

Passthrough optical drives

10 posts in this topic Last Reply

Recommended Posts

I read some confusion information on the forum:

  • There's a thread which says unRAID does not have optical drive drivers and thus will never support passing through
  • There's another thread which says it's possible using "by-id" (which I can see on my rig e.g lrwxrwxrwx 1 root root  9 Apr 22 21:40 ata-PIONEER_BD-RW_BDR-207D -> ../../sr0) but then it refers to XEN, not KVM, I think.
  • Someone also said the only way is to passthrough optical drive is the entire sata controller.

Confused.com  :-\

Share this post


Link to post

I'm successfully passing through a BluRay drive to Win7/10 by adding the following to my XML

 

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

 

To pass though the following drive

 

[0:0:0:0]    disk    Lexar    JD FireFly       1100  /dev/sda 
...
[7:0:0:0]    cd/dvd  HL-DT-ST BD-RE  WH14NS40  1.03  /dev/sr0 

Share this post


Link to post

I tried. It doesn't work.  :'( VM starts fine (and I doubled check the hostdev section is in the xml) but nothing shows up in Windows.  :'(

Share this post


Link to post

Did you try looking in device manager for unidentified devices/scanning for new devices? I had to manually direct it to the virtio SCSI driver before the disc drive showed up.

Share this post


Link to post

Did you try looking in device manager for unidentified devices/scanning for new devices? I had to manually direct it to the virtio SCSI driver before the disc drive showed up.

Windows says the scsi driver on the virtio disk is not designed for my drive. I tried to install it regardless and the errored scsi device went away but no drive. :(

Share this post


Link to post

OMG I got it to work!!!!!! And it looks like Windows actually detected it as a Bluray writer too (put a blank Bluray in and it asks if I want to use it like a USB :D)!!!!!

 

I put this in the xml right before the </devices> tag:

Note the index = 1 and controller = 1 amendment. :D

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

 

The start the VM (which crashes but it crashes randomly due to lack of memory - oh well, running it in VMWare Workstation) and then install virtio scsi driver (which shows up as passthrough) for the 2nd no-driver scsi item - which windows just install the drivers on the virtio disk, no need to force it.

 

Then voila!

 

When I checked the xml again, unRAID has automatically rearranged the codes and changed it a little:

    <controller type='scsi' index='1' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </controller>
...
    <hostdev mode='subsystem' type='scsi' managed='no'>
      <source>
        <adapter name='scsi_host9'/>
        <address bus='0' target='0' unit='0'/>
      </source>
      <readonly/>
      <address type='drive' controller='1' bus='0' target='0' unit='0'/>
    </hostdev>

 

*there should be an emoji for celebration*  ;D

Share this post


Link to post

I am trying to get this to work myself but a little confused. I am trying to pass through

 

[7:0:4:0]    cd/dvd  PIONEER  BD-RW   BDR-208M 1.10  /dev/sr0 

 

Would this be correct?

<hostdev mode='subsystem' type='scsi'> 
   <source> 
     <adapter name='scsi_host7'/> 
     <address type='scsi' bus='0' target='4' unit='0'/> 
   </source> 
   <readonly/> 
   <address type='drive' controller='1' bus='0' target='4' unit='0'/> 
   </hostdev>

 

Share this post


Link to post

It looks like it did work but I'm not sure what controller='1' means.

 

Also initially I had two SCSI Controllers without drivers in Device Manager, once took the virtio drivers while the other doesn't. Now I have the Blu-ray drive showing up in Windows but I am not sure why I have this extra SCSI controller showing up.

Share this post


Link to post

Given how little discussion there is on passthrough drives, I figured it best to ask a related question here. I've mapped a BD drive to MakeMkV for ripping in discs, but a new thing has started happening. The drive automatically ejects when done ripping a disc as it always has, but now it automatically closes after a few minutes as well. Then it re-rips continually automatically opening and closing until I manually stop it. I could shut off automatic ejecting at MakeMKV, and just use the status light on the drive to tell quickly if it's done, but I like the eject to prompt a new disc insert. Any way you guys see of stopping automatic closing?

Share this post


Link to post

Using the similar code as above, without the recommended changes, I was able to see one SCSI Controller in Windows but I couldn't add the Virtio driver for it.  After adding the controller code, removing managed='no' from <hostdev>, and adding address controller='1', I was able to see two SCSI Controllers in Windows and able to add the Virtio driver for one of them which allowed me to see the DVD drive!! :)

 

Removing managed='no' is probably unnecessary as it gets added back but not sure.  Also, I'd tried going directly to the code which gets created after updating but it wouldn't work because I put 2 and instead it uses hex which turned out to be slot='0x0a'.

 

Thanks for sharing!!

Edited by bugsysiegals

Share this post


Link to post

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.