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

The process cannot access the file because it is being used by another process #35

Open
sisrfeng opened this issue Jul 18, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@sisrfeng
Copy link

Describe the bug

After this:
image

There was E:\wsl\ext4.vhdx
When I issued wsl, a window flashed out and I could not get into ubuntu.
I issued wsl --list --verbose and could find ubuntu, but its state was "stop".

Then I try wsl --unregister Ubuntu

Now wsl --list shows nothing, but E:\wsl\ext4.vhdx is still there.
How can I use the E:\wsl\ext4.vhdx? I have important files in that ubuntu distro

In pwsh.exe:

PS C:\Users\MeMeMe> wsl --import Ubuntu E:\wsl E:\wsl\ext4.vhdx
The process cannot access the file because it is being used by another process

@sisrfeng sisrfeng added the bug Something isn't working label Jul 18, 2022
@pxlrbt
Copy link
Owner

pxlrbt commented Jul 18, 2022

Was there no output by the script?
Why did you run wsl --unregister Ubuntu?
I don't think you can import ext4.vhdx only *.tar files

I would try to re-register the WSL distro via Registry.

@SayakMukhopadhyay
Copy link
Collaborator

I think I tried to fix something like this in #32

@pxlrbt
Copy link
Owner

pxlrbt commented Jul 18, 2022

We don't know, as they didn't provide any logs or steps.

@sisrfeng
Copy link
Author

Was there no output by the script? Why did you run wsl --unregister Ubuntu? I don't think you can import ext4.vhdx only *.tar files

I would try to re-register the WSL distro via Registry.

The output of move-wsl.ps1 is :
Done!

Then I thought everything was OK, and wanted to start using my ubuntu.
I issued wsl, then a window flashed out and I could not get into ubuntu.

I searched with keywords "wsl state stop", and found an issue in wsl official repo, and a comment adviced using wsl --unregister Ubuntu. Now I think that comment is misleading.

"re-register the WSL distro via Registry"
Today I read microsoft/WSL#4591 (comment)
and here is my HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss:
image

Should I do this and press OK now ?
image

@pxlrbt
Copy link
Owner

pxlrbt commented Jul 19, 2022

Sorry, I am not on Windows anymore, so I cannot test. Either this or that: microsoft/WSL#4591 (comment)

@SayakMukhopadhyay
Copy link
Collaborator

@sisrfeng please dont change registry settings without you knowing what they do or you trust the source. I will get back to you once I figure out the root cause for this.

@sisrfeng
Copy link
Author

Hi, any update?
Many thanks~

@sisrfeng
Copy link
Author

Hi, @SayakMukhopadhyay, any update?
Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants