How to ACTUALLY pass-thru a USB flash drive to a Hyper-V server (not volume pass-thru, not networked pass-thru, not enhanced session)

asheroto
4 min readOct 12, 2021

--

March 5, 2022 Update:
I found a much simpler way to accomplish the same goal, check out my other article here.

Absurdity!

Is Hyper-V the only hypervisor that does not natively support USB flash drive device pass-thru? Sure, there’s enhanced session device pass-thru, but I’m talking about a true pass-thru of a removal device to the server itself, not through the Hyper-V client, not through networked-whatever…

I’m talking gimme the goods USB flash drive -> Hyper-V server!

Here’s the deal: Hyper-V will connect to drives that are removable…. that show up as hard drives…. but not flash drives.

The goal is to right-click on the drive, set it to offline, then let Hyper-V pick it up as a drive, right?

Don’t you want to just boot a Hyper-V server with a flash drive? That was my mission… let’s just see the magic…

I cannot give myself credit for any of this, I am merely a Googler… err.. DuckDuckGoer…. clicking through endless links until finally, I found something that works.

The trick is to change the driver of the flash drive. Credits go entirely to WindowsOSHub for their article, I will simply be summarizing.

There is a driver called “Hitachi Microdrive Filter Driver” that essentially makes the flash drive appear as a hard drive. I tested it and it works great….😀

Warning: you MUST keep test driver signing enabled, ideally, enable the F8 options so that if your system doesn’t boot you can always force disable driver signing at boot. Alternatively, just sign the driver.

Side note: shout out to Ventoy which is an AWESOME project (drop ISOs then boot).

Ventoy booting from a flash drive
Hyper-V Settings for Test Computer

It gets a tiny bit technical, but it’s not too complicated if you do it right.

Recommended: create a system restore point before changing drivers.

I’d like to give full credit where it is due, so please check out WinOSHub’s article for a detailed step-by-step:

WinOSHub Article

Summary of article:

  • You modify cfadisk.inf and replace this line where it appears… TWICE….

IDE\DiskTS64GCF400______________________________20101008

  • With the Device instance path of your flash drive
  • So mine ended up looking like this
  • If you want to rename the driver description, change the text quoted in the bottom line of the file — be careful, keep the quotes
  • In order to install the driver, you must disable driver signature enforcement and enable test signing, (or sign the driver with a self-signed certificate) otherwise you will get an error such as…

Windows found driver software for you device but encountered an error while attempting to install it
Hitachi Microdrive
The third-party INF does not contain digital signature information

  • I recommend using Solution 3 on this website. The only way I was able to successfully get driver signature enforcement disabled:
  • Hold the Shift key while restarting -> Troubleshoot -> Advanced -> Startup Settings -> Restart. Then when the computer booted, press 7 for “Disable Driver Signature Enforcement”. Once you do this, Windows should remain in this mode.
  • You MUST keep this off unless you remove the driver. Otherwise your system may not boot. You should enable the legacy F8 options before continuing just in case — see this article on how to do this. That way if you get an error when booting about cfadisk.inf, you can get around this F8, then disable driver signature enforcement. Then uninstall the driver and you should be able to reboot into normal mode again.
  • You then install the driver cfadisk.inf
Installing driver

Finally, open Disk Manager and set the disk to offline

Offline physical flash drive in Disk Management

In Hyper-V, add a hard drive to the SCSI Controller and specify your flash drive

Hyper-V Virtual Machine settings for flash drive (that it thinks is a hard drive)

😊😃😄😁Success!😂😸😀😎

IF for some reason you get a BSOD (I never did)… delete these two files:

cfadisk.sys in the folder %windir%\System32\drivers
“cfadisk.inf_amd64_…” in %windir%\System32\DriverStore\FileRepository

--

--

asheroto

🌎 Full Stack Developer 🔗 Systems Administrator 😎Innovation through Automation ✔ Privacy Advocate ♥ Startup Facilitator