How to Copy File from Host to Guest in Hyper-V in 3 Ways?

Hyper-V is a popular virtualization platform and sometimes IT administrator needs to copy file from host to guest in Hyper-V virtual environment. In this post, 3 methods are introduced to complete this.

download-icon
Free Download
for VM, OS, DB, File, NAS, etc.
nick-zhao

Updated by Nick Zhao on 2023/03/10

Table of contents
  • Method 1. Copy file from Hyper-V host to guest via Enhanced Session Mode

  • Method 2. Transfer files from host to guest via shared folder

  • Method 3. Transfer files from host to guest via PowerShell

  • Backup Hyper-V virtual machine with Vinchin Backup & Recovery

  • Sum Up

Hyper-V is a popular virtualization solution. After Hyper-V feature is enabled on Windows operating system, this machine will become a host. IT administrators can create VM on the host via Hyper-V Manager.

Sometimes data transfer between host and guest is needed. To quickly transfer files, 3 helpful methods will be given to you in this post. Also, if you would like to transfer files in other ways, you can follow another post to copy file from host to guest or between VMs.

P.S. If you would like to protect VM data, there are 4 ways to backup Hyper-V VM.

Method 1. Copy file from Hyper-V host to guest via Enhanced Session Mode

To use Enhanced Sesstion Mode related configuration on Hyper-V host should be enabled.

The benefits of enabling Enhanced Session Mode:

● Sharing Clipboard with the Windows host

● Visit the resources on local hard disk of Windows host on VM

● Adjust the resolution ratio of VM window

Enhanced Session Mode is automatically enabled on Windows 10 and Windows 8.1 but needs to be manually enabled on the other operating systems.

How to turn on Enhanced Session Mode?

Enhanced Session Mode needs to be enabled via Hyper-V Manager

1. Open Hyper-V Manager > right-click a Hyper-V host > select Hyper-V Settings

2. Under Server tab, select Enhanced Session Mode Policy > check Allow enhanced session mode

3. Under User tab, select Enhanced Session Mode > check Allow enhanced session mode > click OK

4. Right-click a guest on the host > select Settings > select Integration Services > check Guest services > click OK

5. Right-click the guest > select Connect

6. A pop-up will appear to let you modify display configuration > select Show Options

7. Check Save my settings for future connections to this virtual machine

8. Expand Local Resources > expand More > Select the drive that you want to use on the virtual machine > click OK

Now, you can open File Explorer on the host to copy files to VM.

Method 2. Transfer files from host to guest via shared folder

You can create a shared folder on local host and then map it on the virtual machine to transfer files from local host to virtual machine.

1. Create a folder on the host

2. Right-click the folder > select Properties

3. Select Sharing on the top > click Advanced Sharing

4. Check Share this folder > click Permissions

5. Check the boxs under Allow to grant the permissions for everyone > click OK

6. Connect to the VM that you would like to transfer file to > right-click This PC > select Map network drive

7. Select the drive letter > add the directory of the folder > click OK

Now, you can open File Explorer on the VM, and then you can see the shared folder has been added so you can go to the host to copy file to VM via the shared folder.

Method 3. Transfer files from host to guest via PowerShell

PowerShell can help you transfer files via command. Before you can use the command, you need to enable Guest Services on the VM. The steps can be found in method 1.

Copy-VMFile "Test VM" -SourcePath "D:Test.txt" -DestinationPath "C:TempTest.txt" -CreateFullPath -FileSource Host

Backup Hyper-V virtual machine with Vinchin Backup & Recovery

Data security is important in production environment and most companies will protect VM data by making backup.

Vinchin Backup & Recovery has helped thousands of companies build highly effective disaster recovery system for virtual environment and get compliments from them for simple operations and powerful performance.

Vinchin Backup & Recovery

Agentless Backup is supported in Vinchin Backup & Recovery. It means you just need to add Hyper-V host to the backup system and then you can select the guest machines to make backup. Compared with tranditional agent backup, Vinchin Backup & Recovery helps you save much time.

Granular Restore will make it easy to extract the selected files from VM backup and them you can transfer the files to another machine.

It will be easy to start using this software because there is a user-friendly web console to let you easily finish every step with wizards.

You can have a 60-day full-featured free trial to experience how convenient and powerful Vinchin Backup & Recovery is. Just click the button to get the installation package.

Sum Up

Sometimes IT administrators need to copy files from host to guest in Hyper-V environment and in the post, 3 methods are introduced to complete this.

Turning on Enhanced Session Mode will present the drives of VM on the hosts, creating shared folder will connect the host and guest, and PowerShell command allows directly transfer file from host to guest.

Data security is important. You can use Vinchin Backup & Recovery to easily protect Hyper-V environment. Don't miss the free trial.

Share on:

Categories: VM Tips