How to share files between a virtual machine and a host in Hyper-V

Last update: 02/09/2025
Author Isaac
  • Use SMB, RDP, Copy-VMFile, VHDX or VMConnect depending on your network, security and speed.
  • Enhanced session mode enables clipboard, discs, audio and USB in VMs Windows.
  • VHDX and ISO solve networkless cases; ISO is read-only, while VHDX allows round-trip.
  • Export/Import is used to move entire VMs; it is not a substitute for a good backup.

Sharing files between Hyper-V and virtual machines

When you work with virtualization in Windows, Hyper-V acts as the reference hypervisor and allows you to manage Virtual machines both locally and remotely. Even so, something as everyday as move data between the host and VMs it is not obvious: You cannot drag and drop directly onto the console just like you would with any other application, so it's a good idea to know the effective and secure methods for transferring files.

In this guide I compile and unify All the practical ways to share files between the Hyper-V host and its VMs, from SMB shares, RDP with drive redirection, and the Copy-VMFile cmdlet PowerShell (without net), up to Tricks how to mount VHDX, take advantage of enhanced session mode in VMConnect and even use read-only ISO images. In addition, you will see additional options (export/import VMs, cloud or apps web) and a small context with VirtualBox and VMware so you know what changes if you alternate solutions.

Method 1: SMB share on the Hyper-V host

The most direct way in Windows environments is expose a folder via SMB on the host running Hyper-V and copy ISOs or other files there. This method works from both physical computers and other VMs, as long as there's network connectivity.

First of all, enable on the host firewall the “File and Printer Sharing” group rule to allow incoming SMB connections. You can do this with the following command (CMD or PowerShell): netsh advfirewall firewall set rule group=\"File and Printer Sharing\" new enable=Yes. Make sure to limit permissions on the share only to users who need it.

If you work with a graphical interface, open the Explorer and use administrative shares to connect to the host, for example: \\10.10.10.31\c$\. It is common to create a dedicated folder for ISOs or VM data (e.g. C:\ISO_1\), but for good practice consider storing VMs and media on separate partitions than the system.

From the line of commands, Can map the SMB folder as a network drive with: net use S: \\10.10.10.31\d$. Assigning a letter makes it easier to automate copies and media deployment scripts.

  1. Create/select the destination folder on the host (e.g., C:\ISO_1\) and share with minimum permissions required.
  2. Connect from your computer or VM to the SMB resource and copy the required ISO or file to the route.
  3. In Hyper-V Manager, point the VM's virtual DVD drive to the copied ISO file.

For safety, once you finish, you can disable it again the “File and Printer Sharing” rules with: netsh advfirewall firewall set rule group=\"File and Printer Sharing\" new enable=No. Reduce the attack surface from the host is always recommended.

How to share a network folder in Windows 11
Related articles:
How to Share a Network Folder in Windows 11: Complete Guide

Method 2: Central repository (file server or NAS)

In environments with multiple Hyper-V hosts, replicate ISOs and files to each server consumes storage and complicates maintenance. A best practice is to create a single central SMB resource (file server or NAS) and give access to hosts and VMs.

  How to share folders between the host and virtual machines in Hyper-V

If all computers are members of the domain, permission management is simpler. Simply mount the share from each host/VM that needs it. On VMs Linux, in addition to SMB, you can choose SSH/SCP/SFTP for secure transfers over the network.

Remember that if the VM needs to reach that resource, you will need a virtual switch and network connectivity with the appropriate mode (external, internal, etc.). Planning the topology avoids bottlenecks and access problems.

Method 3: RDP with Drive Redirection

When the Hyper-V host has a GUI, you can use RDP to connect and redirect local disks, so that you copy files from your computer to the host or VM. This procedure also works for Windows VMs with network connectivity.

  1. On the destination, enable Remote Desktop: Start > Settings > System > Remote Desktop > Enable.
  2. Run the RDP client: mstsc (located in %windir%\system32\mstsc.exe).
  3. Enter IP/computer name and user (format domain\user o computer\user).
  4. Go to “Local Resources” > “More…” and mark the units that you want to map (for example, E:).
  5. Connect and, already in the Explorer of the remote computer, you will see the redirected units to copy the files.

