Saturday, April 23, 2011

Hyper-V: An error occurred while attempting to export the virtual machine.

When you try to export Hyper-V Virtual machine to network share you get this error:

An error occurred while attempting to export the virtual machine. 
Failed to copy file during export.
General access denied error (0x80070005)


Solution:
Computer account of Hyper-V host should have permissions on NTFS and share level to write to target network share:

NTFS permissions:

1.  On the destination server, Right-click on the shared folder and select Properties. 
2.  Select the Security tab. 
3.  Click Edit button and click the Add button in the permissions dialog box. 
4.  Click Oject Types and select Computers if not already done and click OK.
5.  In the dialog "Enter the object names to select" provide the name of Hyper-V host machine and click Check Names.
6.  With the Hyper-V host machine name select, click Allow by "Full control" and click OK.

Share  permissions:

1.  On the destination server, Right-click on the shared folder and select Properties. 
2.  Select the Sharing tab. 
3.  Click Advanced Sharing...
4.  On the Advanced Sharing dialog, click Permissions  and then Add.
5. Click Oject Types and select Computers if not already done and click OK.
6.  In the dialog "Enter the object names to select" provide the name of Hyper-V host machine and click Check Names.7.  With the Hyper-V host machine name select, click Allow by "Full control" and click OK.

Thursday, April 21, 2011

Hyper-V: The operation cannot be performed while the object is in its current state.

This message appears when you try to delete Virtual Machine from Hyper-V Manager:

The operation cannot be performed while the object is in its current state.

If you go manually to delete the folder where is VM located you will get an error message that you don't have permissions to do that. Into this folder there is config XML file:



Solution for this issue is to find the same XML file in :

C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines

and to delete it.
Note: First you should enable: Show hidden files, folders and drives in Folder Option. 




After that when you open Hyper-V Manager you will see that the machine is gone.