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

Cannot access \\wsl$\Ubuntu in Explorer, cannot launch Windows commands from WSL #5718

Open
michael-imbeault opened this issue Aug 4, 2020 · 72 comments

Comments

@michael-imbeault
Copy link

Environment

Windows build number:  Win32NT             10.0.19041.0 Microsoft Windows NT 10.0.19041.0
Your Distribution version: Ubuntu 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL2

Steps to reproduce

  1. Go to \wsl$ in Explorer
  2. See the Ubuntu directory, click it
  3. Receive an error message "\wsl$\Ubuntu is not accessible. You might not have permission to use this network resource. Attempt to access invalid address".

Another problem which I think is linked - any command ("explorer.exe ." for example, or "code .") return "/mnt/c/Windows/explorer.exe: Invalid argument"
These work from windows paths (/mnt/c/Windows for example)

Expected behavior

Access the WSL directories through explorer, or be able to launch windows commands from WSL paths

Actual behavior

Errors as described above. Tried to search for similar open issues - a lot have similar symptoms (#4027) for example, but none of the fixes posted work.

Looked at the registry keys mentioned in these issues, all fine.
Tried to reinstall WSL completely (toggling the feature off, reboot, then on, reboot)
Tried to install another distro, same result
Tried to repair Ubuntu
Tried to repair Windows using
"sfc /scannow
dism /Online /Cleanup-Image /CheckHealth && dism /Online /Cleanup-Image /RestoreHealth
sfc /scannow
netcfg -d"

@therealkenc
Copy link
Collaborator

Please submit networking logs via feedback hub.

@michael-imbeault
Copy link
Author

Sent - let me know if you need anything else.

@phippg
Copy link

phippg commented Aug 5, 2020

This might be similar or the same issue as I and a couple other people are having in #5307. I will submit networking logs when I am next at my desktop.

@michael-imbeault
Copy link
Author

Tried running Windows Insiders 10 Dev channel + updated WSL2 to latest, then uninstalling / reinstalling WSL, no luck.
Also tried a full reset of network, nothing. At a loss here, and this is impacting my workflow a lot.

@michael-imbeault
Copy link
Author

michael-imbeault commented Aug 9, 2020

Tried installing on my work computer - works perfectly without issues - what are my options? I guess I have the nuclear reinstall Windows from scratch but I'd love to avoid that.

@michael-imbeault
Copy link
Author

Found a workaround! Weirdly, I can map \wsl$\Ubuntu as a network drive and access / copy files both ways! Also weirdly, I cannot map anything else than the base level folder - trying to map \wsl$\Ubuntu\home or anything else than \wsl$\Ubuntu fails.

Works for me for now, but still would like to see this issue properly resolved, as the second part of the problem is still present - cannot launch .exe from WSL if they are Windows side (a problem with VS Code for example).

Where would the problem be? Is there some register of the address where \wsl$\Ubuntu points to that is corrupted leading to the 'access invalid address' and 'invalid argument' errors?

Trying to do 'dir \wsl$\Ubuntu' from Powershell leads to "cd : Cannot find path '\wsl$\Ubuntu' because it does not exist." - yet I can access my mapped network drive (Z:) just fine.

Happy to help troubleshoot this, many people are experiencing the same.

@n0dyjeff
Copy link

n0dyjeff commented Aug 9, 2020

I am having the same issue accessing \wsl$\Ubuntu-20.04 from Explorer. However, this solution didn't work for me. When I attempted to create the network drive, I got "Windows cannot access \wsl$\Ubuntu-20.04", with error code 0x80070043 The network name cannot be found. When I run the Diagnose tool, I am told 'You do not have permission to access "\wsl$\Ubuntu-20.04"'

I can get to \wsl$\Ubuntu-20.04 via an unprivileged PowerShell, but not via Explorer.

I have looked at the permissions in the UserApp folder under Canonical, and my account has full privileges on all files there.

Any ideas?

@EdNutting
Copy link

EdNutting commented Aug 12, 2020

I hit the same issue and discovered what caused it:

Environment

Windows build number: Win32NT 10.0.18363.0 Microsoft Windows NT 10.0.18363.0
Your Distribution version: Ubuntu 18.04
Whether the issue is on WSL 2 and/or WSL 1: WSL2 (Linux version 4.4.0-18362-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #836-Microsoft Mon May 05 16:04:00 PST 2020)

Steps to reproduce

  1. Install and setup WSL2 as normal
  2. Verify that Ubuntu file system can be accessed via explorer.exe using the path \\wsl$\Ubuntu
  3. Configure sudo access for default user for sshd without a password. Within WSL:
    • sudo visudo
    • Add this line after %sudo...
      your_username ALL=(ALL) NOPASSWD:/etc/init.d/ssh
  4. Configure a basic task to start SSHD when the computer boots
    • Open Task Scheduler
    • Within Task Scheduler Library, find the folder for the machine
    • Create a Basic Task:
      Trigger when computer starts,
      Action: start a program,
      Script: %windir%\System32\bash.exe
      Args: -c "sudo /etc/init.d/ssh start"
  5. Restart the computer
  6. Attempt to access \\wsl$\Ubuntu
  7. Access will be denied - permissions error. No workaround currently posted appears to work.

Expected behavior

WSL SSH should have been started and the WSL VHD should still be accessible.

Actual behavior

WSL SSH has started but access to the WSL VHD is denied. I suspect this is because WSL is first booted from an admin account / system account during startup, so the permissions end up incorrect. After removing the Task from Task Scheduler and rebooting, the WSL VHD became accessible again.

Additional notes

  • This probably isn't the same cause as others are having but I hope it will help to diagnose the underlying problem in WSL.
  • I am running Windows 10 Education Edition - hence the slightly out of date Windows build since the latest version hasn't been distributed to me yet.
  • I understand the risks (vs rewards) of granting passwordless sudo access etc.

@n0dyjeff
Copy link

n0dyjeff commented Aug 12, 2020

HI Ed,
Thanks for your post. I'm a little confused by your steps to reproduce. My problem is that I can't get past step 2. I get different behaviors depending on how I attempt to access \wsl$\Ubuntu (after starting WSL2 by opening an Ubuntu window):

Environment
Microsoft Windows [Version 10.0.19041.450]

Steps to Reproduce

Step 1: Open an Ubuntu shell (to start WSL2).

Step 2: Using the following approaches, attempt to access the Linux file system:

  • Approach 1: Type \\wsl$\Ubuntu into the path entry bar at the top of File Explorer. That results in a "Windows cannot access..." error 0x80004005

  • Approach 2: Type cd \\wsl$\Ubuntu into an unprivileged PowerShell window. This works as expected. The directory is the root of a Linux file system.

  • Approach 3: Open a run window with <Winkey>+R and type explorer.exe \\wsl$\Ubuntu. This opens up a "My Documents" window in File Explorer.

  • Approach 4: From the Ubuntu shell, type explorer.exe .. This opens up a "My Documents" window in File Explorer

Expected behavior:
All of these approaches should result in access to the root of the Linux file system.

Actual behavior:
Only the second approach results in access to the Linux file system

@EdNutting
Copy link

Hi,

In my original post, I started with a working system - so the repro listed was showing how to go from a working system to a broken one (and back again). If your setup is already failing to access the WSL VHD (Virtual Hard Drive) then my repro steps above won't be much use. (I posted my info on this issue rather than creating a new, duplicate issue for what is probably the same underlying problem - but that's just a guess. Who knows! I'm sure someone with deeper knowledge of how Windows works could inform me.)

In all approaches it should be double-backslash, not single backslash, at the beginning of the path: \\wsl$\Ubuntu. I presume this was just a typo on Github (or perhaps some aspect of Markdown) otherwise none of the approaches would have worked.

  • Approach 1: This should work. Given you're already having trouble accessing WSL via Windows Explorer, I'm guessing there's some underlying issue.
  • Approach 2: This also works for me. Interesting that PowerShell gives you access when Windows Explorer won't - that seems like yet another issue. Are you able to run commands after cding into the WSL VHD?
  • Approach 3: Again, this should work and achieves the same as approach 1. When Windows Explorer is started with a path it can't access (for any reason/error), then it just defaults to My Documents, hence your experience.
  • Approach 4: explorer.exe on its own wouldn't achieve the intended result. You would need to run explorer.exe . to open Windows Explorer in the current directory.

Hope this helps,
Ed

@n0dyjeff
Copy link

Hi Ed,

Thanks for the clarification and the corrections. I've edited my post to correct them. The Markdown styling caused my
'\\" to show as a single "\". On approach #4, I had indeed forgotten the "." to indicate the current directory. When I did that, I got "My Documents" rather than the default Quick Access.

In Approach #2, (from PowerShell), Yes, I can run commands against the files I find there. For example, I can run git init and then add and commit files.

Thanks,
Jeff

@benyaminl
Copy link

benyaminl commented Feb 7, 2021

Hello I experience this on any clean install Windows 10 20H2 and WSL2 using Fedora Remix. Is there really no way to fix it other than mount it? Thanks.
Anyway I tried on several computer with clean install of Windows 10 20h2 and this is brought up. No cure, even after clean install.

Network Logs attached https://aka.ms/AAb2gdv
Anyway any windows command doesn't work on Linux Partition like TS/OP, so I think this is a normal behavior that could be considered broken on WSL2

[ben@BEN-ASUS-A43SV ~]$ strace explorer.exe .
execve("/mnt/c/WINDOWS/explorer.exe", ["explorer.exe", "."], 0x7ffff8cfdb68 /* 27 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x29c800)       = 0
set_tid_address(0x29c838)               = 89
brk(NULL)                               = 0x1668000
brk(0x1669000)                          = 0x1669000
sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7]) = 32
getpid()                                = 89
getcwd("/home/ben", 4096)               = 10
uname({sysname="Linux", nodename="BEN-ASUS-A43SV", ...}) = 0
getcwd("/home/ben", 4096)               = 10
open("/mnt/c/WINDOWS/explorer.exe", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_PATH) = 3
readlink("/proc/self/fd/3", "/mnt/c/WINDOWS/explorer.exe", 4095) = 27
fstat(3, {st_mode=S_IFREG|0544, st_size=4708328, ...}) = 0
stat("/mnt/c/WINDOWS/explorer.exe", {st_mode=S_IFREG|0544, st_size=4708328, ...}) = 0
close(3)                                = 0
open("/proc/self/mountinfo", O_RDONLY)  = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="36 25 8:16 / / rw,relatime - ext"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="e=755\n49 48 0:29 / /sys/fs/cgrou"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="roup cgroup rw,net_prio\n60 48 0:"..., iov_len=1024}], 2) = 731
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
getcwd("/home/ben", 4096)               = 10
open("/proc/self/mountinfo", O_RDONLY)  = 3
readv(3, [{iov_base="", iov_len=0}, {iov_base="36 25 8:16 / / rw,relatime - ext"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="e=755\n49 48 0:29 / /sys/fs/cgrou"..., iov_len=1024}], 2) = 1024
readv(3, [{iov_base="", iov_len=0}, {iov_base="roup cgroup rw,net_prio\n60 48 0:"..., iov_len=1024}], 2) = 731
readv(3, [{iov_base="", iov_len=0}, {iov_base="", iov_len=1024}], 2) = 0
close(3)                                = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, TIOCGPGRP, [86])               = 0
getpgid(0)                              = 86
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0
ioctl(0, TIOCGWINSZ, {ws_row=44, ws_col=168, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
                                                                                 dup(0)                                  = 3
                                                                                                                            socket(AF_VSOCK, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
     bind(4, {sa_family=AF_VSOCK, sa_data="\0\0\377\377\377\377\377\377\377\377\0\0\0\0"}, 16) = 0
                                                                                                  getsockname(4, {sa_family=AF_VSOCK, sa_data="\0\0O\24\343\341\377\377\377\377\0\0\0\0"}, [16]) = 0
                            listen(4, 4)                            = 0
                                                                       socket(AF_UNIX, SOCK_SEQPACKET, 0)      = 5
                                                                                                                  connect(5, {sa_family=AF_UNIX, sun_path="/run/WSL/8_interop"}, 110) = 0
                 write(5, "\6\0\0\0\244\0\0\0O\24\343\341\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 164) = 164
                                                                                                                 accept4(4, {sa_family=AF_VSOCK, sa_data="\0\0\367nz\4\2\0\0\0\0\0\0\0"}, [16], SOCK_CLOEXEC) = 6
                                         accept4(4, {sa_family=AF_VSOCK, sa_data="\0\0\370nz\4\2\0\0\0\0\0\0\0"}, [16], SOCK_CLOEXEC) = 7
                                                                                                                                         accept4(4, {sa_family=AF_VSOCK, sa_data="\0\0\371nz\4\2\0\0\0\0\0\0\0"}, [16], SOCK_CLOEXEC) = 8
                                                                 accept4(4, {sa_family=AF_VSOCK, sa_data="\0\0\372nz\4\2\0\0\0\0\0\0\0"}, [16], SOCK_CLOEXEC) = 9
                                                                                                                                                                 close(4)                                = 0
                                    rt_sigprocmask(SIG_BLOCK, [INT WINCH], NULL, 8) = 0
                                                                                       signalfd4(-1, [INT WINCH], 8, 0)        = 4
                                                                                                                                  poll([{fd=0, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=4, events=POLLIN}], 5, -1) = 1 ([{fd=9, revents=POLLIN}])
                                                                                                                         recvfrom(9, "\t\0\0\0 \0\0\0", 8, MSG_WAITALL, NULL, NULL) = 8
               brk(0x166b000)                          = 0x166b000
                                                                  recvfrom(9, "\26\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 24, 0, NULL, NULL) = 24
                                                                                                                                                          writev(2, [{iov_base="/mnt/c/WINDOWS/explorer.exe: Inv"..., iov_len=46}, {iov_base=NULL, iov_len=0}], 2/mnt/c/WINDOWS/explorer.exe: Invalid argument
                                                                                                                                      ) = 46
                                                                                                                                            close(5)                                = 0
               close(4)                                = 0
                                                          close(6)                                = 0
                                                                                                     close(7)                                = 0
                                                                                                                                                close(8)                                = 0
                   close(9)                                = 0
                                                              ioctl(3, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
close(3)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++

strace log explorer.exe

The screenshoot of other network location works other than wsl
image

But Mounting as Drive working, tried in-place upgrade, turn on off wsl, in fresh install PC with 20H2 image lead same problem
image

image

dmesg output

[    0.000000] Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020
[    0.000000] Command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=8
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000e0fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000001fffff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000000200000-0x00000000f7ffffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x0000000339ffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI not present or invalid.
[    0.000000] Hypervisor detected: Microsoft Hyper-V
[    0.000000] Hyper-V: features 0x2e7f, privilege high: 0x3b8030, hints 0x22c2c, misc 0x20bed7b2
[    0.000000] Hyper-V Host Build:19041-10.0-0-0.804
[    0.000000] Hyper-V: LAPIC Timer Frequency: 0x1e8480
[    0.000000] tsc: Marking TSC unstable due to running on Hyper-V
[    0.000000] Hyper-V: Using hypercall for remote TLB flush
[    0.000000] clocksource: hyperv_clocksource_tsc_page: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.000013] tsc: Detected 2195.013 MHz processor
[    0.000054] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000062] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000074] last_pfn = 0x33a000 max_arch_pfn = 0x400000000
[    0.000218] MTRR default type: uncachable
[    0.000221] MTRR fixed ranges disabled:
[    0.000228]   00000-FFFFF uncachable
[    0.000230] MTRR variable ranges disabled:
[    0.000232]   0 disabled
[    0.000234]   1 disabled
[    0.000236]   2 disabled
[    0.000238]   3 disabled
[    0.000240]   4 disabled
[    0.000242]   5 disabled
[    0.000244]   6 disabled
[    0.000246]   7 disabled
[    0.000248] Disabled
[    0.000251] x86/PAT: MTRRs disabled, skipping PAT initialization too.
[    0.000295] CPU MTRRs all blank - virtualized system.
[    0.000304] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC
[    0.000309] last_pfn = 0xf8000 max_arch_pfn = 0x400000000
[    0.003381] RAMDISK: [mem 0x02e35000-0x02e44fff]
[    0.003401] ACPI: Early table checksum verification disabled
[    0.003463] ACPI: RSDP 0x00000000000E0000 000024 (v02 VRTUAL)
[    0.003478] ACPI: XSDT 0x0000000000100000 000044 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.003499] ACPI: FACP 0x0000000000101000 000114 (v06 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.003522] ACPI: DSDT 0x00000000001011B8 01E184 (v02 MSFTVM DSDT01   00000001 MSFT 05000000)
[    0.003539] ACPI: FACS 0x0000000000101114 000040
[    0.003552] ACPI: OEM0 0x0000000000101154 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.003567] ACPI: SRAT 0x000000000011F33C 000290 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.003581] ACPI: APIC 0x000000000011F5CC 000088 (v04 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.003611] ACPI: Local APIC address 0xfee00000
[    0.005472] Zone ranges:
[    0.005478]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.005484]   DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
[    0.005489]   Normal   [mem 0x0000000100000000-0x0000000339ffffff]
[    0.005493] Movable zone start for each node
[    0.005495] Early memory node ranges
[    0.005499]   node   0: [mem 0x0000000000001000-0x000000000009ffff]
[    0.005504]   node   0: [mem 0x0000000000200000-0x00000000f7ffffff]
[    0.005508]   node   0: [mem 0x0000000100000000-0x0000000339ffffff]
[    0.009704] Zeroed struct page in unavailable ranges: 24929 pages
[    0.009712] Initmem setup node 0 [mem 0x0000000000001000-0x0000000339ffffff]
[    0.009720] On node 0 totalpages: 3350175
[    0.009724]   DMA zone: 59 pages used for memmap
[    0.009726]   DMA zone: 22 pages reserved
[    0.009730]   DMA zone: 3743 pages, LIFO batch:0
[    0.009933]   DMA32 zone: 16320 pages used for memmap
[    0.009936]   DMA32 zone: 1011712 pages, LIFO batch:63
[    0.141058]   Normal zone: 36480 pages used for memmap
[    0.141065]   Normal zone: 2334720 pages, LIFO batch:63
[    0.145184] ACPI: Local APIC address 0xfee00000
[    0.145216] ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
[    0.250181] IOAPIC[0]: apic_id 8, version 17, address 0xfec00000, GSI 0-23
[    0.250204] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.250215] ACPI: IRQ9 used by override.
[    0.250225] Using ACPI (MADT) for SMP configuration information
[    0.250264] smpboot: Allowing 8 CPUs, 0 hotplug CPUs
[    0.250308] [mem 0xf8000000-0xffffffff] available for PCI devices
[    0.250312] Booting paravirtualized kernel on Hyper-V
[    0.250320] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    1.399680] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:8 nr_node_ids:1
[    1.402165] percpu: Embedded 50 pages/cpu s167192 r8192 d29416 u262144
[    1.402184] pcpu-alloc: s167192 r8192 d29416 u262144 alloc=1*2097152
[    1.402187] pcpu-alloc: [0] 0 1 2 3 4 5 6 7
[    1.402236] Built 1 zonelists, mobility grouping on.  Total pages: 3297294
[    1.402240] Kernel command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=8
[    1.419611] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes, linear)
[    1.428148] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    1.428571] mem auto-init: stack:off, heap alloc:off, heap free:off
[    1.545185] Memory: 4096436K/13400700K available (14342K kernel code, 1617K rwdata, 3124K rodata, 1552K init, 2372K bss, 334024K reserved, 0K cma-reserved)
[    1.546516] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    1.546535] Kernel/User page tables isolation: enabled
[    1.546571] ftrace: allocating 43998 entries in 172 pages
[    1.608237] rcu: Hierarchical RCU implementation.
[    1.608242] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8.
[    1.608245]  All grace periods are expedited (rcu_expedited).
[    1.608247] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    1.608249] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8
[    1.618424] Using NULL legacy PIC
[    1.618431] NR_IRQS: 16640, nr_irqs: 488, preallocated irqs: 0
[    1.620544] random: get_random_bytes called from start_kernel+0x35b/0x51f with crng_init=0
[    1.620635] Console: colour dummy device 80x25
[    1.620646] printk: console [tty0] enabled
[    1.620676] ACPI: Core revision 20190816
[    1.621136] Failed to register legacy timer interrupt
[    1.621138] APIC: Switch to symmetric I/O mode setup
[    1.621205] Hyper-V: Using IPI hypercalls
[    1.621208] Hyper-V: Using enlightened APIC (xapic mode)
[    1.621594] Calibrating delay loop (skipped), value calculated using timer frequency.. 4390.02 BogoMIPS (lpj=21950130)
[    1.621601] pid_max: default: 32768 minimum: 301
[    1.621649] LSM: Security Framework initializing
[    1.621737] Mount-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    1.621806] Mountpoint-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    1.623750] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
[    1.623753] Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
[    1.623766] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    1.623769] Spectre V2 : Mitigation: Full generic retpoline
[    1.623771] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    1.623772] Spectre V2 : Enabling Restricted Speculation for firmware calls
[    1.623776] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    1.623778] Spectre V2 : User space: Mitigation: STIBP via seccomp and prctl
[    1.623781] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl and seccomp
[    1.623789] MDS: Vulnerable: Clear CPU buffers attempted, no microcode
[    1.624284] Freeing SMP alternatives memory: 44K
[    1.624574] smpboot: CPU0: Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz (family: 0x6, model: 0x2a, stepping: 0x7)
[    1.624836] Performance Events: unsupported p6 CPU model 42 no PMU driver, software events only.
[    1.624922] rcu: Hierarchical SRCU implementation.
[    1.625261] smp: Bringing up secondary CPUs ...
[    1.625478] x86: Booting SMP configuration:
[    1.625481] .... node  #0, CPUs:      #1
[    1.627539] MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.
[    1.627539]  #2 #3 #4 #5 #6 #7
[    1.643707] smp: Brought up 1 node, 8 CPUs
[    1.643707] smpboot: Max logical packages: 1
[    1.643707] smpboot: Total of 8 processors activated (35120.20 BogoMIPS)
[    1.862940] node 0 initialised, 2242560 pages in 220ms
[    1.863385] devtmpfs: initialized
[    1.863385] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    1.863385] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[    1.872822] xor: automatically using best checksumming function   avx
[    1.873582] NET: Registered protocol family 16
[    1.873970] ACPI: bus type PCI registered
[    1.874009] PCI: Fatal: No config space access function found
[    1.883800] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    1.902523] raid6: Forced to use recovery algorithm intx1
[    1.902523] raid6: Forced gen() algo avx2x4
[    1.903324] ACPI: Added _OSI(Module Device)
[    1.903328] ACPI: Added _OSI(Processor Device)
[    1.903331] ACPI: Added _OSI(3.0 _SCP Extensions)
[    1.903336] ACPI: Added _OSI(Processor Aggregator Device)
[    1.903341] ACPI: Added _OSI(Linux-Dell-Video)
[    1.903345] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    1.903349] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
[    1.966862] ACPI: 1 ACPI AML tables successfully acquired and loaded
[    1.983219] ACPI: Interpreter enabled
[    1.983239] ACPI: (supports S0 S5)
[    1.983244] ACPI: Using IOAPIC for interrupt routing
[    1.983303] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    1.984433] ACPI: Enabled 2 GPEs in block 00 to 0F
[    2.014006] iommu: Default domain type: Translated
[    2.014381] SCSI subsystem initialized
[    2.014709] hv_vmbus: Vmbus version:5.0
[    2.014709] PCI: Using ACPI for IRQ routing
[    2.014709] PCI: System does not support PCI
[    2.042902] hv_vmbus: Unknown GUID: c376c1c3-d276-48d2-90a9-c04748072c60
[    2.044703] clocksource: Switched to clocksource hyperv_clocksource_tsc_page
[    2.560658] VFS: Disk quotas dquot_6.6.0
[    2.560686] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    2.560768] FS-Cache: Loaded
[    2.560819] pnp: PnP ACPI init
[    2.561505] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[    2.561578] pnp: PnP ACPI: found 1 devices
[    2.573332] NET: Registered protocol family 2
[    2.573609] tcp_listen_portaddr_hash hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    2.573657] TCP established hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    2.575325] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    2.575539] TCP: Hash tables configured (established 131072 bind 65536)
[    2.575605] UDP hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    2.575680] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    2.575809] NET: Registered protocol family 1
[    2.576526] RPC: Registered named UNIX socket transport module.
[    2.576527] RPC: Registered udp transport module.
[    2.576528] RPC: Registered tcp transport module.
[    2.576529] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.576533] PCI: CLS 0 bytes, default 64
[    2.576599] Trying to unpack rootfs image as initramfs...
[    2.576774] Freeing initrd memory: 64K
[    2.576778] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    2.576781] software IO TLB: mapped [mem 0xf4000000-0xf8000000] (64MB)
[    2.576907] kvm: no hardware support
[    2.576910] has_svm: not amd or hygon
[    2.576911] kvm: no hardware support
[    2.581024] Initialise system trusted keyrings
[    2.581267] workingset: timestamp_bits=46 max_order=22 bucket_order=0
[    2.584190] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.585892] NFS: Registering the id_resolver key type
[    2.585903] Key type id_resolver registered
[    2.585905] Key type id_legacy registered
[    2.585909] Installing knfsd (copyright (C) 1996 [email protected]).
[    2.588384] Key type cifs.idmap registered
[    2.588508] fuse: init (API version 7.31)
[    2.588747] SGI XFS with ACLs, security attributes, realtime, scrub, repair, no debug enabled
[    2.590556] 9p: Installing v9fs 9p2000 file system support
[    2.590575] FS-Cache: Netfs '9p' registered for caching
[    2.590644] FS-Cache: Netfs 'ceph' registered for caching
[    2.590647] ceph: loaded (mds proto 32)
[    2.596492] NET: Registered protocol family 38
[    2.596498] Key type asymmetric registered
[    2.596500] Asymmetric key parser 'x509' registered
[    2.596523] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    2.597496] hv_vmbus: registering driver hv_pci
[    2.597972] ACPI: AC Adapter [AC1] (on-line)
[    2.598582] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.599477] Non-volatile memory driver v1.3
[    2.600024] battery: ACPI: Battery Slot [BAT1] (battery present)
[    2.606492] brd: module loaded
[    2.608773] loop: module loaded
[    2.609154] hv_vmbus: registering driver hv_storvsc
[    2.609269] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    2.610094] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.610096] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <[email protected]>. All Rights Reserved.
[    2.610134] tun: Universal TUN/TAP device driver, 1.6
[    2.610305] PPP generic driver version 2.4.2
[    2.610465] PPP BSD Compression module registered
[    2.610467] PPP Deflate Compression module registered
[    2.610473] PPP MPPE Compression module registered
[    2.610474] NET: Registered protocol family 24
[    2.610483] hv_vmbus: registering driver hv_netvsc
[    2.616516] scsi host0: storvsc_host_t
[    2.651964] VFIO - User Level meta-driver version: 0.3
[    2.652305] hv_vmbus: registering driver hyperv_keyboard
[    2.652805] rtc_cmos 00:00: RTC can wake from S4
[    2.677630] rtc_cmos 00:00: registered as rtc0
[    2.677654] rtc_cmos 00:00: alarms up to one month, 114 bytes nvram
[    2.678008] device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: [email protected]
[    2.678845] hv_utils: Registering HyperV Utility Driver
[    2.678847] hv_vmbus: registering driver hv_utils
[    2.678920] hv_vmbus: registering driver hv_balloon
[    2.678936] hv_utils: cannot register PTP clock: 0
[    2.678991] dxgk:err: dxg_drv_init  Version: 1
[    2.678997] hv_vmbus: registering driver dxgkrnl
[    2.679253] drop_monitor: Initializing network drop monitor service
[    2.680236] hv_utils: TimeSync IC version 4.0
[    2.680400] Mirror/redirect action on
[    2.680667] hv_balloon: Using Dynamic Memory protocol version 2.0
[    2.681858] IPVS: Registered protocols (TCP, UDP)
[    2.681903] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    2.681908] hv_balloon: Cold memory discard enabled
[    2.683168] IPVS: ipvs loaded.
[    2.683172] IPVS: [rr] scheduler registered.
[    2.683173] IPVS: [wrr] scheduler registered.
[    2.683174] IPVS: [sh] scheduler registered.
[    2.684490] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
[    2.685257] Initializing XFRM netlink socket
[    2.685452] NET: Registered protocol family 10
[    2.686610] Segment Routing with IPv6
[    2.688499] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.688754] NET: Registered protocol family 17
[    2.688807] Bridge firewalling registered
[    2.688826] 8021q: 802.1Q VLAN Support v1.8
[    2.688886] sctp: Hash tables configured (bind 256/256)
[    2.689021] 9pnet: Installing 9P2000 support
[    2.689044] Key type dns_resolver registered
[    2.689055] Key type ceph registered
[    2.689734] libceph: loaded (mon/osd proto 15/24)
[    2.689738] hv_vmbus: registering driver hv_sock
[    2.690077] NET: Registered protocol family 40
[    2.690117] IPI shorthand broadcast: enabled
[    2.690330] registered taskstats version 1
[    2.690343] Loading compiled-in X.509 certificates
[    2.690990] Btrfs loaded, crc32c=crc32c-generic
[    2.692691] rtc_cmos 00:00: setting system clock to 2021-02-19T14:06:17 UTC (1613743577)
[    2.692735] Unstable clock detected, switching default tracing clock to "global"
               If you want to keep using the local clock, then add:
                 "trace_clock=local"
               on the kernel command line
[    2.696127] Freeing unused kernel image memory: 1552K
[    2.761845] Write protecting the kernel read-only data: 20480k
[    2.763082] Freeing unused kernel image memory: 1992K
[    2.763866] Freeing unused kernel image memory: 972K
[    2.764012] Run /init as init process
[    3.513815] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    3.514903] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    3.518361] random: crng init done
[    3.521667] sd 0:0:0:0: [sda] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[    3.521672] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    3.546147] sd 0:0:0:0: [sda] Write Protect is off
[    3.546152] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[    3.548612] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.611698] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    3.628594] sd 0:0:0:0: [sda] Attached SCSI disk
[    3.953268] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[    4.557756] Adding 4194304k swap on /swap/file.  Priority:-2 extents:2 across:4202496k
[    6.216897] scsi 0:0:0:1: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    6.227162] sd 0:0:0:1: Attached scsi generic sg1 type 0
[    6.230242] sd 0:0:0:1: [sdb] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[    6.230247] sd 0:0:0:1: [sdb] 4096-byte physical blocks
[    6.230900] sd 0:0:0:1: [sdb] Write Protect is off
[    6.230904] sd 0:0:0:1: [sdb] Mode Sense: 0f 00 00 00
[    6.231846] sd 0:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    6.402804] EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[    6.420816] sd 0:0:0:1: [sdb] Attached SCSI disk
[   51.510176] hv_balloon: Max. dynamic memory size: 13088 MB

sudo mount output

[ben@BEN-ASUS-A43SV ~]$ sudo mount
[sudo] password for ben:
/dev/sdb on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
tmpfs on /mnt/wsl type tmpfs (rw,relatime)
tools on /init type 9p (ro,relatime,dirsync,aname=tools;fmask=022,loose,access=client,trans=fd,rfd=6,wfd=6)
none on /dev type devtmpfs (rw,nosuid,relatime,size=6533360k,nr_inodes=1633340,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620,ptmxmode=000)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
C:\ on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;metadata;uid=1000;gid=1000;umask=22;fmask=11;case=off;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)
D:\ on /mnt/d type 9p (rw,noatime,dirsync,aname=drvfs;path=D:\;uid=1000;gid=1000;metadata;uid=1000;gid=1000;umask=22;fmask=11;case=off;symlinkroot=/mnt/,mmap,access=client,msize=65536,trans=fd,rfd=8,wfd=8)

@benyaminl
Copy link

@therealkenc based on the data, does this is occasionally happen or never happen on new machine installation? I'm tried to reinstall and use new profile/user, still face this problem across computer.
Does that mean my ISO is broken or any other thing that we could try to fix this? Thank you

@therealkenc
Copy link
Collaborator

occasionally happen or never happen on new machine installation?

Impossible to say whether the issue "never" happens on a new machine installation; but if it does, based on the two likes on the OP, the error ("/mnt/c/Windows/explorer.exe: Invalid argument") does not manifest on many fresh installs.

@benyaminl
Copy link

occasionally happen or never happen on new machine installation?

Impossible to say whether the issue "never" happens on a new machine installation; but if it does, based on the two likes on the OP, the error ("/mnt/c/Windows/explorer.exe: Invalid argument") does not manifest on many fresh installs.

So it's still not reproducable and hard to track down right?
I got same error for exact 20 computer on my Uni lab with same ISO. hmm..
It's really really strange..

@therealkenc
Copy link
Collaborator

So it's still not reproducable and hard to track down right?

Correct. There are two likes on the OP. Imagine the status of this issue if no one could run code.

I got same error for exact 20 computer on my Uni lab with same ISO. hmm..

There are two possibilities. There is something unique about those 20 machines. There is something unique about the ISO. You can get unadulterated Windows ISOs here to test the hypothesis.

@kanlukasz
Copy link

kanlukasz commented Mar 24, 2021

My WSL2 is working fine with VSCode but I am also unable to access \\wsl$\ in Explorer.

image

My OS: Win10 20H2 (build 19042.867)

@gm-lunatix
Copy link

gm-lunatix commented May 7, 2021

Same issue but slightly different error message (note the path is not wsl$ anymore but wsl.localhost) on preview build 21370.1

image

VSCode works fine, Windows Terminal Preview cannot access the home folder from settings anymore (it was a \wsl$... type path to my wsl home dir).

@spacewaffle
Copy link

spacewaffle commented May 8, 2021

I solved this issue by navigating to \\wsl$ in explorer, right clicking my Ubuntu folder, and clicking Map Network Drive. Hit finish. Explorer should open a new window with wsl mapped to your new network drive. In my case it was Z: drive. You still cannot access the files from \wsl$[your_distro] but you will have a drive under "This PC" in explorer that gives you access.

@hskun
Copy link

hskun commented May 8, 2021

the same issue happened today.
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.72-microsoft-standard-WSL2 x86_64)

System information as of Sat May 8 14:19:31 CST 2021

System load: 0.06 Processes: 8
Usage of /: 0.4% of 250.98GB Users logged in: 0
Memory usage: 1% IPv4 address for eth0: 172.30.89.2
Swap usage: 0%

1 update can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

terminal can login.
can't access files via explorer.

@ahaomar
Copy link

ahaomar commented Jun 25, 2021

Any solution for above. I am installing WSL for DDEV Docker i cant see my project files any one guide me from where i can see my files

@MrLoo1
Copy link

MrLoo1 commented Jun 29, 2021

Same issue but slightly different error message (note the path is not wsl$ anymore but wsl.localhost) on preview build 21370.1

image

VSCode works fine, Windows Terminal Preview cannot access the home folder from settings anymore (it was a \wsl$... type path to my wsl home dir).

you can run wsl --shutdown to fix issue

@gm-lunatix
Copy link

I have this issue since the preview build introducing "wsl.local". The workaround is, as previously mentioned
$wsl --shutdown
in a cmd window after every reboot, and of course I need to restart windows docker client to connect again to the WSL2 docker engine.

@benyaminl
Copy link

So it's still not reproducable and hard to track down right?

Correct. There are two likes on the OP. Imagine the status of this issue if no one could run code.

I got same error for exact 20 computer on my Uni lab with same ISO. hmm..

There are two possibilities. There is something unique about those 20 machines. There is something unique about the ISO. You can get unadulterated Windows ISOs here to test the hypothesis.

Hello di did try the new ISO file from the link on new computer, produce same result. Are you sure this isn't from Microsoft ISO Problem? Because this happen on many machine that I tried, with fresh iso downloaded from MS

@GlucNAc
Copy link

GlucNAc commented Aug 14, 2021

Hi everyone,

I'm facing the same problem but I can manage to overcome it. I think it is a problem of permission (in my case at least). Indeed, If I change the default user of my distro to root, then it works.

To do so, open the windows registry manager and go here:

\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{ID_OF_YOUR_DISTRO}

You can check you are editing the correct distro by looking at the "DistributionName" key.

Update the key "DefaultUid" to 0 in Decimal (please keep somewhere the value before putting 0).

Then restart your distro using PowerShell:

wsl --shutdown; wsl

You will be logged as root.

Then try to access to \wsl$\DISTRO_NAME via explorer.exe.

It is not a long term solution but I think it could help to find the right one if this solve the problem for you.

To restore the original default user, just put the id which was in the key "DefaultUid". You can also define the one you want by executing this command in the distro:

id -u NAME_OF_DEFAULT_USER_WANTED

This will return an integer you should place in "DefaultUid" key (in decimal mod).

I precise the problem comes from a distro I have imported from another PC. On the original PC, no such problem.

@Q0
Copy link

Q0 commented Apr 8, 2022

Resolve this problem:

  1. Do backup.
wsl --export Ubuntu "C:\Ubuntu.tar"
  1. Remove WSL. Use this article.
wsl.exe --shutdown
Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemforLinux | Remove-AppxPackage
  1. Restart the computer.
  2. In Windows PowerShell:
wsl --install
  1. Restart the computer.
  2. Open Ubuntu and set username/password
  3. Remove Ubuntu and import backup
wsl --unregister Ubuntu
wsl --import Ubuntu "C:\wsu" "C:\Ubuntu.tar"
  1. Profit!

Why will this method help solve the problem?

WSL from the command line comes with the latest version. And the necessary settings will be made automatically. It already has all the necessary and known fixes.

But WSL from the Microsoft Store has a lower version and is unstable for many.

For example:

  1. jetbrains (phpstorm, pycharm) have a freezing problem.
  2. problem with access to the explorer.

Don't use WSL from the Microsoft Store! Install with a command in PowerShell.

@odbol
Copy link

odbol commented May 7, 2022

This happened to me recently on Windows 10. Only thing I did was export my WSL distribution...

@dgbruce
Copy link

dgbruce commented Jun 26, 2022

@odbol Are you saying that merely exporting WSL caused a '\wsl$\LINUX' access error? If so, it is ironic that in my case, with Win11, merely exporting WSL corrected the problem! I was about to follow the rest of the (helpful) steps that @Q0 posted on Apr 8 when, after the export, it was back to 'normal'. It would be useful to know what changed (or caused it in the first place?!)

@dgbruce
Copy link

dgbruce commented Jun 26, 2022

(earlier today) "merely exporting WSL corrected the problem"

FYI: I spoke too soon... one Windows restart and the problem is back!

@Q0
Copy link

Q0 commented Jun 26, 2022

Hey @dgbruce, you really need to reinstall WSL. To do this, you need to uninstall WSL and install via PowerShell with the wsl --install command. Be sure to restart your computer after uninstalling WSL. I guess that your problem lies in the wrong register values. Manual fixing is not an option. But installing via the command line will help.

It would be great if you post your results. I think I have enough experience to help you with the problem. I'll be glad to help.

@TUNGHUAYU
Copy link

Same Issue

Name Value
OS Windows 10
OS build 19044.1706
WSL Ubuntu 18.04

The same issue happened after I did some work on ext4.vhdx(the private virtual hard drive) as link.

I solved the problem after I did the following steps:

  1. Open Windows Powershell (admin)
  2. wsl --shutdown <distro>
  3. wsl

p.s. It also works properly after reboot.

@benyaminl
Copy link

Resolve this problem:

1. Do backup.
wsl --export Ubuntu "C:\Ubuntu.tar"
2. Remove WSL. Use [this article](https://pureinfotech.com/uninstall-wsl2-windows-10/).
wsl.exe --shutdown
Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemforLinux | Remove-AppxPackage
3. Restart the computer.

4. In Windows PowerShell:
wsl --install
5. Restart the computer.

6. Open Ubuntu and set username/password

7. Remove Ubuntu and import backup
wsl --unregister Ubuntu
wsl --import Ubuntu "C:\wsu" "C:\Ubuntu.tar"
8. Profit!

Why will this method help solve the problem?

WSL from the command line comes with the latest version. And the necessary settings will be made automatically. It already has all the necessary and known fixes.

But WSL from the Microsoft Store has a lower version and is unstable for many.

For example:

1. jetbrains (phpstorm, pycharm) have a freezing problem.

2. problem with access to the explorer.

Don't use WSL from the Microsoft Store! Install with a command in PowerShell.

Tried this, sadly no luck. Does it mean only nucking the whole OS then it will works? Ugh, so sad...

@mingsxs
Copy link

mingsxs commented Aug 22, 2022

Is this issue solved? I can still see this problem on my PC today, my os build ver is: 22000.856 (WIN11 21H2)

@mingsxs
Copy link

mingsxs commented Aug 22, 2022

Hey, seems I accidentally found out a workaround to solve this issue. By shuting down the WSL and restart it via command line "wsl --shutdown; wsl" in windows Powershell, I can now access the WSL2 folders in win11 file explorer.

@benyaminl
Copy link

benyaminl commented Aug 23, 2022 via email

@sarah-noor-12232
Copy link

I was receiving similar issue.
The file explorer would either give the permissions error or load infinitely until windows restarted file explorer entirely.

restarting wsl or rebooting did not work, so I ran MS Defender Offline scan. It seems to work correctly as of now. Will report back in few days to see if it happens again.

@sarah-noor-12232
Copy link

sarah-noor-12232 commented Oct 6, 2022

I was receiving similar issue. The file explorer would either give the permissions error or load infinitely until windows restarted file explorer entirely.

restarting wsl or rebooting did not work, so I ran MS Defender Offline scan. It seems to work correctly as of now. Will report back in few days to see if it happens again.

It did :/

Details:

I was using wsl remote in vs code to do my work. Either some sort of crash happened randomly during work or due to wsl being open in file explorer for a while. However first thing I noticed is File Explorer restarted unexpectedly.

Then after that I cannot access \\wsl$ from file explorer. It loads infinitely until explorer hangs and restarts. This also happens when I go to Quick Access (as my wsl home directory is pinned there) and when I right click on the said pinned folder in left side view.

I can still access wsl and all its files through the wsl terminal and vs code. (I copied over my work to a native folder using terminal to submit it)

I tried running wsl --shutdown in admin powershell but hangs. And now I can't access wsl in any way, both the terminal and vs code remote hang.

Other research

I remember finding somewhere (edit: #6216) that chkdsk /f worked for them. I had recently tried it, but it failed as I only have one partition in drive and its what Windows is installed in, running just chkdsk gave no error. However it sounds like the MS Defender Offline Scan does something similar, which is why it might have worked. I may schedule a chkdsk /f upon next reboot if required but it looks risky.

So far this seems to be some hard drive type issue... and also related to file explorer only. Is it just an inevitable crash from an ntfs reader reading ext4 files on ntfs patition?

Edit: interestingly enough, the behavior reported in the tagged issue is same as I'm having. The Offline Scan temporarily fixes wsl, but then the crash happens again some time later.

@sarah-noor-12232
Copy link

update:

looked through superuser and a bit of #4027, I couldn't find wsl in Optional Features so I disabled and re-enabled wsl from control panel (requires 2 reboots). The file explorer issue seems to be fixed for now (all data and settings are apparently intact), still need to confirm if its temporary or permanent. if its a temporary fix, Offline Scan is still more feasible as it requires less user interaction and 1 reboot.

before disabling and enabling wsl, rebooting only allowed me to visit and use wsl directory in explorer for like a minute before crashing again.

@sarah-noor-12232
Copy link

sarah-noor-12232 commented Oct 12, 2022

update:

The crash happened again.
I guess wsl --shutdown was just running slower than before. Running it and then opening wsl again fixed it this time. I have no idea why wsl --shutdown and neofetch are now slower, could be something related to size of stuff stored in ubuntu desktop I guess.
However the wsl+file explorer issue seems resolved on my end now.

Edit: this sounds like some form of a memory issue, will monitor wsl memory usage to see if I find anything.

@tonyvarghese
Copy link

Absolutely the same issue Just restart the wsl2 without doing anything else can solve all of my problems: Open powershell and run with: wsl --shutdown wsl

This worked for me, thanks

@nickpainter
Copy link

In my case running Get-Service LxssManager | Restart-Service worked to resolve this issue.

@Kimi450
Copy link

Kimi450 commented Dec 1, 2022

I was struggling with this issue for a while but today I stopped using the "default" install of Ubuntu that comes with WSL and installed a separate version (Ubuntu 20.04) and I havent encountered this issue on 20.04. Maybe thats the workaround? Install something separately from the store and that wont give you issues?

EDIT: Nevermind... its back...

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Jan 27, 2023

For me, sometimes when I access and copy/paste files between windows/linux it will somehow lock up my system at some point later on. Any time app trys to read drives/filesystem it freezes. For example my machine can be running for months without issues, then I do something with the mapped network drive for wsl2 at some point applications will start freezing on me.

When it is in this state of frozen, if I end task explorer, it wont come back.
Then I can't even open task manager again as it is frozen shortcut keys dont work for it, clicking it on Ctrl+alt+delete menu does not launch it.
Running a command from wsl terminal that I still had open such as notepad.exe fails when this issue occures.

notepad.exe
<3>WSL (32112) ERROR: UtilAcceptVsock:246: accept4 failed 110

@olgreet
Copy link

olgreet commented Jan 30, 2023

I had this today - solved it by following the registry editing steps from this page:

https://superuser.com/questions/1682390/wsl-ubuntu-is-not-accessible-anymore-from-file-explorer

And then tried turning off and turning on WSL from PowerShell - turns out I had (or an update had) turned off the Virtual Machine Platform. Turned that back on, rebooted - working now.

@sarah-noor-12232
Copy link

For me when this happens, opening wsl console or vscode remote seems to solve it

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Feb 4, 2023

For me, when its locked up opening new wsl terminals fails.
Recently I increased the amount of RAM available in my %USERPROFILE%/.wslconfig to see if that helps any.
It's only been a day though so have not had it lock up again yet.

@rokups
Copy link

rokups commented Feb 25, 2023

So i ran into same issue. I have a feeling people here complain about multiple different causes that lead to the same outcome. I since have solved the problem so im just telling my story in hopes it gives a hint to someone/anyone how to find and fix one or more root causes of this.

I am new to WSL, so very first thing i did after installing windows was installing WSL from windows store. After that i was doing all kinds of random things, following directions on the internet, enabling windows features related to WSL directly, since apparently i got WSL1 running at first. And a range of seemingly benign actions led to system corruption where even though i could finally create WSL2 containers - only WSL1 containers were accessible through \\wsl$. A straightforward symptom of my problem was ArchWSLcreating a WSL1 container in %localappdata%\Packages when double-clicking Arch.exe, this container would be accessible from explorer but would not show up in wsl --list --all -v. I tread to get creative and wsl --import a new container into location of WSL1 container in ``%localappdata%\Packages. This yielded a half-success, because i was now able to browser new WSL2 container (which also shows up in wsl --list --all -v`), but only when container is offline. This must be due to differences how WSL1 and WSL2 handle access of containers. In the end everything seemed terribly broken and not working like for other people on the internet. Hope to fix it was lost.

So i did only sensible thing that was left - reinstall windows (thankfully install i did this on was only 24h old anyway). After reinstalling wsl i no longer did all kinds of random things, instead i installed wsl by running wsl --install --web-download followed by wsl --set-default-version 2. This immediately gave me a working WSL2 where double-clicking Arch.exe created a WSL2 container and it was accessible from explorer.

tl;dr;

The fix:

  • Reinstall windows
  • wsl --install --web-download
  • wsl --set-default-version 2

The conclusion: installing wsl-related things in a random order can mess up wsl beyond repair.

@damianboz
Copy link

damianboz commented May 2, 2023

Hey! I had the same issue but I fixed using the WSL console and executing the command:

sudo chown -R my_username /root

After this I was able to navigate the folder using the file explorer and use the VS code.

@AC-Lover
Copy link

Hey! I had the same issue but I fixed using the WSL console and executing the command:

sudo chown -R my_username /root

After this I was able to navigate the folder using the file explorer and use the VS code.

It worked for me, thanks ❤️

@janspoerer
Copy link

Did anybody find a permanent solution for this issue? I am struggling with this issue as well. (Using Windows 11 and the "plain" Ubuntu version from the Microsoft Store.)

@fonziemedia
Copy link

Been using my WSL Ubuntu setup for almost 2 years now and this just started to happen to me out of nowhere.. a permanent fix would be nice.

@mkhoatd
Copy link

mkhoatd commented Apr 13, 2024

For me the problem was I manually set WSL_DISTRO_NAME in ~/.bashrc. Remove that fix the Invalid argument error for all Windows app

@czepesch
Copy link

czepesch commented Jan 9, 2025

  • Approach 4: From the Ubuntu shell, type explorer.exe ..

Only this works for me

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

No branches or pull requests