[SOLVED] PCI Passthrough to VM for Blu-Ray Drives

PeanutPlays

Dabbler
Joined
Feb 20, 2023
Messages
13
Hello Everyone!

So I'm trying to setup a windows VM in TN Scale to handle me ripping my dvd and bluray collection onto my server.

I got the VM going just fine, but couldn't see the two optical drives. Makes sense, as I didn't add them as devices for the VM. So I popped into the devices tab and went to try to add them. But they're not in the list. So I clicked on PCI pass through, but all you get in there is that goofy list of 00.00.0, 00.01.0, etc.

So I found my way into here and went through This guide and turned on VT-d in my BIOS and made sure IOMMU was enabled, then stumbled across a post (that I can't seem to find now,) that talked about opening Shell and using
Code:
lspci
with the -v variable as well. As I read through the list, I couldn't find my bluray drive. So I got curious if TN was even aware they existed. I've got the tower open beside me and I know the SATA port is set up for hot plugging, so I reached in and unplugged it from the sata expansion card and ran
Code:
lspci
again.

lspci.png

Nothing changed. Except something did. I happened to have my server plugged into a monitor next to me and when I plugged the opti back in, I caught this:

TN Says Hello.jpg


So... TN knows what it is. But it's not showing it to me in the lspci dump. I have the VM talking to the world via the second 10Gb port on the card, so I know it can use hardware in the PCI slots.

I'm at a loss for what to do here. The simplest thing would be to just plug the optis into my gaming rig, but that tower doesn't have 5.25" bays on it. And I want this to be a set it and forget it operation where I just feed it a new disk every time the tray pops out.

For giggles I just grabbed an old PCI-4x Sata card and slapped it in. Booted up and nothing has changed.

Anyone have any ideas where I go from here?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Well, you will never be able to use PCI passthrough with a Blu-Ray drive, because it's not a PCI device.

What you can do is pass through a SATA controller (one that speaks ATAPI so that it can support the optical drive) and connect the drive to it.
 

PeanutPlays

Dabbler
Joined
Feb 20, 2023
Messages
13
Well, you will never be able to use PCI passthrough with a Blu-Ray drive, because it's not a PCI device.

What you can do is pass through a SATA controller (one that speaks ATAPI so that it can support the optical drive) and connect the drive to it.

They're plugged into my SATA controller. It's a StarTech ASM1062. Says it supports ATA and ATAPI
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
So setup passthrough of the SATA controller.
 

PeanutPlays

Dabbler
Joined
Feb 20, 2023
Messages
13
So setup passthrough of the SATA controller.
And now I'm feeling like more of an idiot than before.

In the last hour the only seemingly relevant posts I can find are this one and this one both from over 5 years ago. I did happen across this post where someone achieved what I'm trying to do, I guess I'll have to see if they are still watching that thread.

I spent half my time crawling through the TN Docs and I can't get anything about SATA pass through to come up. Am I this dumb, or am I not searching for the right thing?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
There might be something like SATA pass-through, but that would be a hack. You can forget about it.

The SATA controller to which the drives are attached is a PCIe device. Pass it through to the VM with PCI pass-through. The VM will see the controller and so things with it - in his specific case, set it up and enumerate the attached devices.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
But be careful that you don't need any of the other drives attached to that SATA controller for other things, as all connected drives will now move with the controller into the VM and be invisible to the host.
 

PeanutPlays

Dabbler
Joined
Feb 20, 2023
Messages
13
But be careful that you don't need any of the other drives attached to that SATA controller for other things, as all connected drives will now move with the controller into the VM and be invisible to the host.
@sretalla Yeah, I wasn't careful. I royally F*d that up. (And it occurred to me as I clicked on File Explorer that I just asked two OS's to control the same piece of hardware at once. I knew I F*d up the second I did it.)

5 of my 9 drives in the pool are on that same controller. I setup the passthru, relaunched the VM, and about 2 seconds after clicking on File Explorer in the VM, the array crashed and is now stuck in an infinite loop of mayhem. I can't get into the CLI or GUI fast enough to stop the auto run of the VM, so I shut it down for the night.

I'm hoping beyond all hope that I simply need to pull the boot device, look at it with some piece of software that looks deep at the lines, find the right line of code and change a value from TRUE to FALSE, and stop the VM from crashing the whole thing.

Needless to say I'm having a beer and a cigarette tonight. I'll send up flares for help in the morning when I'm better suited to have people try and walk me through fixing this. Probably using the command line, which is the thing that scares me most.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Just disconnect your pool disks and boot with only the boot pool drive present... fix your stuff and then re-connect the pool disks.
 

PeanutPlays

Dabbler
Joined
Feb 20, 2023
Messages
13
Just disconnect your pool disks and boot with only the boot pool drive present... fix your stuff and then re-connect the pool disks.
I wondered if that was doable. Decided to not try anything I thought might be a cute idea.

I'll let you know how it goes in the morning. I appreciate it, I'm less anxious now.
 

PeanutPlays

Dabbler
Joined
Feb 20, 2023
Messages
13
Well, that was infinitely easier than my panicky brain thought it would be @sretalla. The array is back and unharmed.

Put the bluray drives on a separate sata controller, passed it through, and the VM sees them just fine.

Preciate y'all!
 
Top