How to add a USB disk to a Windows 2012 Hyper-V VM

Windows Server 2012 R2

In this post I’ll show you how to mount a USB drive inside a Hyper-V virtual machine.

If you work in an environment where USB drives are allow to be used with servers this can be quite a handy way of getting access to external storage from within a vm. It’s a very useful way of seeding initial copies of backup data.

1. Attach the USB drive to the Hyper-V host server.

Disk Management2. Right click the USB disk (in our case Disk 1) and select Offline.

Disk Manager - Disk 1 - Offline

3. Disk 1 is now offline.

Disk Manager - Offline

4. Select the vm Settings of the vm that you want to Add the USB drive to and select the SCSI Controller, highlight Hard Drive and click Add.

VM Settings - SCSI - Add Hard Drive

5. Select Physical hard disk, using the pull down menu you should see the offiline disk on the host available to you, select it and click Apply, click OK.

VM Settings - SCSI - Add Hard Drive - Physical Hard Drive

6. Within the vm start Server Manager, select the Tools menu, and select Computer Management, expand Disk Management, and you should the USB disk is offline. Right click Disk 2, and select Online.

VM Disk Management - Online

7. You can now see the disk in File Explorer on the VM and can copy data to and from it.

USB disk mounted in VM on Hyper-V

To dismount the disk perform the following steps.

1. In the VM go to Disk Management, and select Disk 2 (in this example) and set to Offline.

2. In the Settings of the VM, expand SCSI Controller, and select the Hard Drive that you have used to mount the USB disk. Click Remove, Apply, OK.

3. Right Click the USB icon in the System Tray and select Eject.

Related Posts:

1. How to Inspect and Edit virtual disks in Hyper-V

2. How to create a Hyper-V VM template without VMM

3. How to convert a Hyper-V VHDX to VMDK for VMware Workstation

4. Windows update fails on Hyper-V 2012 R2 generation 2 virtual machines

5. PowerShell: Get-ADComputer to retrieve computer last logon date – part 1

8 thoughts on “How to add a USB disk to a Windows 2012 Hyper-V VM

  1. Savas Papadopoulos

    Great article!
    This is an interesting method, never thought of it. I have seen the USB sharing feature in VMware, which can be quite annoying by the way as it ‘steals’ the USB connection and puts it into the VM when you want it on the host.
    I would like to add that sharing a host partition with the VM has a drawback: live backups won’t be possible when using that particular VM (ie. the USB portion won’t be backed up) as the VSS on the host can’t control that partition when it’s in use by the VM.
    Another question is: does this method work when the USB drive changes drive letters (as they commonly do)?

    Reply
  2. Jim

    Just tried this with Windows 8.1 Enterprise running Hyper-V with the latest updates. The diskmanager does not give you the option to Offline the USB drive. I had to use Action->Create Virtual Disk and attach the resulting .vhd file.

    Reply
  3. CSRTech

    Holy Crap! That’s a convoluted way to do a simple USB passthrough to a VM. Microsoft needs to see how simple it is in VirtualBox

    Reply
    1. OxfordSBSguy.com

      Hi Andy, this is an improvement to 2012 R2, if you are using just 2012 then the method above is the only way I am aware of. I’ll update the post to include the enhanced session mode of 2012 R2. Thanks for the link.

      Reply
  4. Joaquim Domingues

    Hi.
    Very nice, but is it really necessary to put the USB disk offline?
    I did it and now can not have it online again.
    I had 17 disks (as seen from my hosts), then when I connected the USB disk I got to 18, now back to 17.
    I see the disk in Device Manager if I choose to see Hidden Devices,but can not have it online again!
    How I solve this?

    BR

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *