We have noticed that sometimes the Hyper-V VM is stuck, and we are unable to power it on or off because it is unable to change state. In this post, we will discuss what to do when Hyper-V fails to change state.
An error occurred while attempting to start the selected virtual machine(s).
‘Machine-name’ failed to change state.
The operation failed with error code ‘32788’.
What is VM failed to change state 32788?
The error code 32788 signifies that the VM is unable to change its state. This may happen if there is a storage failure, incorrect network configuration, or improper ISO. However, sometimes, the issue can be nothing but a glitch that can be resolved by killing the existing process.
Fix Hyper-V Failed to change state error
If Hyper-V fails to change state, and displays The operation failed with error code 32788 message, first make sure your disk where the VM’s files are being stored is not full. If there is enough space, then follow the solutions mentioned below.
- Kill the process of the problematic virtual machine
- Make sure you are connected to a working switch
- Check if the ISO file is mounted
- Check or restart the virtual machine service
- Give adequate permission to the folder
The operation failed with error code 32788 Hyper-V error
1] Kill the process of the problematic virtual machine
When encountering a start/stop VM error, you can’t simply terminate the VM by ending the Virtual Machine Worker Process (vmwp.exe). Each vmwp.exe process is mapped to a specific VM through a Globally Unique Identifier (GUID), so terminating the wrong process could result in killing the wrong VM, potentially affecting multiple VMs before finding the right one.
That is why we recommend terminating the process from Hyper-V Manager. Follow the steps mentioned below to do so.
- Open Hyper-V Manager.
- Right-click on your host machine from the left panel and select Hyper-V Settings.
- Go to the Virtual Machines tab and copy the address given there.
- Open File Explorer and paste the path we copied earlier in the address bar.
- Then, navigate to Your-virtual-machine-name > Virtual Machines.
- You will be able to find out the GUID of the machine, all the files and folders will have the same name.
- Now, open the Task Manager, go to the Details tab, find the vmwp.exe process associated with that GUID (It will be in the User column), right-click on it, and select End task.
Hopefully, this will do the job for you.
Alternatively, you can kill the process using the Microsoft PowerShell as well.
2] Make sure you are connected to a working switch
Next up, we need to ensure that you are connected to a working switch, otherwise, your machine will fail to change its state. To do the same, follow the steps mentioned below.
- Open Hyper-V.
- Go to your virtual machine, right-click on it, and select Settings.
- Then, click on Network adapter.
- Check if your Virtual Switch is configured correctly, if not, select the correct one, and click on Apply.
After configuring your virtual switch, you should never face this issue again.
3] Check if the ISO file is mounted
The ISO file mounted to the VM/guest OS may not be in the correct location, preventing the VM from powering on and changing its state. This could be due to moving or deleting the ISO file, or migrating the VM from a different host with a different ISO file path.
To check it, open Hyper-V, right-click on the virtual machine and select Settings. Then navigate to Hard Drive or DVD Drive to find the ISO path. If you need the ISO file in the virtual machine, attach the correct file. If not, select ‘None’ to boot the VM without an ISO file. The VM should now power on without any issues.
4] Check or restart the virtual machine service
If you are facing this issue with all the virtual machines installed on the host, there is a high chance the virtual machine service has some kind of issue. However, if only one machine cannot change the state, you might want to skip this solution.
Note: When restarting the Hyper-V Virtual Machine Management service in the production environment, interruptions to the Hyper-V services on the host may occur. So, make sure you have a proper downtime before rebooting the service.
To restart the service, open Services, find Hyper-V Virtual Machine Management, right-click on it, and select Restart if it’s running. If it’s not running, click Start.
Do this to all services related to Hyper-V and check if the issue is resolved.
5] Give adequate permission to the folder
If there are insufficient permissions for folders and VM files, the VM can become stuck in the Saved state. In that case, we need to give the user all the permissions over that folder. For that, open the Properties of the folder where the VM files are stored. Go to the Security tab, find out the user having issues, click on Edit, and then give them Full control.
Hopefully, you can resolve the issue using the solutions mentioned in this post.
Read: Fix Hyper-V Virtual Machine stuck in Stopping State
How to fix Hyper-V stuck in Saved state?
If Hyper-V Virtual Machine is stuck in the Saved State and cannot change the saved state, you need to kill the session and let it restart. You can find the GUID of that virtual machine and then kill it from the Task Manager on the host computer. See the guide mentioned earlier for instructions.