Ubuntu 18.04 on WSL2: "Logon failure: the user has not been granted the requested logon type at this computer."

Viewed 18406

After restarting my Windows machine, I received this error trying to open my Ubuntu 18.04 WSL2 instance.

Logon failure: the user has not been granted the requested logon type at this computer.                                                                                                       
Press any key to continue... 

It had been working totally normally before the restart.

4 Answers

Restarting the vmcompute service worked for me. From an elevated PowerShell (close WSL2 first though!):

Get-Service vmcompute | Restart-Service

And then run WSL2 again.

If you are on active directory, it might be because of your group policy settings. Open command prompt w/ Administrator rights and run following command:

gpupdate /force

And run WSL/Ubuntu again. It worked for me.

Google returned a lot of complicated solutions for when you're dealing with this on a real server, but for personal WSL2 use, my coworker and I both found that Windows had simply disabled Hyper-V when it restarted.

To turn it back on:

  1. Search for and open "Turn Windows features on or off"
  2. Check the box next to Hyper-V
  3. Restart your system

I solved this issue by updating/reloading my policy settings. To do this execute gpupdate /force in your Windows Terminal.

You also have to connect to your organizations network if your user is connected to an AD otherwise the command above will fail. I guess that caused the problem for me since I am not always in that network.

After successful execution you should be granted the right logon type.

Related