How to Share Files or Printers in Hyper-V?
This guide contains instructions on how you can share files, folders, drives, printers or other devices in Hyper-V virtualization platform.
"Hyper-V" it's a virtualization technology developed by Microsoft that allows users to create and run virtual machines (VMs) on Windows 10/11 Pro versions and Server Editions, and in a previous tutorial we show how your can setup a Hyper-V virtual machine in Windows 11/10.
However, when using virtual machines in Hyper-V, you may need to transfer files between the host and the virtual machine, or you may want to use a USB device or disk attached to the Hyper-V host in the Hyper guest machine -V. For example, you may need to copy files between the Hyper-V host and the guest virtual machine, or you may need to print to your printer from the virtual machine.
How to Share Folders, Printers or other Devices in Hyper-V?
To share files and printers from the Hyper-V host machine to the virtual machine, you can use one of the following two (2) methods:
Method 1. Share Files and Devices using Enhanced Session Mode.
The first and most easiest method to share the resources of Hyper-V host machine to the guest virtual machine, is by using Enhanced Session Mode.
Enhanced session mode lets Hyper-V to connect to virtual machines using the Remote Desktop Protocol (RDP), allowing you to transfer files between the host and the virtual machine and to share the connected devices (such as USB printers, drives, microphone or speakers) of the host machine to the virtual machine.
Step 1. Turn On 'Enhanced Session Mode' in Hyper-V Settings.*
* Note: In Windows 10/11 the Hyper-V Enhanced Session Mode is already enabled by default, but ensure that is enabled.
1. Power Off the virtual machine.
2. Open the Hyper-V settings.
3. Under Server: select Enhanced Session Mode Policy and then enable the Allow enhanced session mode* option on the right. Click Apply. *
* Note: If this option is already checked, continue below.
4. Under User: Select Enhanced Session Mode and then enable the Use enhanced session mode option.* When done, click Apply > OK.
* Note: If this option is already checked, continue to next step.
Step 2. Share Local Resources on Hyper-V Virtual Machine's Session Settings.
After enabling the "Enhanced session mode", proceed and choose which resources of the host machine will be available on the virtual machine. To do that:
1. Right-click on the VM machine and click Start.
2. Wait a few seconds for the VM to start. Then right-click again on the VM machine and select Edit Session Settings.*
* Note: If the "Edit Session Settings" option isn't available in "right-click" menu, that means that the VM it is not fully launched yet. At such a case, wait a few more seconds and "right-click" again.
3. In the 'Display Configuration' dialog that appears, click Show Options.
4. Check the option to Save my settings for future connections to this virtual machine and then select the Local Resources tab.
5. In Local Resources, ensure that Printers and Clipboard options are checked and then click More.
6. At Local Devices and resources dialog, check the Local Disk (C:) and any other drives or USB devices that you want to access inside the VM, like 'Drives that you plug in later' or/and 'Other Supported Plug and Play (PNP) devices'. When done, click OK.
7. Now, click Connect to connect to the virtual machine.
8. After performing the above steps, you will be able to transfer files between the Hyper-V host and the guest virtual machine, either by drag n drop or using the file explorer. Additionally, you will be able to use any USB drives or other USB devices connected to the host machine, such as printers, microphone, speakers, etc.
Method 2. Share Folders & Printers in Hyper-V via Windows File Sharing.
In case you don't want to use Hyper-V Enhanced Session Mode, to share resources between the host and the virtual machine, then you can use the Windows file sharing feature to share a folder or the printer on the host machine with the virtual machine. To do that:*
* Note: This method is recommended when you don't want to share the whole disk (C:) on the virtual machine.
Step 1. Share a Folder on the Hyper-V Host machine.
1. In File Explorer: Right-click on the folder that you want to share with the virtual machine and select Give Access to > Specific people.
2. Click the drop-down menu, select Everyone and then click Add.
3. Then change the Permission Level to Read/Write and click Share.
4. Now notice or copy in notepad the first part of the shared folder path which includes the name of the computer. (e.g."\\DESKTOP10" in this example) and click Done.
5. Proceed to next step if you want to share the printer to, or skip to step-3 to learn how to access the shared folder on the virtual machine.
Step 2. Share a Printer on Hyper-V Host machine.
To share a printer connected to the Hyper-V host machine with the virtual machine:
1. Go to Start > Settings > Devices > Printers & Scanners if you own Windows 10, or to Start > Settings > Bluetooth & devices > Printers & Scanners if you own Windows 11.
2. Click on the Printer that you want to share with the virtual machine and click Manage and then Printer Properties if you own Windows 10, or Printer Properties if you own Windows 11.
3. Now select the Sharing tab, check the Share this printer box, change if you want the printer's share name and click OK.
4. Continue to next step to learn, ho to connect to the shared printer from the VM machine.
Step 3. Access Shared Folder & Printer from the Hyper-V Virtual Machine.
After sharing the folder(s) and/or the Printer:
1. Double-click on the virtual machine in Hyper-V manager and click Start to connect to it.
2. After entering in Windows, press the Windows + R keys to open the Run dialog box.
3. in Open box, type the path of the host computer as you noticed it at step-1 above. (e.g. "\\DESKTOP10" in this example ), and press Enter (OK).
3. Now in "Enter Network Credentials" window, type the username and the password of your user account on the host machine, check the Remember my credentials box and click OK.*
* Note: If you login to Windows without a password on the host machine, then specify one, restart your PC and try again to connect
4. Now you should see the shared folder and the shared printer of the host machine.
5. To be able to use the shared printer, proceed and install it's driver on the virtual machine. To do that, right-click on the printer and click Connect.
6a. Then, make the shared folder always available in file explorer, by right-clicking on it and choosing Map network drive.
6b. At the next screen, assign a Drive letter for the the network folder and click Finish.
That's it! Which method worked for you?
Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.
We're hiring
We're looking for part-time or full-time technical writers to join our team! It's about a remote position that qualified tech writers from anywhere in the world can apply. Click here for more details.
- FIX: Hyper-V did not find Virtual Machines to import from location. - September 3, 2024
- How to Move a Hyper-V Virtual Machine to another Host? - August 28, 2024
- How to Install Windows 11 in Hyper-V. - July 31, 2024