This method is very convenient and avoids configuring SMB on the host, with the advantage that you can select exactly which units redirect on every RDP session.

Method 4: PowerShell Copy-VMFile (No Network, Host → VM)

PowerShell 4.0 and later versions include a cmdlet that allows you to copy files from the host to the VM without a network connection, without opening ports or touching the firewall. It is ideal for inject specific files in isolated VMs.

You must first enable the “Guest Service Interface” integration service on the VM. From Hyper-V Manager, in the VM settings > “Integration Services,” select “Guest Services.” You can also do this in PowerShell: Enable-VMIntegrationService -VMName VM1 -Name 'Guest Service Interface'. Without this service, the cmdlet will not work.

Check the status with: Get-VMIntegrationService -Name Guest* -VMName VM1,VM2. If the status appears “no contact”, update and install Integration Services on the guest system; if you see “False”, enable it with: Enable-VMIntegrationService -Name Guest* -VMName MiVM -Passthru.

To copy, use the pattern: Copy-VMFile \"NombreVM\" -SourcePath \"F:\\Test.txt\" -DestinationPath \"C:\\Temp\\Test.txt\" -CreateFullPath -FileSource HostIn practice: Copy-VMFile \"VM2\" -SourcePath \"C:\\temp\\file01.txt\" -DestinationPath \"C:\\Temp1\\file01.txt\" -CreateFullPath -FileSource Host. Keep in mind that this cmdlet only copies in host → VM direction.

Method 5: Mount a shared VHDX between host and VM

A very flexible approach is to create a “portable” VHDX virtual disk that you can mount on the host to upload files to, and then temporarily attach to the VM to retrieve them. It's fast, controlled, and doesn't require a network.

You can create it from Computer Management > Storage > Disk Management > “Create VHD”. Choose the path (e.g., C:\Hyper-V\data-temp\), size (for example, 8 GB), format VHDX and disk type (“Dynamic Expansion” is recommended). Using PowerShell, an example: New-VHD -Path C:\\Hyper-V\\data-temp.vhdx -SizeBytes 8GB -Dynamic -BlockSizeBytes 1MB.

To mount it on the host: Mount-VHD -Path C:\\Hyper-V\\data-temp.vhdx. Then initialize the disk (MBR for compatibility) and create volume and format: Initialize-Disk 1 -PartitionStyle MBR & New-Partition -DiskNumber 1 -UseMaximumSize -AssignDriveLetter & Format-Volume -DriveLetter H -FileSystem NTFS -Full -Force. Once assembled, copy the necessary files inside.

  The right way to Discover Imported Pictures on iPhone & iPad

Unmount from the host with: Dismount-VHD -Path C:\\Hyper-V\\data-temp.vhdx and attach the VHDX to the VM from Hyper-V Manager (SCSI Controller > Hard Disk > Add > “Existing Virtual Hard Disk”). Using PowerShell: Add-VMHardDiskDrive -VMName VM2 -Path C:\\Hyper-V\\data-temp.vhdx. When starting the VM, assigns a letter if it does not do so automatically and copies the files to their destination.

This method also works with Linux guests capable of reading NTFS, which adds versatility when mixing systems.

Method 6: VMConnect and Enhanced Session Mode

VMConnect is the native Hyper-V console. With the enhanced session mode, the connection uses RDP “beneath” and enables resource redirection (clipboard, drives, printers, audio, microphone, and even supported USB devices). It is only available for Windows VMs.

To enable it on the host: Hyper-V Manager > right-click the host > “Hyper-V Configuration” > “Enhanced Session Mode” > select “Use Enhanced Session Mode.” In PowerShell: Set-VMHost -EnableEnhancedSessionMode $True. In the VM, enable Remote Desktop and Guest Integration Services.

When you open VMConnect and connect, you will see a dialog to choose resolution; press “Show options” and go to “Local Resources” > “More…”. Check the host disks you want to redirect to the session. By default, the clipboard and printers are already available, and audio is playing on the host.

