4

I am trying to create a Windows virtual machine using Hyper-V, but I have several issues. I tried following instructions on this page, to use the "Quick Create":

               

I was expecting to see a vanilla Windows 10 OS here, but there is none. So, I created an .iso image, using the instructions here. Through the "_Local installation source" I selected the ISO image, but I get this error message:

               

Error
The Operation failed.
An unexpected error occurred: Logon failure: the user has not been granted the request logon type at this computer.
(0x80070569).

Then I switched to "Hyper-V Manager" using the instructions on this page, but I get this error message:

               

New Virtual Machine Wizard
The server encountered an error while creating <virtualMachineName>.
...

I would appreciate it if you could help me know what is the problem and how I can resolve it.

P.S. I asked a follow-up question here.

4
  • I suggest not using the “Quick Create” wizard.
    – Daniel B
    Commented May 3, 2022 at 6:43
  • 1
    Dear @DanielB thanks for your comment, though I would appreciate it if you could read my post thoroughly first. I did use "Quick Create" as you may see in the post.
    – Foad
    Commented May 3, 2022 at 9:18
  • Yes and I’m saying not to use it. It won’t help you anyway and for diagnostic purposes you should absolutely try all ways to create a VM and many VM configuration combinations.
    – Daniel B
    Commented May 3, 2022 at 9:59
  • @DanielB the second half of the question is also about using the "Manager" to build a custom virtual machine.
    – Foad
    Commented May 3, 2022 at 10:10

2 Answers 2

5

Your error message says: "The user has not been granted the requested logon type at this computer."

Open the secpol.msc console, go to Local Policies → User Rights Assignment, and open the item "Log on as a service". It should list the following two names:

NT SERVICE\ALL SERVICES
NT VIRTUAL MACHINE\Virtual Machines

If either of these items is missing (in particular the "Virtual Machines" one), add it. Well, it won't recognize those names when entered, so you'll probably need to find the ntrights.exe tool and run it like this (untested):

ntrights +r SeServiceLogonRight -u *S-1-5-83-0

...or the psprivilege PowerShell module (this is currently not yet tested, either):

PS>   Install-Module -Name PSPrivilege -Scope AllUsers
PS>   $sid = [System.Security.Principal.SecurityIdentifier]::new("S-1-5-83-0")
PS>   Add-WindowsRight -Name SeServiceLogonRight -Account $sid

Windows distinguishes several logon types: interactive (full GUI or SSH logon), batch (e.g. Scheduled Tasks), service (actual services), network (SMB file shares). You're only able to log on to Windows because the whole "Users" group is explicitly listed under "Allow log on locally", and when you create a scheduled task to run under your account, the Task Scheduler tool adds you to the "Batch logon" list behind the scenes.

3
  • 1
    I'll figure out the correct procedure when I get back home. Until then, I found a workaround of creating a new group with *S-1-5-83-0 as a member (the net localgroup command does accept this) and granting it the rights. Commented May 3, 2022 at 7:44
  • Thanks for the post. However, I don't have ntrights.exe on my windows 10 21H2 version.
    – Foad
    Commented May 3, 2022 at 9:19
  • Thank you, this was really helpful! I couldn't use gpupdate /force because I couldn't connect to the AD. The PowerShell statements solved it! Commented Feb 22 at 9:59
2

From this page, running the command

gpupdate /force

in an elevated command line, forces an update on group policies and now the NT VIRTUAL MACHINE\Virtual Machines is there:

enter image description here

However, according to the discussions this page, this error might happen again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .