WSL: WSL --install Failing on Fresh Windows 11 Install
Version
Windows 11 Home Build 22621.963
WSL Version
- WSL 2
- WSL 1
Kernel Version
No response
Distro Version
No response
Other Software
No response
Repro Steps
- Install windows 11.
- Open terminal app.
- Run
wsl --install
Expected Behavior
wsl --install on a (almost completely) clean Windows 11 install to install WSL2 and Ubuntu.
Actual Behavior
Produces an error even though Storage Settings for new content are the system drive ©.
Diagnostic Logs
“The deployment operation was blocked due to a per-package-family policy restricting deployments on a non-system volume. Per policy, this app must be installed to the system drive, but that’s not set as the default. In Storage Settings, make the system drive the default location to save new content, then retry the install.”
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 9
- Comments: 26
I have investigated further. There appears to be a bug with syncing the settings between windows settings and the xbox app / wsl install. When I run
wsl --installI hear the spinning disk spin up. However, the windows settings have the SSD (C drive) selected for new content in all options. The xbox app is set to use the spinning HDD (D drive). Something is inconsistent here.Toggling the “New apps will save to” setting from C to D and back again fixed this!
However, this also changes the setting in the xbox app. These should probably be separate settings. There is also a clear UI synching bug here. Perhaps the user should also be notified that these are linked somehow as that is not clear.
Windows Storage Settings
Xbox Settings
Just wanted to say that none of the fixes here worked for me. So I had to dig deeper to check what’s going on for my specific case.
In my situation, I had run
wsl --updateon a pre-existing WSL install and that completely bricked my installation. Tried reinstalling WSL but to no avail.On one of the reinstall instances, I opened up and looked inside the Event Viewer logs and it turns out that WSL was trying to install itself to my
E:\drive even though both Windows and Xbox app settings pointed to myC:\drive as the default location.I disabled that drive in my BIOS and brute-forced the installation to then occur on the
C:\drive. However, I hit another issue where it said “The system cannot find the path specified” after runningwsl --install.More digging in Event Viewer revealed that the Appx Package Manager was trying to find a file called
AppxManifest.xmlin the WSL package and failing.Opened up an admin Powershell, navigated to the default
C:\Program Files\WindowsAppsfolder and tried to runlson the WSL package folder. Got an error. Seems like it was corrupted somehow.Used
Get-AppxPackage -allusersin the same Powershell session to get the list of all packages installed and found the offending WSL package that was causing an issue.Ran
Remove-AppxPackage -Package 'MicrosoftCorporationII.WindowsSubsystemForLinux_2.0.14.0_x64__8wekyb3d8bbwe'(this is the package on my system giving an issue, yours may be different).I then checked to see if, in the Optional Features of Windows, all of the required dependencies for WSL were enabled. I saw that “Windows Subsystem For Linux” was disabled so I enabled it and restarted my PC.
Finally, ran
wsl --updateagain and voila, everything worked beautifully.For where to look in Event Viewer to find out the necessary info, follow the “Get Diagnostic Information” section of this doc from Microsoft. It specifies two areas that pertains to AppxPackage troubleshooting.
Hopefully this helps someone out there who faces the same niche issue as me.
Your workaround worked for me as well, thanks! My Xbox settings were set to another drive to save space on my OS drive.
Same issue just happened to me after I had to do a System Restore and then reinstalled a game using the Xbox PC App/Windows Store. I set the download location to my secondary large D: drive, which had worked fine before and caused no problems with WSL, but this time I got “Could not access specified file” or something similar if I ran
wslfrom a Terminal. So I reinstalled and got OP’s error.The issue is 100% a problem using the Xbox App to install games to non-system partitions. No idea why it affects WSL, but it is still happening on Win 11 Pro in 2024.
OS Name Microsoft Windows 11 Pro Version 10.0.22631 Build 22631
Had a working Ubuntu WSL environment. Ran
wsl --update --pre-releaseAfter the update installed, tried to launch Ubuntu, the defaultwslhelp came up. Soon discovered it doesn’t think Ubuntu is there (checked the AppData, the vhdx is still there). Tried to runwsl --install -d Ubuntuorwsl --installand get the error noted in this report.My Settings > Storage all have the default drive to
C:\. My Xbox App usesE:\. I tried changing the Xbox default back toC:\and toggling the “New apps will save to” setting fromC:\toD:\, saved it, and changed back toC:\but this did not resolve it.I confirm !!
This solution worked wonderfully on my machine as i have a very old WSL2 installation. thanks a lot!
I managed to fix this by running
wsl --install --inboxand then runningwsl --install --web-downloadHey, guys. it’s my way to solve this problem:
1/ First I set storage to C: I found this idea here:https://learn.microsoft.com/en-us/windows/wsl/troubleshooting?source=recommendations
2/ and downloaded and tried to install wsl.2.1.4.0.x64.msi from here: https://github.com/microsoft/WSL/releases/download/2.1.4/wsl.2.1.4.0.x64.msi in the middle of installation I’ve got an error and installation wasn’t finish but I think it was useful operation I found this idea here: https://github.com/microsoft/WSL/issues/11275?ysclid=lu7cnswu3b494546470 Here is result screenshot
3/ I used command wsl --shutdown and wsl --update from Command prompt with admin rights. As I have got shutdown worked, but update no. I have got this idea here https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps Here you are result screenshot:
4/ Maybe here I reboot my machine or maybe not yet I don’t remember for sure.
5/ I installed ubuntu with command wsl --install -d Ubuntu I’ve got this idea here: https://github.com/microsoft/WSL/issues/9453#issuecomment-1851032020 Here is screenshot with a result
6/ After some time when progress bar in console was filled on 100% terminal with Linux appeared where linux asked me to create new user and password for it. I did it. Here you are result screenshot
I tried to start my docker desktop, but it still couldn’t start its engine

