Virtual Machine failed to change state
Actually, this error "The operation cannot be performed while the object is in use" is not related to no free hard disk space or sufficient memory. it's mainly related to the hard disk image file that you have used when creating your virtual machine!
Fixing The application encountered an error while attempting to change the state
This error usually occurs in case you have tried to mount the virtual hard disk image file VHDX or you have double-clicked on it by mistake.
In this case, the virtual hard disk image file will be attached to the disk of the host server and this will lead to being in use.
Detach Virtual Hard Disk Steps
To be able to use the virtual hard disk file and avoid the "Virtual Machine failed to change state, the object in use" error when starting Virtual Machine using Hyper-V, you should first detach the virtual hard disk from disk management by doing the following:
Using Administrator Account, Open Computer Management
.
From the left side, click on Storage
> Disk Management
.
Check the online disks, and right-click on the last one added, if it has a Detach VHD option, so it means it's a virtual hard disk.
Select Detach VHD, you will get a confirmation with your virtual hard disk location as shown below
Before clicking on OK, make sure that this the correct virtual disk file that would like to remove by matching the location path on the above message and the actual virtual hard disk file location in your host.
- Try now to start virtual machine that should be started and working properly without showing this error "New Virtual Machine failed to change state" again.
See Also