Link to home
Start Free TrialLog in
Avatar of Gavin Reid
Gavin Reid

asked on

"Hyper V machines cannot shut down while they locked" error when I shut down a VM

Very odd thing started happening on a Hyper-V VM I have running on a Server 2016 host.  Whenever I try to shutdown the VM from Hyper-V Manager on the host I get a message saying "These selected virtual machine(s) cannot shutdown while they are locked, unless the shutdown is forced."

I've never seen this message before when shutting down a VM, anyone know what I need to change to stop this from happening? The VM is a server 2016 installation too.

Thanks
Avatar of RAFA
RAFA
Flag of Venezuela, Bolivarian Republic of image

Hello,

Do you force the shutdown by command line?

THE vm has a snapshot?

From the command prompt turn off the vm with the following command and tell me if it gives you an error:

stop-vm followed by the server name

Regards...
Avatar of Gavin Reid
Gavin Reid

ASKER

Hi, no I right click on the VM in Hyper-V Manager and select Shut Down. The VM does not have any snapshots. If I run that command from the VM-Host I get 'stop-vm' is not recognized as an internal or external command.

Thanks
Hello,

run it from powershell, as administrator.
stop-vm followed by the server name

Regards...
stop-vm : Failed to stop.
'FA Domain Controller' failed to stop: The machine is locked and cannot be shut down without the force option.
(0x800704F7). (Virtual machine ID 5DC07F70-8D37-46AB-97C6-15E9D6AE4230)
At line:1 char:1
+ stop-vm "FA Domain Controller"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Stop-VM], VirtualizationException
    + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.StopVM
Is the VM OS actually locked - as in, is there a user logged in and then has that user locked the desktop?
Yes I think it is, it automatically locks when I end a remote session and goes back to the Ctrl Alt Delete screen. But this has always been the case and is the case on all the other Hyper V hosts I look after and this is the only one that I've ever seen this problem on, there isn't a single thing on Google about it which is really odd!
SOLUTION
Avatar of Hypercat (Deb)
Hypercat (Deb)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's our remote software (Techinline) that I use to remote onto the VM itself. If I disconnect it the server does lock itself. But all servers do that and I've never had this issue before, wonder if it's a new "feature" been added to 2016?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you both, it seems that logging off rather than quitting the remote session allows it to be shut down, that's fine I shall heed Philips advice and always log out in future. Thank you all.