microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.57k stars 823 forks source link

Cannot upgrade WSL1 to WSL2 distro #5678

Closed ido-ran closed 4 years ago

ido-ran commented 4 years ago

Environment

Windows build number: 10.0.19041.0
Your Distribution version: Ubuntu 18.04
Whether the issue is on WSL 2 and/or WSL 1: Linux version 4.4.0-19041-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Fri Dec 06 14:06:00 PST 2019

Steps to reproduce

I'm trying to upgrade a WSL1 Ubuntu 18.04 distro to WSL2.

This is the output when I follow https://docs.microsoft.com/en-us/windows/wsl/install-win10:

 wsl --set-version Ubuntu-18.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
This user isn't allowed to sign in to this computer.

Expected behavior

Distro will be upgrade to WSL2

Actual behavior

As written above.

More context

The root issue I'm trying to solve is that I can't run Docker for Windows because it crash when start with the following error:

The Hyper-V Virtual Machine Management service encountered an unexpected error: This user isn't allowed to sign in to this computer. (0x80070531).
licanhua commented 4 years ago

Open EventView, there should be some details. Since the error is from Hyper-V, I don't think WSL can provide too much help on it.

ido-ran commented 4 years ago

I've turn on login failure auditing and this seems to be the relevant event:


An account failed to log on.

Subject:
    Security ID:        SYSTEM
    Account Name:       PF25C4F3$
    Account Domain:     workgroup
    Logon ID:       0x3E7

Logon Type:         5

Account For Which Logon Failed:
    Security ID:        NULL SID
    Account Name:       F42B05F7-A4E5-43B7-A963-55C8ED962568
    Account Domain:     NT VIRTUAL MACHINE

Failure Information:
    Failure Reason:     User not allowed to logon at this computer.
    Status:         0xC000006E
    Sub Status:     0xC0000070

Process Information:
    Caller Process ID:  0x1df8
    Caller Process Name:    C:\Windows\System32\vmcompute.exe

Network Information:
    Workstation Name:   -
    Source Network Address: -
    Source Port:        -

Detailed Authentication Information:
    Logon Process:      Advapi  
    Authentication Package: Negotiate
    Transited Services: -
    Package Name (NTLM only):   -
    Key Length:     0

This event is generated when a logon request fails. It is generated on the computer where access was attempted.

The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network).

The Process Information fields indicate which account and process on the system requested the logon.

The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.

The authentication information fields provide detailed information about this specific logon request.
    - Transited services indicate which intermediate services have participated in this logon request.
    - Package name indicates which sub-protocol was used among the NTLM protocols.
    - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
ido-ran commented 4 years ago

Open EventView, there should be some details. Since the error is from Hyper-V, I don't think WSL can provide too much help on it.

But it is happening when I ran wsl command so it looks like it's not just Hyper-V issue.

licanhua commented 4 years ago

@benhillis may know the VM and logon part.

ido-ran commented 4 years ago

A solution has been found by Microsoft for this issue.

  1. Save and clear the security event log (Event Viewer> Windows Logs> Security).
  2. Start Registry Editor (Click on Start and type regedit).
  3. Locate the following key, and then set the value of this key to 1: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa (Click on it) \CrashOnAuditFail
  4. Restart the computer. The registry changes do not take effect until you restart the computer.
ido-ran commented 4 years ago

The value of CrashOnAuditFail was 2 before the change.