如果您 在导入虚拟机时将虚拟硬盘复制到目标文件夹(Hyper-V encountered an error while copying virtual hard disks to destination folder) 时遇到错误,请查看这些提示和技巧以解决此问题。当您在导出的文件夹中有损坏的虚拟机硬盘时,它会出现。
整个错误消息说:
Hyper-V encountered an error while copying virtual hard disks to destination folder ‘C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\’.
The file ‘C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\file.vhdx’ already exists.
此错误消息在您的计算机上可能略有不同。
复制虚拟硬盘时出现Hyper-V错误的原因是什么?
根据您收到的错误消息,可能有两个主要原因:
- 您已经有一个以您尝试导入 Hyper-V 的相同标题命名的虚拟硬盘。假设您有一个名为 ABCD .vhdx 的虚拟硬盘。另一方面,您正在尝试导入具有相同虚拟硬盘名称的虚拟机。在这种情况下,您可能会收到此处提到的错误。
- 您尝试导入的虚拟硬盘已损坏,或者在您从Hyper-V导出的所选文件夹中不存在。
当您尝试在导出虚拟机的同一台计算机上导入虚拟机时,第一个原因是有效的。如果同一虚拟机在Hyper-V(Hyper-V)中仍然可用,您可能会收到错误消息。但是,如果第二个原因成立,那么解决方案对您来说相对容易一些。您需要重新导出虚拟机并确保导出的文件夹完好无损,直到导入过程完成。
Hyper-V在将虚拟硬盘复制到目标文件夹时遇到错误
要修复Hyper-V在将虚拟硬盘复制到目标文件夹错误时遇到错误,请执行以下步骤:
- 删除现有虚拟机
- 重新导出虚拟机
要了解有关这些步骤的更多信息,请继续阅读。
1]删除现有的虚拟机
如前所述,如果您有一个与您尝试导入的名称相同的虚拟硬盘(或虚拟机),您可能会收到此错误。最简单的解决方案是在导入新虚拟机之前从Hyper-V中删除现有虚拟机。要从Hyper-V中删除虚拟机,请执行以下操作:
- 在您的计算机上打开Hyper-V 管理器。(Hyper-V Manager)
- 选择要删除的虚拟机。
- 右键单击它并选择 删除(Delete) 选项。
- 单击 删除(Delete) 按钮。
从您的计算机中删除虚拟机和所有相关文件后,您可以按照本指南 在 Hyper-V 中导入虚拟机(import virtual machines in Hyper-V)。
2]重新导出虚拟机
虽然不常见,但您导出的虚拟机文件可能由于恶意软件或广告软件攻击而损坏。在这种情况下,您需要扫描您的计算机以查找恶意文件。完成后,您可以再次导出虚拟机。为此,请按照下列步骤操作:
- 在您的计算机上打开Hyper-V 管理器。(Hyper-V Manager)
- 选择要导出的虚拟机。
- 单击 右侧边栏上可见的导出 按钮。(Export )
- 通过单击“浏览 (Browse )”按钮选择要导出文件的 位置。
- 单击 选择文件夹 (Select Folder )按钮。
- 单击 导出 (Export )按钮。
之后,需要先删除已有的同名虚拟机,再导入到同一台电脑上。
Hyper-V在加载虚拟机配置时遇到错误
如果您在导入虚拟机时收到 Hyper-V 在加载虚拟机配置错误时遇到错误(Hyper-V encountered an error while loading the virtual machine configuration) ,请删除旧虚拟机并创建一个新的唯一 ID。如果您不想删除虚拟机,则需要 在“选择导入类型” (Choose Import Type )页面中选择“复制虚拟机(Copy the virtual machine)” 选项 。
就这样!希望本教程能帮助您修复Hyper-V(Hyper-V)中的虚拟机导入错误。
阅读: (Read: )如何在 Windows 10 中使用 Hyper-V 安装 Windows 11。(How to Install Windows 11 using Hyper-V in Windows 10.)
Hyper-V encountered error copying virtual hard disks to destination folder
If you are gеtting Hyper-V encountered an error while copying virtual hard disks to destination folder while importing a virtual machine, check out these tips and tricks to get rid of this issue. It appears when you have a corrupted virtual machine hard disk in the exported folder.
The entire error message says:
Hyper-V encountered an error while copying virtual hard disks to destination folder ‘C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\’.
The file ‘C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\file.vhdx’ already exists.
This error message could be slightly different on your computer.
What causes Hyper-V error while copying virtual hard disks?
Depending upon the error message you are getting, there could be two primary reasons:
- You already have a virtual hard disk named after the same title you are trying to import into Hyper-V. Let’s assume that you have a virtual hard disk named ABCD.vhdx. On the other hand, you are trying to import a virtual machine, which has the same virtual hard disk name. In such a situation, you could get the error as mentioned here.
- The virtual hard disk you are trying to import is corrupted, or not there in the selected folder you exported from Hyper-V.
The first reason is valid when you try to import a virtual machine on the same computer from where you exported the virtual machine. If the same virtual machine is still available in Hyper-V, you could get the error. However, if the second reason is valid, the solution is comparatively easier for you. You need to re-export the virtual machine and ensure the exported folder is intact until the import process is complete.
Hyper-V encountered an error while copying virtual hard disks to destination folder
To fix Hyper-V encountered an error while copying virtual hard disks to destination folder error, follow these steps:
- Delete existing virtual machine
- Re-export virtual machine
To learn more about these steps, continue reading.
1] Delete existing virtual machine
As mentioned earlier, if you have a virtual hard disk (or virtual machine) with the same name as you are trying to import, you might get this error. The simplest solution is to remove the existing virtual machine from Hyper-V before importing the new virtual machine. To delete a virtual machine from Hyper-V, do the following:
- Open Hyper-V Manager on your computer.
- Select the virtual machine you want to delete.
- Right-click on it and select the Delete option.
- Click on the Delete button.
After removing the virtual machine and all the associated files from your computer, you can follow this guide to import virtual machines in Hyper-V.
2] Re-export virtual machine
Although it is not common, your exported virtual machine files may be corrupted due to a malware or adware attack. In such a situation, you need to scan your computer for malicious files. Once that is done, you can export the virtual machine again. To do that, follow these steps:
- Open Hyper-V Manager on your computer.
- Select the virtual machine you want to export.
- Click on the Export button visible on the right sidebar.
- Choose a location where you want to export the files by clicking the Browse button.
- Click the Select Folder button.
- Click the Export button.
After that, you need to delete the existing virtual machine with the same name before importing it on the same computer.
Hyper-V encountered an error while loading the virtual machine configuration
If you get the Hyper-V encountered an error while loading the virtual machine configuration error while importing virtual machine, you delete the old virtual machine and create a new unique ID. If you do not want to delete the virtual machine, you need to choose the Copy the virtual machine option in the Choose Import Type page.
That’s all! Hope this tutorial helped you fix the virtual machine import error in Hyper-V.
Read: How to Install Windows 11 using Hyper-V in Windows 10.