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
WSL distro often boots up without a swap #9395
Comments
The path in |
Indeed using double backslashes should resolve the issue. If it does, please share /logs |
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:
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! |
The problem keeps occurring despite changing to double backslashes in my .wslconfig file: Please also find some WSL logs as requested by msftbot. |
Interesting. |
Sure thing. When showing 0 kB swaplsblk
dmesgoutput available here swapon -sno output Repairing swapAfter doing a lsblk
dmesgoutput available here swapon -s
|
Thank you @CComparon. This is interesting, there's nothing is Can you try to capture logs once the swap is just missing ? Once you're in that state, run: Hopefully this should capture the right error explaining what's happening to the swap disk. Also does this happen only if docker is running or does this also happen without docker ? |
What I did this time:
HTH! |
Based on the logs I can see that the swap disk is in:
In an elevated powershell ? |
@OneBlue Sure thing:
Again, the fact that the swap file exists and is corrupted before starting wsl seems to be the cause of the distro booting without a swap. |
I'm wondering, does starting WSL as administrator helps ? The permissions seems to only allow administrators to write that folder. What if you also give FullControl access to your current user ? |
My current user is T14\Cyril. Btw, I was able to reproduce on another machine (Windows 11), which seems to indicate that this problem is ubiquitous. |
I think the issue might be about a non-elevated user trying to open the existing swap file. Can you try granting FullControl T14\Cyril and seeing if that solves the issue ? |
I granted FullControl to T14\Cyril on the |
Interesting. I've added more logs to our log collection script, can you collect logs again when attaching the swap fails ? /logs |
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:
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! |
Sorry for the delay. Attached are logs your asked for using I am 99.9% certain anyone can reproduce this issue very easily, using the following recipe:
|
@benhillis I was not able to repeat it by simply restarting WSL as would be indicated by the fix for the bug, so that's good. I did not try directly trashing the existing file like OP had suggested. It seems to work across reboots now, but did not until I deleted the existing file. |
Version
Microsoft Windows [Version 10.0.19045.2364]
WSL Version
Kernel Version
Linux version 5.15.79.1-microsoft-standard-WSL2
Distro Version
Ubuntu 22.04
Other Software
No response
Repro Steps
Quite often, my distro starts without a swap (as shown by htop for instance), despite my .wslconfig:
Deleting the existing swap file, doing a
wsl --shutdown
and restarting the distro usually properly brings back the swap.I haven't figured out a pattern yet. Might happen more after WSL or windows didn't shut down gracefully.
Expected Behavior
Swap consistently set up and available upon distro startup.
Actual Behavior
Swap not always set up and available upon distro startup.
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: