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

Windows terminal and explorer getting stuck trying to open \\wsl$ #6216

Closed
ViktorVerstraelen opened this issue Nov 9, 2020 · 8 comments
Closed

Comments

@ViktorVerstraelen
Copy link

ViktorVerstraelen commented Nov 9, 2020

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.572]
Your Distribution version: Ubuntu-20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

Set "startingDirectory" in windows terminal settings to "\\\\wsl$\\Ubuntu\\home\\"
Open Ubuntu tab in windows terminal

Or

Open windows explorer and go to \\wsl$\Ubuntu

Note: this was working fine a few days ago. I have no idea what has changed in the mean time.

WSL logs:

Expected behavior

The Ubuntu shell opens in windows terminal

The wsl file system opens in explorer

Actual behavior

Windows Terminal hangs (not responding)
Windows explorer is stuck loading the directory infinitely

Some additional notes:

I can open/use Ubuntu without issue if I omit the startingDirectory option ad use cd /home instead. The issue seems to be when referencing a path belonging to the wsl filesystem from windows.

Similarly, when I try to open a remote session in Visual Studio Code using "Open Folder in WSL" (which should let me choose a starting directory for the remote session) nothing happens. But when I open a WSL session without specifying a directory it works fine, and from there I am able to navigate VScode to any WSL directory I want.

All these things were working fine 2 days ago and have stopped working at the same time.

@ViktorVerstraelen
Copy link
Author

I appear to have solved the problem by running chkdsk in windows.

@marcusademola
Copy link

I have this problem also , Windows Explorer is getting slow and stuck.

When I run (in bash) :

explorer.exe .

It dosent open Explorer on Win10 side at all (as it used to open). Ctrl+C dosent work, Terminal window freeze too.

Did also CHKDSK (read only mode), but it didnt solve the problem.

Any hints what is causing the slowdown and how to solve it?

@ViktorVerstraelen
Copy link
Author

I think my problem was that a part of the WSL filesystem was somehow corrupted, which was solved by running CHKDSK. I'm afraid I don't know what else you could do to solve this, but i suggest you open a new issue as this one has been closed. The microsoft WSL team seems to be pretty responsive on GitHub.

Best of luck!

@pedrogk
Copy link

pedrogk commented Feb 26, 2021

Same thing happened to me.
In windows file explorer I could go to \wsl$ but then if I clicked on a distribution (ie Ubuntu) the file explorer would hang trying to access. Also, I was able to use wsl directly from the command line/terminal, but if I tried to launch the windows file explorer from within wsl (explorer.exe . ) then it got stuck there.

File system corruption was the culprit. But default chkdsk didn't do anything. Had to use it with the /offlinescanandfix and after that it was fixed.

@pamtbaau
Copy link

Running $ chkdsk /f in Windows Powershell with Administrator rights fixed the issue for me

  • Windows Explorer shows content of \\wsl$\Ubuntu-20.04 again
  • From WSL terminal, code . works again

Thanks @ViktorVerstraelen

@sapphire41
Copy link

Running $ chkdsk /f in Windows Powershell with Administrator rights fixed the issue for me

  • Windows Explorer shows content of \\wsl$\Ubuntu-20.04 again
  • From WSL terminal, code . works again

Thanks @ViktorVerstraelen

The problem does persist every couple of days though, what's the way to go for figuring out the root cause for vhdx corruption?

@estarossa0
Copy link

Running $ chkdsk /f in Windows Powershell with Administrator rights fixed the issue for me

  • Windows Explorer shows content of \\wsl$\Ubuntu-20.04 again
  • From WSL terminal, code . works again

Thanks @ViktorVerstraelen

this fixed it for me, I had the problem when I installed android studio and my wsl won't start in my windows terminal, also code . wouldn't work too. thank you

@synapp009
Copy link

My problem was that I created a windows shortcut of a folder of one of the folders of wsl.
Deleting it solved the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants