5

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.

Foad
  • 892
  • 4
  • 19
  • 54

2 Answers2

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.

grawity
  • 501,077
3

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.

Foad
  • 892
  • 4
  • 19
  • 54