For audio and microphone, go to “Settings” in the connection box and adjusts playback/inputIf the VM is running locally, the remote audio options produce the same effect. Control sound and voice from the VM can be useful in demos and training.

In the VMConnect toolbar there is an icon that indicates the session type current (basic or enhanced) and allows you to toggle. On Windows 10 2004/Windows 11, if the VMConnect login box doesn't appear, disable in the VM the option to require Windows Hello on Microsoft accounts (Sign-in options) and sign out or restart the VM. If you don't see the connection dialog, run vmconnect.exe "as administrator".

Method 7: Share with ISO images (read-only)

When you just need deliver files from the host to the VM and you don't care that it's read-only, create an ISO image with the contents and assign it as a virtual DVD drive in the VM. It is one-way and the VM cannot modify those files.

If the ISO is to be Boot (e.g. for nested virtualization testing), generates an empty ISO and add another bootable ISO inside to move it to the VM. Then you insert it from the machine's virtual DVD drive and work with it as if it were physical media.

Move VMs and data with Export/Import

Beyond sharing individual files, Hyper-V allows export and import virtual machines, a quick way to move or clone them, including disks, configuration, and checkpoints. You can export them with the VM. on or off (recommended with low loads).

During the import, the VM is registered on the host and the wizard helps resolve incompatibilities (memory, virtual switches, CPU). There are three types of import: “Record in context” (uses the current location and keeps the same identifier, does not leave export files for reuse), “Restore” (copies the files to another location keeping the same identifier, leaving the export intact) and “Copy” (like restore, but generates a new identifier, useful for cloning multiple times on the same host).

  How to fix Minecraft internet connection errors on PC?

This route does not replace the previous methods for quick file passes, but it is excellent for migrate entire environments between hosts or maintain “golden image” templates.

Generic alternatives: cloud and web applications

Services like OneDrive, Google Drive, Dropbox or Mega make sharing much simpler: you install the client on the host and/or VM and synchronize folders. Avoid duplicate space choosing “files on demand” or equivalent (placeholders) and download only when opened.

If you don't want to install anything on the VM, there's always the browser and its access to the web version cloud service. It's less automated, but valid for specific cases. Control size limits and bandwidth if you work with large ISOs.

Another option is platforms like WeTransfer, which allows you to share large files by generating a link. Upload from the host, open the link in the VM, and download. It's simple and fast for occasional exchanges, although it does not replace continuous synchronization.

Quick context if you alternate between VirtualBox and VMware

Although this guide focuses on Hyper-V, it's helpful to know what changes if you use other platforms. In VirtualBox, the easiest way is configure “Shared Folders” to expose host directories to the guest, checking “Automount” to make them available when starting the VM and “Read-only” if you want shield the content.

VirtualBox also allows use USB devices with the VM (enabling the USB controller and selecting the device) and the drag/drop or shared clipboard by installing Guest Additions and enabling “Bi-Directional”. In certain scenarios, USB 3.0 may cause starting problems, so it is advisable to test USB 1.1 if there are problems.

On VMware, Workstation Player is free for non-commercial use but It has limitations (for example, in shared folders). Workstation Pro adds shared Folders (Options > Shared Folders) and functions of “Guest Isolation” (activate drag & drop and copy/paste). For USB, connect the pendrive and assign it to the VM from the corresponding icon.

These comparisons help you to transferring habits between platforms, but remember that in Hyper-V we highlight VMConnect with improved session, Copy-VMFile without network and the use of VHDX as a universal “container”.

As a cross-cutting recommendation, Avoid using these methods as a backup system. While they are very useful for moving files, they are no substitute for a host-level backup solution for VMs, which is more efficient, faster, and reliable for granular or total recoveries.

With this range of options, it's easy to choose the right method for your context: SMB or RDP for speed when there is network, Copy-VMFile and VHDX for isolated VMs, VMConnect with enhanced session when you want deep integration with devices and clipboard, and ISO if you're looking for read-only. And if you need to move entire environments, export/import offers an orderly path with compatibility control.