Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code: Wsl/InstallDistro/0x8007139f on Windows Server 2022 #9258

Closed
1 of 2 tasks
sirber opened this issue Dec 2, 2022 · 26 comments
Closed
1 of 2 tasks

Error code: Wsl/InstallDistro/0x8007139f on Windows Server 2022 #9258

sirber opened this issue Dec 2, 2022 · 26 comments
Assignees

Comments

@sirber
Copy link

sirber commented Dec 2, 2022

Version

Microsoft Windows [version 10.0.20348.1311]
under Hyper-V, Nested Virtualisation activated, Intel CPU

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

wsl --install
(reboot)
wsl --install Ubuntu

Expected Behavior

get in Ubuntu

Actual Behavior

Wsl/InstallDistro/0x8007139f

Diagnostic Logs

https://techcommunity.microsoft.com/t5/itops-talk-blog/using-wsl-2-on-windows-server-2022-to-run-linux-containers/bc-p/3688927/highlight/true#M2411

@benhillis
Copy link
Member

/logs

@ghost
Copy link

ghost commented Dec 2, 2022

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

@ghost ghost added the needs-author-feedback label Dec 2, 2022
@sirber
Copy link
Author

sirber commented Dec 2, 2022

@ghost ghost removed the needs-author-feedback label Dec 2, 2022
@proludiojon
Copy link

I am having the same issue, and have attached my log file output in case it helps.
WslLogs-2022-12-06_14-12-20.zip

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 6, 2022

Thank you @sirber. Based on the logs, it looks like the application package failed to install.

Can you share the output of Get-AppxPackage -AllUsers | Where-Object { $_.PackageFamilyName.contains("buntu")} in an elevated powershell ?

I wonder if the application is installed in a bad state, or for another user.

@sirber
Copy link
Author

sirber commented Dec 7, 2022

Get-AppxPackage -AllUsers | Where-Object { $_.PackageFamilyName.contains("buntu")}

nothing shows up

also, in my tests, I completely removed WSL (from add/remove program), rebooted and reintalled it. Same issue.

I edited the main description, my Windows Server 2022 is under Hyper-V, Nested Virtualisation activated, Intel CPU

@ghost ghost removed the needs-author-feedback label Dec 7, 2022
@KRAOUFI
Copy link

KRAOUFI commented Dec 7, 2022

Hello,
Same configuration as @sirber and same issue
here is my logs

Please help, it's the 3rd time a make the operation and no success.
WslLogs-2022-12-07_15-03-19.zip

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 7, 2022

Thank you @sirber.

After looking into this we realized that the issue is that the ubuntu app depends on Microsoft.VCLibs.140.00.UWPDesktop, which cannot be automatically installed on Server.

We have reported the issue to Canonical, to fix the issue, but in the meantime, installing the dependency manually can be used as a workaround

@sirber
Copy link
Author

sirber commented Dec 7, 2022

Thank you!! It works!

Powershell:
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -Out Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxPackage .\Microsoft.VCLibs.x64.14.00.Desktop.appx
wsl --install Ubuntu

image

@sirber sirber closed this as completed Dec 7, 2022
@elsaco
Copy link

elsaco commented Dec 7, 2022

This issue is not solved, at least for me. Starting with the latest Windows Server 2022 VHD from https://go.microsoft.com/fwlink/p/?linkid=2195166&clcid=0x409&culture=en-us&country=us it still shows Error code: Wsl/InstallDistro/0x8007139f.

Here's sample run:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Administrator> wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.20348.1311

PS C:\Users\Administrator> wsl --status
Default Version: 2

PS C:\Users\Administrator> wsl --install -d Ubuntu
Downloading: Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...
The group or resource is not in the correct state to perform the requested operation.
Error code: Wsl/InstallDistro/0x8007139f

PS C:\Users\Administrator> Get-AppxPackage -name Microsoft.VCLibs.140.00


Name              : Microsoft.VCLibs.140.00
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 14.0.27810.0
PackageFullName   : Microsoft.VCLibs.140.00_14.0.27810.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00_14.0.27810.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.140.00_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok



PS C:\Users\Administrator> wsl -l -v
Windows Subsystem for Linux has no installed distributions.

Use 'wsl.exe --list --online' to list available distributions
and 'wsl.exe --install <Distro>' to install.

Distributions can also be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Error code: Wsl/WSL_E_DEFAULT_DISTRO_NOT_FOUND

PS C:\Users\Administrator> wsl --install -d Debian
Downloading: Debian GNU/Linux
Installing: Debian GNU/Linux
Debian GNU/Linux has been installed.
Launching Debian GNU/Linux...

PS C:\Users\Administrator> wsl -l -v
  NAME      STATE           VERSION
* Debian    Running         2

PS C:\Users\Administrator> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME               FRIENDLY NAME
Ubuntu             Ubuntu
Debian             Debian GNU/Linux
kali-linux         Kali Linux Rolling
SLES-12            SUSE Linux Enterprise Server v12
SLES-15            SUSE Linux Enterprise Server v15
Ubuntu-18.04       Ubuntu 18.04 LTS
Ubuntu-20.04       Ubuntu 20.04 LTS
OracleLinux_8_5    Oracle Linux 8.5
OracleLinux_7_9    Oracle Linux 7.9

PS C:\Users\Administrator> wsl --install -d Ubuntu-20.04
Downloading: Ubuntu 20.04 LTS
Installing: Ubuntu 20.04 LTS
Ubuntu 20.04 LTS has been installed.
Launching Ubuntu 20.04 LTS...
The group or resource is not in the correct state to perform the requested operation.
Error code: Wsl/InstallDistro/0x8007139f

