-
Notifications
You must be signed in to change notification settings - Fork 799
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
WSL2: Process cannot access the file because it is being used by another process #6415
Comments
feedback link: https://aka.ms/AAarxss |
Same error, and #5092 (comment) saves me. |
I've been fighting this issue for months and nothing has been working, so I switched back to WSL 1. Very frustrating. Today I found out that if I kill every non essential process with task manager, it works. What I find frustrating is: There is no way to tell which file can't be accessed, and which process is using this "file" All the "fixes" are just random solutions by random people running random commands that happened to work for them. Is there a sane and civilized way to figure out what resource is being used and how to release it, or are developers on Microsoft's platforms just satisfied with random trial and error to solve their problems? |
It's the IIS Worker Process. Still, I have to kill it on every rebuild :( |
Try to check if you had accidently mounted virtual disk to the window system. Check disk management and if you see virtual disk ,just detach it from the system. |
I have set I have also tried restarting Restarting my laptop works about 90% of the time, but not all of the time. Can we find a root cause for this issue? I use WSL extensively for work. The alternative at this point would be to exchange my Windows PC for a Mac; something I would really rather not do! |
As a side note, it appears that if you have the virtual drive saved to a location that syncs using OneDrive, if OneDrive starts the sync then you have to kill OneDrive before being able to access WSL. |
Have you tried to install WSL Preview from Windows Store and see if that works better? |
Kindly provide the steps and possibly screenshots on how to go about this thanks. |
This worked magic! Go to the Windows Command Prompt and type:
Then Restart your computer. NB: Don't Shutdown since it did not work for me. Instead, Restart! |
This worked well for me. Thanks |
Yes it works after restart. Thanks |
I used Then I try Now
This does not work: |
Please report the issue in that move-wsl repository. |
The VHDX that WSL2 uses is being locked by another application. It should be located at: Use an application like the Sysinternals handle utility to search for lock handles on VHDX files: Lachlan@Sekhmet:~$ handle vhdx
Nthandle v4.22 - Handle viewer
Copyright (C) 1997-2019 Mark Russinovich
Sysinternals - www.sysinternals.com
bztransmit64.exe pid: 18772 type: File 4DC: C:\Users\Lachlan\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx In my case, it was Backblaze trying to back it up, so I added VHDX to the list of excluded file extensions in Backblaze. |
|
Thanks a lot, this worked for me ❤️ |
Fixed it for me too. Thank you. 👍 |
You cannot do that.
Just rename PS C:\Users\default> mv E:\wsl\ext4.vhdx E:\wsl\ext4-source.vhdx
PS C:\Users\default> wsl --import Ubuntu E:\wsl E:\wsl\ext4-source.vhdx |
Worked also without the restart. |
How To solve errors in ext4.vhdx while moving or mounting WSL2 distro (docker-desktop-data in my case)
|
I had this error : "The process cannot access the file because it is being used by another process. Error code: Wsl/0x80070020" because I was moving my wsl2 from c: to d: with the Try to run (win + r) |
Environment
Steps to reproduce
After upgrading processor in system, WSL2 no longer starts with the error "The process cannot access the file because it is being used by another process." I have ensured that virtualization is enabled and the WSL Windows Features are there.
WSL logs:
Logs will be in Win+F Feedback per instructions.
Expected behavior
WSL2 Starts up.
Actual behavior
WSL2 does not start.
The text was updated successfully, but these errors were encountered: