microsoft / WSL

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

WSL2 install fails - if Xbox Default Storage location is changed from C-Drive prior to WSL2 installation #11141

Open themagiccog opened 9 months ago

themagiccog commented 9 months ago

Windows Version

Microsoft Windows [Version 10.0.22631.3085]

WSL Version

0.0.0.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.4.72

Distro Version

Ubuntu 22.04

Other Software

N/A

Repro Steps

On a fresh Windows 11 installation, if you install XBOX app first, and set a different Drive for default Storage (i.e. not C:/), you will get an error when you try to install WSL2 afterwards. The error is as follows:

Installing: Windows Subsystem for Linux 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.
image

Expected Behavior

The Expected Behavior should be:

Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Installing: Ubuntu
Ubuntu has been installed.
The requested operation is successful. Changes will not be effective until the system is rebooted.
image

Actual Behavior

On a fresh Windows 11 installation, if you install XBOX app first, and set a different Drive for default Storage (i.e. not C:/), you will get an error when you try to install WSL2 afterwards. The error is as follows:

Installing: Windows Subsystem for Linux 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.
image

Diagnostic Logs

N/A

### Tasks
- [ ] Resolve issue
ghost commented 9 months ago

There's clearly a laundry list of issues going on here. I was originally suspecting that you have some group policy causing your installation to fail. But on my test machines I can't even get as far as you've gotten. I'm going to need /logs, pretty please.

ghost commented 9 months ago

Note to self. Logs sent to appx team.

themagiccog commented 9 months ago

There's clearly a laundry list of issues going on here. I was originally suspecting that you have some group policy causing your installation to fail. But on my test machines I can't even get as far as you've gotten. I'm going to need /logs, pretty please.

Hello, yes... Let me see if the logs will have it. I have since resolved the issue by setting the Xbox Game default storage back to C:, and installing WSL2 then reverting my Xbox storage back to X: (don't judge... 😅)

But let me see if my system still has logs. I will follow instructions below to get this.

themagiccog commented 9 months ago

Note to self. Logs sent to appx team.

I have just seen this. Where you able to get logs for the issue? @pmartincic

ghost commented 9 months ago

Note to self. Logs sent to appx team.

I have just seen this. Where you able to get logs for the issue? @pmartincic

As I said before I see issues. That was a note to remind me I've already looked at this. I can't reproduce what you see hence why I asked you for logs.

ghost commented 9 months ago

/logs

themagiccog commented 9 months ago

WslLogs-2024-02-15_16-42-50.zip

See attached logs.

themagiccog commented 9 months ago

The attached logs are the recent logs. Like I said earlier, I was able to resolve my issue as detailed above.

This problem arouse when I just setup my PCnfor the first time.

Unfortunately I don't have access to any other PCs that have multiple drives. And I have already setup this PC for work and can't reinstall Windows unwittingly.

It's very easy to replicate thou. Spin up a new Windows 11 with multiple drives, Change Xbox directory to a diff directory from C:, try to install WSL2. This will fail. Please see if it's an error you can replicate in your lab.

ghost commented 9 months ago

As stated before, already did that, it doesn't work for me either. But I don't see the error that you see.

themagiccog commented 8 months ago

Detailed Issue

@pmartincic @bterlson @kant @gaia

Ok. I had to rebuild my system to replicate this error, and I can confirm that its a bug. So, here are the steps for you to replicate.

image

Also, you can see that the default storage was still C: .

image

Logs

I also started running the log script below before I began steps above.:

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

And the output of the logs are attached: WslLogs-2024-03-11_15-07-23.zip


Summary

Please let me know how we can resolve this bug. The only walkaround for now is to revert the Xbox Default Drive Change (to C:) and then running wsl --install. This seems to work.

dmitriid commented 7 months ago

I confirm @themagiccog's finding. Same thing is happening right now to me.

themagiccog commented 7 months ago

@pmartincic Any updates?

ghost commented 7 months ago

This is not an official build, if you still see issues when trying this build, please get back to me with more logs from this post, in addition to our logs. https://github.com/microsoft/WSL/issues/11319#issuecomment-2021040896 https://1drv.ms/u/s!ApJY8OVsSSJ-gQn_I1D8e4y45kJq?e=yJEOlc