none
How to attach a usb disk to a Hyper-V virtual machine

    Question

  • I am using Virtual Machine Connection with Server 2008 R2 and runing Win 7 on VM. I follow all steps and choose a Physical hard disk: and choose the disk i would to add n prob. But after that i cannot see him active in the VM Win 7. If i go back to Disk Management in Server 2008 is standing there as offline (and i cannot put it online here says ACESS DENIED) so please give some tips how to fix this.

    Thanks in advance
    Joao

    Monday, February 13, 2012 2:12 PM

Answers

  • Hi,

    You have the following options

    1. Offline the USB disk and then attach it to the virtual machine as pass-through disk.
    Note: Not all of the USB disk can be offline.

    2. Use Remote Desktop to bring the USB disk into the virtual machine

    Remoting devices into a Hyper-V child (virtual machine)
    http://itproctology.blogspot.com/2008/07/remoting-devices-into-hyper-v-child.html

    3. Use some USB over Ethernet application

    Important Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Best Regards,
    Vincent Hu

    Monday, February 13, 2012 4:30 PM
  • Hi!

    If you're connecting using remote desktop, you can attach the USB drive to your client machine, then select options in the Remote Desktop Connection application. Click "local resources", under "local devices and resources" you can click "More". A new window appears and you can check your USB drive under "Drives" in the resource tree.

    Tuesday, February 14, 2012 10:30 AM
  • And, not all USB disks can be presented to a VM as a passthrough disk.

    That is the important part.

    If the driver is strictly user mode the USB disk cannot be presented.  Only a select few devices presente themselves in a way that the system (outside the user session) can properly access and control the disk.


    Brian Ehlert (hopefully you have found this useful) http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Backup, test your backup, try new things. Attempting change is of your own free will.

    Monday, February 13, 2012 3:57 PM

All replies

  • Hi,

    If you would like use usb hard disk  in virtual machine in hyper-v , you should configure it as passthrough disk because USB is not supported in hyper-v, make the USB disk offline and configure it as passthrough disk, for mor information see here:Configuring Pass-through Disks in Hyper-V  ,How to: attach a usb disk to a Hyper-V virtual machine



    Best Regards




    Monday, February 13, 2012 2:42 PM
  • You can use the usb stick to contain an vhd, but not connect it as a disk.
    Monday, February 13, 2012 2:42 PM
  • And, not all USB disks can be presented to a VM as a passthrough disk.

    That is the important part.

    If the driver is strictly user mode the USB disk cannot be presented.  Only a select few devices presente themselves in a way that the system (outside the user session) can properly access and control the disk.


    Brian Ehlert (hopefully you have found this useful) http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Backup, test your backup, try new things. Attempting change is of your own free will.

    Monday, February 13, 2012 3:57 PM
  • Hi,

    You have the following options

    1. Offline the USB disk and then attach it to the virtual machine as pass-through disk.
    Note: Not all of the USB disk can be offline.

    2. Use Remote Desktop to bring the USB disk into the virtual machine

    Remoting devices into a Hyper-V child (virtual machine)
    http://itproctology.blogspot.com/2008/07/remoting-devices-into-hyper-v-child.html

    3. Use some USB over Ethernet application

    Important Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Best Regards,
    Vincent Hu

    Monday, February 13, 2012 4:30 PM
  • Hi Vincent,

    so after having some problems with Hyper-V with sound devices now i decide after so many suggestions and recomendations to go use Remote Desktop Connection and actually at least the sound device is working properly. Actually i also think this even faster interface but maybe i am wrong. Now is just the question with my external USB hard disks. How can i bring the USB disk into the virtual machine? I just want now to use the Remote Desktop Connection and do everything from where. Can you help?

    Regards,

    Joao

    Tuesday, February 14, 2012 10:24 AM
  • Hi!

    If you're connecting using remote desktop, you can attach the USB drive to your client machine, then select options in the Remote Desktop Connection application. Click "local resources", under "local devices and resources" you can click "More". A new window appears and you can check your USB drive under "Drives" in the resource tree.

    Tuesday, February 14, 2012 10:30 AM
  • I am using Virtual Machine Connection with Server 2008 R2 and runing Win 7 on VM. I follow all steps and choose a Physical hard disk: and choose the disk i would to add n prob. But after that i cannot see him active in the VM Win 7. If i go back to Disk Management in Server 2008 is standing there as offline (and i cannot put it online here says ACESS DENIED) so please give some tips how to fix this.

    Thanks in advance
    Joao

    If you don't need concurrent access to this particular USB drive from both host and VM then you may run some iSCSI target on your host and use iSCSI initiator inside VM to connect to this "mapped" disk. Latency and overhead should be moderate and you'll have a great benefit of accessing the drive over the network :)

    -nismo

    Tuesday, February 14, 2012 4:35 PM
  • Reading the above responses, that's fine for a current RDP session, but what I want to do is to setup a few VM's and test/separate out various devices.

    I wanted one VM that just did TV recordings for when I'm out, another that handled the security cameras I plan on installing, be they web cams or IP cameras.

    Yet another VM that had the only connection to the printer/scanner that was connected to the cloud.

    Realistically, I wanted to have various VM's that handled other devices as well as usb drives, but this seems to fail, just because I cannot add a device permanently.

    This in some ways seems to be a security risk, the VM cannot get access to potential virus's on a usb device but the server can !!

    The point of VM's for me is I can install all devices on separate VM's as required, back up these VM's frequently. If and only if the server dies and I loose the drive, I would only have to re-install the server and then attach back the VM's backup.

    Maybe I'm missing the point of usb not being able to attach permanently?

    Thanks for any solution


    Mike

    Thursday, October 17, 2013 10:42 AM
  • Reading the above responses, that's fine for a current RDP session, but what I want to do is to setup a few VM's and test/separate out various devices.

    I wanted one VM that just did TV recordings for when I'm out, another that handled the security cameras I plan on installing, be they web cams or IP cameras.

    Yet another VM that had the only connection to the printer/scanner that was connected to the cloud.

    Realistically, I wanted to have various VM's that handled other devices as well as usb drives, but this seems to fail, just because I cannot add a device permanently.

    This in some ways seems to be a security risk, the VM cannot get access to potential virus's on a usb device but the server can !!

    The point of VM's for me is I can install all devices on separate VM's as required, back up these VM's frequently. If and only if the server dies and I loose the drive, I would only have to re-install the server and then attach back the VM's backup.

    Maybe I'm missing the point of usb not being able to attach permanently?

    Thanks for any solution


    Mike

    Use Tape Redirector a free product from my company. It does add iSCSI to any storage device (including USB) and you'd be able to use it over iSCSI from any physical or virtual machine from any place inside your network. See:

    http://www.starwindsoftware.com/download-starwind-tape-redirector

    Hope this helped :)


    StarWind iSCSI SAN & NAS

    Thursday, October 17, 2013 3:31 PM
  • I've installed Starwinds Tape Redirector on a physical server Windows 2012 R2. Could you please link me to instructions on how to add an external USB as a device in the software.

    DO I also need to install Tape Redirector on the Server 2012 R2 VM as well?

    I wouldn't think so since it can be configured in the VM Settings.

    Monday, January 06, 2014 5:01 PM
  • Hi Vincent  and other readers,

    Another solution might be creating a vhd(x) from the usb disk and attach it to the hyper-v machine?

    With disk2vhd (http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx) it's an easy solution.

    Best regards,

    Peter

    • Proposed as answer by PeterVeen Monday, May 12, 2014 9:36 PM
    Monday, May 12, 2014 9:36 PM