"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
Gavin ReidAsked:
Who is Participating?
 
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
One should never leave a machine logged on and locked. That leaves room for bad things to happen like memory leaks.

Make sure all systems get logged off when the admin is done their work.

Then, there's no problem.

Unless there's a third party app that requires a log on then lock in order to keep running?

EDIT: And yes, this is normal behaviour and has been since Hyper-V was released.
0
 
R@f@r P@NC3RVirtualization SpecialistCommented:
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...
0
 
Gavin ReidAuthor Commented:
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
0
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
R@f@r P@NC3RVirtualization SpecialistCommented:
Hello,

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

Regards...
0
 
Gavin ReidAuthor Commented:
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
0
 
Hypercat (Deb)Commented:
Is the VM OS actually locked - as in, is there a user logged in and then has that user locked the desktop?
0
 
Gavin ReidAuthor Commented:
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!
0
 
Hypercat (Deb)Commented:
That's kind of weird. When you use a remote desktop session, if you log off the session properly, it wouldn't be seen as locked.  The only way it could be seen as locked is if someone logged on directly to the console and then locked it rather than logging off. Or, if you disconnected your remote desktop session instead of properly logging off.  Check that out and see if one of those is causing this issue.
0
 
Gavin ReidAuthor Commented:
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?
0
 
Gavin ReidAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.