This article covers how to connect an existing internal drive or external USB drive to a virtual machine (VM) in Windows Hyper-V.
A host PC and VM PC cannot have simultaneous access to an internal drive or USB drive. So we need to first set the desired drive to “offline” mode before we can enable it for Hyper-V passthrough access.
Note: Windows does not allow setting removable drives as “offline”, such as USB thumb drives or memory cards. Thus they can not be used for Hyper-V drive passthroughs.
To enable the server-side Hyper-V drive passthrough, follow these steps:
- Open the Disk Management console. To do so, right-click Start and click Disk Management.
- On the Disk Management window, look for the internal or USB drive and set it to offline.
- To do so, right-click the Disk and click Offline. The disk will then go offline and lose its assigned drive letter.
The drive is now identified as offline on the host, which means the host operating system no longer has active access to the drive. You can now enable the Hyper-V passthrough by adding the drive as a new hard disk inside the VM. To do so, please follow the these steps:
- Switch to your Hyper-V Virtual Machine Connection (VMConnect) window. Click File > Settings to open the VM settings.
- On the VM settings window, click SCSI Controller > Hard Drive > Add.
- Can you add the hard drive to the IDE Controller instead of the SCSI Controller? Yes. But know that once you added the drive as an IDE device, you cannot remove it from the VM without turning off the VM first. In contrast, you can remove the SCSI drive from a running VM.
- On the Hard Drive page, under the Media section, select the Physical hard disk option.
- Next, click the drop-down box and select the drive.
- The drive you’re choosing must have the same disk number must be the same as the disk you took offline in the Disk Management console.
- After adding the drive, open the File Explorer on your Hyper-V VM. You should now see the drive inside the VM.
When you no longer need access to your recently added drive on the VM, removing it only takes a few steps. To do so, follow the instructions below.
- Open the VM’s settings by clicking on File > Settings on the VMConnect window.
- Next, on the left pane, click the hard drive you added under the SCSI Controller.
- Finally, click the Remove button and click OK.
Another way to access drives and USB devices in Hyper-V is through the client-side enhanced session mode. With enhanced session mode, connecting to the VM using VMConnect allows you to use the host’s local devices and resources inside the VM.
Using the enhanced session mode is ideal when:
- Your guest VM’s operating system is Windows.
- Linux VMs do not have enhanced mode support.
- You need to share a drive or USB device access with the host or multiple VMs.
- You need access to USB devices other than USB mass storage types.
- The enhanced session mode allows you to access different device types inside the VM, such as printers and flash drives.
- Users need to select which USB devices will be available inside the VM before connecting to the VM.
Before you can connect to the Hyper-V VM with the enhanced session mode, ensure that the enhanced session mode status is on. Follow the steps below to enable enhanced session mode on the Hyper-V host:
- Open the Hyper-V Manager if you haven’t opened it yet. To do so, click Start > Windows Administrative Tools > Hyper-V Manager.
- On the Hyper-V Manager window, click to select the Hyper-V host on the left pane and click Hyper-V Settings under the Actions pane.
- On the Hyper-V Settings window, click Enhanced Session Mode Policy under the Server section. Next, put a check on the Allow enhanced session mode box.
- This option allows enhanced session mode connections to the VMs running on the host.
- Click Enhanced Session Mode under the User section. Next, put a check on the Use enhanced session mode box.
- This option enables VMConnect to connect to the guest VM in enhanced session mode.
- Finally, click OK.
After ensuring that enhanced session mode is enabled in Hyper-V, you can now access USB devices inside the Hyper-V VM. Follow the steps below to access USB storage devices in Hyper-V.
- If you currently have a session with the VM, close the session first.
- On the Hyper-V Manager, right-click on your VM and click Connect. Doing so opens the VMConnect window.
- On the VMConnect window, click Show Options to reveal more options available before connecting to the VM.
- Next, click the Local Resource tab. Under the Local devices and resources section, click More.
- Next, on the Local Resources window, click to expand Drives on the list.
- The existing drives attached to the host are available to select.
- After making your selection, click OK.
- Note: Selecting the drives that I plug in later will cause the Hyper-V VM to automatically recognize and make the USB drives available.
- Back on the Local Resources tab, click Connect to start the session with the VM.
- Now, log in to your VM and open File Explorer to confirm the drives are available.
- To confirm the drives are accessible, double-click to open the drives and verify you can see their contents.
I hope my article on connecting to drives and USB devices in a VM using Hyper-V has helped you. I welcome your thoughts, questions or suggestions regarding this article.
From using VMConnect either server-side or client-side to using a remote desktop client, which Hyper-V USB passthrough access method do you prefer? Do you know of another method that this article did not cover?
Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.