Tuesday, May 30, 2017

How to move a Hyper-V virtual machine without exporting it first on windows 10

Remark: It is not official method, it just a workaround when you have those VM on hand but you did not exporting it before

 

(Warning: Make sure the new host did not have any VM, the following method will remove all of them)

1. Stop the Hyper-V Service

2. Copy all files under "C:\Users\Public\Documents\Hyper-V\Virtual hard disks" to the same location of the new Windows 10 machine

3. Copy all files under "C:\ProgramData\Microsoft\Windows\Hyper-V" to the same location of the new Windows 10 machine

4. Run the PowerShell to change the permission of those VM (If you miss this step, you will receive a error (Fig.1))

image

5. Start the hyper-V service

6. Done (You will able to power on those VM on the new host)

 

The error message of missing the steps 4

image

Fig. 1 - The error message when you try to power on the machine without grant the permission

 

If you receive a error message (Ethernet Port....) like the following when you power on a VM:

image

It should be the Virtual Switch configuration is different between the old host and the new host, change the virtual switch selection on the VM will fix the problem.

image

Change to the new host configuration:

image

 

Reference:

https://www.powershellgallery.com/packages/Restore-VMPermission/1.0/DisplayScript
https://ntsystems.it/PowerShell/Restore-VMPermission/
https://kx.cloudingenium.com/microsoft/servers/hyper-v/resolved-hyper-v-general-access-denied-error-trying-load-virtual-hard-drive/
http://www.askme4tech.com/moving-virtual-machine-one-hyper-v-host-another
https://ss64.com/ps/set-executionpolicy.html

Print Friendly and PDF
Share/Bookmark

No comments:

Post a Comment