7/ after some docker desktop quit with an error Docker desktop - unexpected WSL error. An unexpected error was encountered while executing a WSL command. Common causes include excess rights issues, which occur after waking the computer or not being connected to your domain/active directory. Please try shooting WSL down (wsl --shutdown) and/or rebooting your computer. If not sufficient WSL may need to be reinstalled fully. Bla bla bla… Screenshot:
8/ Here I reboot my machine. Idea from intuition
9/ I started my docker, and it’s again quit with an error, but error was already different.
Docker desktop - WSL drive missing. The Docker desktop WSL data destroy drive is missing. The Docker desktop WSL data distro is registered with WSL, but its drive seems to be missing. If this issue persists, run “wsl --unregister docker-desktop-data” before restarting Docker Desktop. Note that unregistering the data destroy will delete any previously created containers.
As it’s not difficult to understand docker wants me to run command wsl --unregister docker-desktop-data from terminal. I didn’t close error message and opened terminal with administrator previledges and type there wsl --unregister docker-desktop-data It successfully unregistered what he needed. Screenshot, here you are
10/ Finally docker’s engine started!
I hope this was useful for you, if this was useful push reaction below. With love from Russia 💖
Windows 11 Pro Version 10.0.22635 Build 22635
My Ubuntu shell suddenly started giving “file not found” errors. I removed WSL & the needed files to try & start over from scratch. When I went to reinstall I got the warning about it needing to be installed to my system drive, which was the selected choice. Changing the app location from D & back to C doesn’t resolve this.
Even Windows Store gives the “you must install to the system drive” when it attempts to pull down the WSL updates.
EDIT: I even checked the registry for where app installs are configured. It shows that the C drive is the volume to be used. However, the “MediaId” and “Name” keys have somehow been blanked out.
I know how to get the “Name” value, but don’t know where to find the proper “MediaId” value to see if correcting those fixes the issue…
Also confirmed that using the XBOX App to default installs to the D drive changes the following Registry value for default install volume. Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\PackageVolumes\DefaultVolumeKey
That was being changed to “2” every time I launched the XBOX App. So now I have to have it configured for C (which I don’t want) and to prompt for the install location every time.
EDIT 2: Added feedback for the XBOX App itself, since this issue has been reported for so long here on github. https://aka.ms/AAnyhxu
Quick update here @John-P and for anyone looking for a solution. I did some research over the internet and found this workaround that worked for me: https://github.com/microsoft/WSL/issues/6405#issuecomment-1297311116
Now I am able to install Ubuntu and Debian distros, run Docker Desktop, enable the Kubernetes feature inside of it, etc.
Thanks!
Worked for me too, thanks!
The only things modified since OS install are:
I simply followed the steps in this support article: https://learn.microsoft.com/en-us/windows/wsl/install. I am not used to Windows (I usually use macOS/Linux) and simply followed the steps.
The guide says “This command will enable the features necessary to run WSL and install the Ubuntu distribution of Linux.”. However, do I need to enable “developer mode”? This is not mentioned.