"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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
R@f@r P@NC3RVirtualization SpecialistCommented:
Hello,

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

Regards...
0
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Virtualization

From novice to tech pro — start learning today.