0x80070015 Error When Using Copy-VMFile
Using PowerShell to copy files to guest virtual machines is pretty handy, but there is a prerequisite before you can do it.
Copying files directly to virtual machines is a handy feature of Hyper-V, and allows you to distribute files quickly to a large number of VMs. Here is an example of copying a file from the host hypervisor to a VM housed therein:
PS C:\MyDirectory> copy-vmfile "MyTestVM" -SourcePath "C:\Source\MyFile.zip" -DestinationPath "C:\target\MyFile.zip" -FileSource HOST
If you don't have a standard method of deploying Hyper-V virtual machines, it's very easy to forget to turn on integration services. If you forget, you'll be met with big error, similar to this:
copy-vmfile : Failed to initiate copying files to the guest.
'MyTestVM' failed to initiate copying files to the guest: The device is not ready. (0x80070015). (Virtual machine ID 12345678-ABCD-1234-EFAB-1A2B3C4D5E6F)
At line:1 char:1
+ copy-vmfile "MyTestVM" -SourcePath "C:\source\MyFile ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-VMFile], VirtualizationException
+ FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.CopyVMFile
Fortunately, the fix is easy. From an elevated PowerShell prompt, simply enter the following command for the troublesome VM:
Enable-VMIntegrationService -VMName MyTestVM -Name "Guest Service Interface"
Loading Comments ...
Comments
AnonymousCoward posted this comment on 2022-04-28:
Didn't work for me. Same error code, have a workstation (setup by someone else) with multiple virtual sessions. Run command on one and it works, same command on another and it fails. All vmintegrationservice show enabled as True including Guest Service Interface.
You must be logged in to make a comment.
AnonymousCoward posted this comment on 2021-03-01:
Thank you this helped me as well