PS C:\Users\Administrator> wsl -l -v
  NAME      STATE           VERSION
* Debian    Stopped         2

PS C:\Users\Administrator> wsl --status
Default Distribution: Debian
Default Version: 2

PS C:\Users\Administrator> wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.20348.1311

PS C:\Users\Administrator>

Notice that Microsoft.VCLibs.140.00 was already present (it came with the VHD) and Debian installation worked as expected. Only Ubuntu (currently pulling 22.04) and Ubuntu-20.04 failed.

@sirber sirber reopened this Dec 8, 2022
@sirber
Copy link
Author

sirber commented Dec 8, 2022

I reopened the issue. Glad to hear that Debian works out of the box!

@KRAOUFI
Copy link

KRAOUFI commented Dec 8, 2022

Hello,
This issue is not solved
I installed the dependency, the installation was able to continue, Ubuntu downloaded and installed.
But once it was launched, i had an other issue :
WslRegisterDistribution failed with error: 0x800706d9

I tried the fixes mentioned in #5331 but it didn't work. My VM won't start anymore !!!
I ended up deleting and recreating a VM for the 10th time.
Either it's WSL not working at all on a Windows Server 2022 over Azure stack VM with enabled nested virtualisation, or it's Ubuntu.

I'll try Debian and come back

Thanks

@KRAOUFI
Copy link

KRAOUFI commented Dec 8, 2022

Wsl does not work on my Azure Stack Windows Server 2022 VM, whether to install Ubuntu or Debian:

image

@sirber
Copy link
Author

sirber commented Dec 8, 2022

have you tried installing the kernel update? it's a required step on Windows 10 and WSL2.

@KRAOUFI
Copy link

KRAOUFI commented Dec 8, 2022

hey hey
in adition, i did those steps

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 8, 2022

@elsaco to give some context:

You seem to have Microsoft.VCLibs.140.00 installed, but the requirement is Microsoft.VCLibs.140.00.UWPDesktop, which is a different package (see the link I shared previously).

But beyond that, your message made me look into Ubuntu-20.04, and there was indeed an issue on this distro (fixed in #9279), so thank you for that.

@sirber
Copy link
Author

sirber commented Dec 8, 2022

Great work! 😄

@app-EL
Copy link

app-EL commented Dec 9, 2022

Same issue. PS Script noted from @sirber fixed it.

@RuffJK
Copy link

RuffJK commented Jan 9, 2023

I have the same issue with Windows 10 20H2 (OS Build 19042.2364)
I have run the script @sirber used, didn't help. Microsoft.VCLibs.140.00.UWPDesktop is installed.
Windows store is blocked (corporate computer) so I used --web-download to bypass that restriction.

Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> Get-AppxPackage -name Microsoft.VCLibs.140.00.UWPDesktop


Name              : Microsoft.VCLibs.140.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 14.0.30704.0
PackageFullName   : Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok



PS C:\WINDOWS\system32> wsl --version
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19042.2364
PS C:\WINDOWS\system32> wsl --install -d Ubuntu --web-download
Downloading: Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...
The group or resource is not in the correct state to perform the requested operation.
Error code: Wsl/InstallDistro/0x8007139f

WslLogs-2023-01-09_16-09-48.zip

@Biswa96
Copy link

Biswa96 commented Jan 9, 2023

Is it possible to install the package using winget?

@RuffJK
Copy link

RuffJK commented Jan 10, 2023

It seems the problem was that I was trying to install distributions using elevated admin powershell instance. Installation succeeded with normal credentials after I imported Ubuntu with wsl --import Ubuntu2004 c:\Ubuntu .\focal-server-cloudimg-amd64-wsl.rootfs.tar.gz and after that wsl --install -d Ubuntu

@cintya-takahaschi
Copy link

I am using Windows 11 (10.0.22621.1105), was trying to reinstall Ubuntu 22.04, was receiving error Wsl/InstallDistro/0x8007139f when tried to install via wsl --install, and error 0x80073d05 when tried using Microsoft Store.

What worked for me was stopping Windows Subsystem for Linux processes on Task Manager, delete directory C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04LTS_... directory and install again.

Worked both with Microsoft Store and wsl --install.

Viewed this on this post
https://medium.com/@kasiagauza/cant-install-linux-wsl-from-microsoft-store-error-0x80073d05-5639d9becbdb#:~:text=A%20quick%20solution%20for%20the,from%20removing%20a%20WSL%20directory.

@daixtrose
Copy link

It seems the problem was that I was trying to install distributions using elevated admin powershell instance.

I think this should be put in a prominent place of the docs.

@kbrannon95
Copy link

I am currently experiencing the same issue. I have attached my logs
WslLogs-2023-04-21_15-11-38.zip

@pyh-129
Copy link

pyh-129 commented May 21, 2023

The same error. How to fix it?

@blueboxes
Copy link

blueboxes commented Jun 15, 2023

I am seeing the same issue with Windows Server 2022 VM on Azure, I have tried each of the following:

  • Both Ubuntu and Debian along
  • wsl --update
  • download the linux kernel update package

with the suggestions above but no luck.

I saw these which I thought may give a clue but in the context of Windows server was not sure how to action:

Oddly if I install Rancher Desktop, and restart the machine but do not run it then all is fixed with WSL. I am yet to understand why.

@benhillis I see you closed this a while back, can it be re-opened or should we create a new issue as this thread has many different issues in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests