Accessing USB Drives in a Hyper-V VM


Even if you don’t work in a highly secure environment, you likely have a USB stash of utilities just as I do. Sure, I could copy the data from my USB to the VM or host but that takes time and unnecessary disk space or network bandwidth. Instead, I use a method suggested to me by one of my mentors, Mark Ghazai, to pass the USB drive through to the VM directly. This gives me instant access to the data without the extra network or disk space usage!

Target: Access USB drive from Hyper-V VM

Kill Shot: Use disk Pass-through method to present the USB drive directly to the VM

 

After you plug in your drive, open up disk management so you can take the USB drive offline

Right-click on the drive and select Offline

 

The drive should appear offline as seen below on your Hyper-V host where the VM is located

 

Now open up the settings on the VM you want to have access your USB drive. (note, you must have a SCSI controller available to add a drive to a running VM)

 

Click Add and select Physical hard disk: then choose your USB drive in the drop down. Click Ok

 

Now, log into the VM and open Disk Management. You should see the drive listed as offline. Right-click and select Online

 

You should now see the disk listed as online and accessible (note, my file system shows unknown because my drive is encrypted!)

 

If you open windows explorer, you should now see your USB drive listed

 

Special Thanks to Mark Ghazai for suggesting this!

Comments (46)

  1. Anonymous says:

    i think if you are using a usb flash pen it will not work.

  2. Anonymous says:

    Great

  3. Anonymous says:

    Worked for me. Thank you! Made my day easier.

  4. it-proje.com says:

    Great article, thanks a lot HollisWms.

    It didn't work for me, bu it helped me to find another easy way to mount a USB drive to VM on Hyper-V.

    Check it out

    http://www.gokhancanpolat.com/…/mount-usb-hyper-v-virtual-machine

    Regards,

    Gökhan

  5. grenache says:

    didn't work for me either.  Removeable drives don't have the Offline option.  The procedure works though if you want to connect a physical disk to a VM.

  6. grenache says:

    sorry, re the above, I was trying a USB flash drive.  It may be ok with a USB external disk, but I don't have one handy to try.

  7. Todd says:

    looked good and easy, but did not work.  I am not in server mode and runnig xp on hyper v in Windows 8 trying to back up data to a flash drive.  Last step would not copy flash to a vxd file.

  8. Devero says:

    I also don't have "Offline option". Someone know why?

  9. brett says:

    Worked like a charm for me thanks!!!

  10. lmeyer says:

    This sounds good, but in my case it is not possible to put offline my usb drive. In disk management GUI, the option does not display, and at the commandline diskpart tells that taking offline is not supported for removable media. How can I work around
    this ?

  11. Erik says:

    This worked perfectly for me and an External USB drive. I could offline it no problem. I think they were probably click in the in the wrong area.. it isn’t in a drop down you have to click on the side where it reads the drive letter and it worked perfectly. This saved me a lot of money. Thanks.

  12. Pedja says:

    Thanks for this instruction. It works quite good.

  13. Quirino says:

    The first step worked for me, i.e.: Taking the USB drive offline. but then doesn’t show up in the VM – offline or otherwise. Even after re-booting the VM no luck. Any idea why? I’m running W2k8R2 on both the Server and VM.

  14. Sameera Abar says:

    I would suggest that try installing WinSCP (SFTP and FTP client) on Windows 8 host-OS to easily access the data files from your Hyper-V’s virtual machine.

  15. Weston Renoud says:

    This wasn’t working for me on XP client. Come to find out SCSI Controller is not supported for XP. Using IDE Controller instead worked perfectly.

  16. Theresa McCoy says:

    Perfect! Worked like a charm!

  17. ML49448 says:

    Excellent! Thank you so much!

  18. JackQ says:

    this works like a charm. The key is to right click on the description section of the drive, not the partition UI section. Thanks.

  19. Valek says:

    Or you can share it over network. On host open USB drive properties. On Sharing tab setup Advanced sharing, choose name and check permissions. On VM right click on Computer > Map network drive and select your USB drive.

  20. bickyz says:

    For me:
    If I plug USB thumb drive then Offline option is not available
    If I plug USB External drive which has 2.5" or 3.5" hard-drive then Offline option is available

    Works with the USB External drive which has 2.5" or 3.5" hard-drive !!!

    thank you

  21. dharmendra singh dhakare says:

    thanks
    for sharing this article

  22. Harmik says:

    Thanks, helped me a lot. too easy,

  23. Gelu says:

    This saved me after 5 hours of searching all over the internet !!!
    Thank you so !

  24. Alexander Batishchev says:

    No, USB stick driver (not USB hard drive) can’t be taken offline.

  25. Jawidegan says:

    Thank u very much, worked perfectly.

  26. Wolfy says:

    Hi I did the steps.but in the last step when Im trying to make my external hard disk online it says access is denied.
    whats the problem?
    help me please.

  27. Wolfy says:

    Hi I did the steps.but in the last step when Im trying to make my external hard disk online it says access is denied.
    whats the problem?
    help me please.

  28. Wolfy says:

    Hi I did the steps.but in the last step when Im trying to make my external hard disk online it says access is denied.
    whats the problem?
    help me please.

  29. Wolfy says:

    Hi I did the steps.but in the last step when Im trying to make my external hard disk online it says access is denied.
    whats the problem?
    help me please.

  30. Shuja says:

    Thank you…….

  31. greg says:

    Strangely enough, I had the drive show up as an unknown device in windows 8.1 VM, I had to force the generic "disk drive" driver and it worked.

  32. Gary Hancock (MCSE) says:

    Perfect – works beautifully

  33. johnroster says:

    Thank you. I think this works only for NTFS formatted drives…The subject is covered on Page 200-201 in the Hyper-V resource kit book

  34. John says:

    Worked a treat.. Thank you..

  35. UncleXNL says:

    Files should be easy enough if the VM can be on the internet…. Install google drive! Not tried it yet but I will soon pretty sure it’s the perfect solution! 😉

  36. hafiz says:

    well done Sir.

  37. Wim says:

    This works great for a USB Disk.
    However a USB dongle or flash drive is seen as ‘removable’ and can not be set offline, defeating the whole process.

    Kind of a bummer when you need to transfer a software licence stored on a dongle … even more so when the licence needs to be stored on _their_ specific dongle hardware to be accepted. Even worse is when the dongle in question is not even seen as a drive but
    provides some kind special proprietary functionality. I’ve come across all three scenarios and found only an easy sollution for the first one.
    Meanwhile the big competitor of Hyper-V (you know who I’m talking about) does this perfectly out of the box with any usb drive/dongle.

  38. Matei Bogdan Radu says:

    Fantastic! Very helpful!

  39. Anthony says:

    Thanks! I first tried a flash drive but it didn’t work. Then I used WD Elements USB Drive. Work Great! Thanks!

  40. Dr Sylvester Benson says:

    GET YOUR PROBLEM SOLVE TODAY WITH MY PROFESSION IN ANY SPIRITUAL SPELL OR ANY KIND OF PHYSICAL BATTLE THAT NEED, MY NAME IS DR SYLVESTER AND THIS IS MY EMAIL FOR CONTACT (stbenson391@gmail.com) OR YOU CAN FOLLOW HIM UP ON FACEBOOK BY MY NAME (SYLVESTER E BENSON)
    ON FACEBOOK OR CALL ME ON MY MOBILE NUMBER +2348136090988, AM ALWAYS AVAILABLE TO RENDER YOU HELP WITH EXPERIENCE OF 32 YEARS IN SPELL CASTING AND HERBAL MEDICURE TO CURE ANY KIND OF DISEASE THAT YOU MAY HAVE, CONTACT ME ON ANY KIND OF ISSUES.

  41. MrZaius says:

    No "offline" option in Windows 10 – Got a workaround?

  42. MrZaius says:

    Also from Win 10:

    DISKPART> select disk 1

    Disk 1 is now the selected disk.

    DISKPART> offline disk

    Virtual Disk Service error:
    The operation is not supported on removable media.

  43. Mahesh Adate says:

    Thank you so much.it worked for me

  44. Ajith says:

    Superb… worked perfectly.

  45. Cloud-Ras says:

    Thank god! – i simply love the non-complexity of Hyper-V 🙂