-
Notifications
You must be signed in to change notification settings - Fork 855
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
wslbridge2 and WSLtty cannot start due to ERROR_SHARING_VIOLATION on vhdx file #10543
Comments
Per mintty/wsltty#342 (comment) it looks like it's a change in an undocumented interface. |
I got the same problem with Ubuntu. |
I'm suddenly having the same issue on my work PC, however just trying to start WSL normally causes the error.
Version info:
I tried looking up file handles with the Resource Monitor and Process Explorer, but I can't find anything using the file. I've had a few successes with launching WSL through |
Same issue as the above user "Ricaz" with the same version after a Windows update of "Windows Subsystem for Linux" last night: WSL-version: 2.0.9.0 Emitted mintty.exe with a -log option and get: note: wsl.exe output: Failed to attach disk 'C:\Users\MYUSERNAME\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc\LocalState\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process. I'm able to invoke wsl.exe via the cmd prompt without issue. |
Same issue here after windows update today. wsl --version wsl --list .\mintty.exe --version |
So, after replacing the wsltty binaries with version 3.7.0 (from 3.6.4) and getting a similar yet different error: ERROR: GetVmId:318: CreateLxProcess: The process cannot access the file because it is being used by another process. I downgraded by Ubuntu container to wsl version 1 with: wsl --list --verbose #note the Ubuntu name then: wsl --set-version [Ubuntu name] 1 This may cause other unknown issues, but it seems to have solve this particular issue. Another thread alludes to WSL version 2 compatibility issues. Apparently wslbridge2.exe is hooking into undocumented API calls within WSL version 2 (likely using LoadLibrary and GetProcAddress) and Microsoft is changing API points and behaviour under the hood. Who knows what is happening here -- I certainly do not. |
I became desperate and started looking around for an alternative to WSL Terminal. Windows Terminal from the app store works very nicely. You can set it to launch your WSL VM by default in the settings. The colors look right in vim. The font it uses by default looks great to me. Supports hot keys for tabbing. The interface seems simpler and cleaner than ConEmu. I like it so far. |
I ended up doing the same. It has a lot of annoying Windows hotkeys by default, but after removing most of them, it works okay. Only thing is it feels really heavy and laggy, where mintty is super responsive and light. When it just worked out of the box, I became a bit suspicious that Microsoft might intentionally be blocking alternatives.. |
I have the same issue as described with wsltty 3.7.0, WSL 2.0.9.2 on Windows 10.0.19044.3570 And I don't want to switch away from wsltty 😿 |
wslbridge2 has been updated to handle the API change. wsltty is not yet updated but just replacing the wslbridge2.exe with the nightly cygwin build will fix the issue. See discussion here mintty/wsltty#343 |
Works again with wsltty-3.7.0.2 |
What happened to me was that I accidentally double-clicked the VHD file and Windows mounted it automatically. I detached it via Computer Management > Disk Management and there's an offline VHD disk attached. I believe I marked it as offline at first too via dispark where I usually do compact disk. |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Windows Version
Microsoft Windows [Version 10.0.22631.2338]
WSL Version
2.0.0.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.123.1-microsoft-standard-WSL2
Distro Version
Debian trixie
Other Software
WSLtty 3.6.1.2
Repro Steps
Since a recent Windows or WSL update1, attempting to use WSL via WSLtty fails.
Repro steps:
C:\Users\adinwoodie\AppData\Local\wsltty\bin\mintty.exe --WSL="Debian" --configdir="C:\Users\adinwoodie\AppData\Roaming\wsltty" -~ -
from the Run dialogExpected Behavior
I get a WSLtty terminal I can use to access my Debian WSL installation.
Actual Behavior
The WSLtty window appears for a fraction of a second, then disappears.
Diagnostic Logs
Running WSLtty as
C:\Users\adinwoodie\AppData\Local\wsltty\bin\mintty.exe --WSL="Debian" --configdir="C:\Users\adinwoodie\AppData\Roaming\wsltty" -~ -h always -
– i.e. with the window set to not automatically close – produces a window with the following error message:I'll send the WSL logs in by email shortly.
Footnotes
This was working fine yesterday, 25 September 2023, and is failing today, 26 September 2023, although I hadn't booted my computer for approximately three weeks prior to 25 September, so there were a relatively large number of updates to install; the full list of installed updates for me per Windows Update is at wsltty won't start with wsl2 version 2.0.0 mintty/wsltty#342. ↩
The text was updated successfully, but these errors were encountered: