Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "Logon failure: the user has not been granted the requested logon type at this computer." on wsl2 forever

I know that there is a temporary solution to that error described in this Stackoverflow post.

But I am interested in a more deeply solution tackle the problem at its roots. Why? Because everyday in the morning after starting my Pc I want to open my wsl2 to start docker... And there it is Logon failure: the user has not been granted the requested logon type at this computer. This is so annoying to resolve this problem everyday.

The steps I have to take to sort it (everyday!):

  1. Get admin rights from IT
  2. Run Windows Terminal as administrator
  3. Execute cmd Get-Service vmcompute | Restart-Service

This is such a bad user experience and also time consuming and should definitely not be done everyday. I am so tired of this problem.

like image 427
wero026 Avatar asked Oct 24 '25 08:10

wero026


1 Answers

The problem is probably that you have a Group Policy in your AD-domain that modifies the "Logon as service" privileges.

Ask your IT admin to add "NT VIRTUAL MACHINE\Virtual Machines" (Well known SID S-1-5-83-0) to the Group Policy that modifies this privilege (in my case it was the default domain policy that modified "Logon As Service").

Worth noting is that the IT Admin has to add this special group from a computer/server that has Hyper-V enabled (or WSL2 components installed). Otherwise the special group will not be available for the admin to add to the policy.

More info in the GITHUB WSL issue or my blog post.

like image 76
Joakim Arborelius Avatar answered Oct 26 '25 23:10

Joakim Arborelius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!