microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.27k stars 813 forks source link

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

Open michael-imbeault opened 4 years ago

michael-imbeault commented 4 years ago

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 (https://github.com/microsoft/WSL/issues/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 commented 4 years ago

Please submit networking logs via feedback hub.

michael-imbeault commented 4 years ago

Sent - let me know if you need anything else.

phippg commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 (Microsoft@Microsoft.com) (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

n0dyjeff commented 4 years ago

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:

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 commented 4 years ago

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.

Hope this helps, Ed

n0dyjeff commented 4 years ago

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 commented 3 years ago

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 okir@monad.swb.de).
[    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 <Jason@zx2c4.com>. 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: dm-devel@redhat.com
[    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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.

pawelgnatowski commented 3 years ago

same issue on clean install of win11 22000.160, installed just docker and a few utilities. weird and annoying. Though additional observation - as i was able to run gedit. now i cannot. Gtk-WARNING **: 15:31:01.607: cannot open display: :0 i think the issue with display is correlated. some permission issue. - blind guess tho

benyaminl commented 3 years ago

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.

Sorry this option I tried still not solve the issue. nice try tho.

pawelgnatowski commented 3 years ago

Okay. Sorry. My issue was that inwas running my network scripts before the user logged in. Now that i switched to user logon schedule it works. Good luck guys. (Could write a book how to waste time getting wsl to run properly)

mickelliu commented 2 years ago

I encounter the similar issue, but was unable to resolve it with wsl --shutdown and restart.

I was trying to map to \mnt\d\code so that I can code python with WSL with Pycharm. Interestingly I can map to any folder under wsl but the mounted folders in \mnt\. So I believe there are some permission issues that I don't wanna brother solving. So my current workaround is to create another folder under home and go along with it.

yangyichu commented 2 years ago

I got the same issue today. I got two versions of ubuntu installed on my pc, 18.04 and 20.04, 18 worked but 20 was not. So luckily I can compare these two and see what's wrong. I also noticed some difference between these two versions in the reg table(Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss) in "base path", make sure it is your installed position because I imported it somewhere else and it got a "?\\" at the beginning. Then a clean shut down seems to solve the problem. To see if an instance of your ubuntu is running, just use wsl command line or other tools, I used a tool called wsl2distromanager which is free on github to manage my distros.

damonlynch commented 2 years ago

I am seeing the same problem as @mickelliu. I am running Microsoft Windows [Version 10.0.22000.282] with WSL2. The distro does not matter — it seems all are equally affected. From within Windows I can browse every folder under \\wsl.localhost\{DISTRO}\, except any folder found inside the mnt folder. It's ironic that these folders are in Windows! There is no problem accessing anything in /mnt/c , /mnt/d', etc., from within WSL.

ualter commented 2 years ago

Well, this seems to be silly, but... just in case, I comment here what solved this problem in my case.

It had this new environment that I was building (WSL2) and couldn't either reach the \wsl$ folder from Windows (explorer). But after created a simple folder inside WSL2 home (ex: /home//developer) the folder and navigation from Windows Explorer start to work normally.

Probably not the solution for all case (old environments), but might help those with a new one.

chiqui3d commented 2 years ago

Same problem https://github.com/microsoft/WSL/issues/7644, Edit: But I solved the problem https://github.com/microsoft/WSL/discussions/7646#discussioncomment-1608220

akbaryahya commented 2 years ago

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.

hmm strange but this fixes root folder access, before windows 11 22494 update I can access the root folder in file explorer but since that update I can't access the folder with the error display "attempt to access"

dmkjr commented 2 years ago

After reading a few comments I read on this thread, I went back to the drawing board. It's definitely a permissions issue.

Here was the fix. Ensure if you are running from something such as 'Task Scheduler' you do NOT select "run elevated". This will run WSL, sure. But it does not run with the same credentials you are logged in as (most likely). Unselect that option and profit!

Cheers!

Asterovim commented 2 years ago

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.

hmm strange but this fixes root folder access, before windows 11 22494 update I can access the root folder in file explorer but since that update I can't access the folder with the error display "attempt to access"

You saved my lifes yesterday.

This morning i have updated my computer with windows update and revert the regedit change : it's fixed ! Thanks you.

jarroyo28 commented 2 years ago

wsl error I'm having this issue when trying to open the c drive folder. I'll run explorer.exe inside the terminal however this only takes me to the windows file system, not the linux file system. Has anyone found a solution to this problem?

dolorain commented 2 years ago

same issue try every thing above, did not work must reboot(windwos)

windwos 22000.376 wsl2

RichardYann commented 2 years ago

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

lusu007 commented 2 years ago

I did run into the same problem today. This problem appeared in the past here and then but always could be fixed with a restart. Today neither a restart of WSL nor a restart of my PC helped. WSL is accessible via the Windows Terminal and I can cd into \\wsl$\Ubuntu with Powershell but the Explorer is loading endlessly.

I'm using Windows 11 Pro Insider Preview Build 22533.rs_prerelease.220107-2122.

EDIT: After completely turning my PC off and cutting the power for a minute everything works fine again. But it's a pain the butt to do that every time this happens.

Thorsten42 commented 2 years ago

I did also run into this issue. file://///wsl$/Ubuntu-20.04 is still accessible from firefox and restarting the explorer from the task manager fixes the issue.

WSL-Version: 0.50.2.0 Kernelversion: 5.10.74.3 WSLg-Version: 1.0.29 Windows-Version: 10.0.22000.434

rbwrightjr91 commented 2 years ago

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 (Microsoft@Microsoft.com) (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.

This is exactly my issue. I added a line to the sudoers file to enable passwordless startup of the cron service via Task Scheduler. Once I restarted WSL via powershell, everything was back to normal but cron was once again down. My environment is different though, Microsoft Windows [Version 10.0.22000.466] and Ubuntu 20.04.

zzjin commented 2 years ago

I have same issue randomly appear. My case,every thing was ok for some time,but suddenly cannot open wsl folder from explorer. explorer cannot access wsl because it using \\wsl.localhost\Ubuntu-20.04 and cause no command can start from wsl2 terminal. But I can access wsl2 folders from explorer using \\wsl$\Ubuntu-20.04 the key different is wsl.localhost vs wsl$, So there is some network bridge issues?

Restart wsl or restart computer cannot resolve this problem. version:

WSL version: 0.51.3.0
Kernel version: 5.10.93.2
WSLg version: 1.0.30
Windows version: 10.0.22557.1(update today but old version also have this bug)

According to discussed upper, I can confirm I do not using any cron/systemd sercices.

apriil15 commented 2 years ago

I have the same issue recently. (maybe 2 weeks I think) After I update my Windows, it seems there is no issue any more.

Q0 commented 2 years ago

Resolve this problem:

  1. Do backup.

    wsl --export Ubuntu "C:\Ubuntu.tar"
  2. Remove WSL. Use this article.

    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.

odbol commented 2 years ago

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

dgbruce commented 2 years ago

@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 commented 2 years ago

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

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

Q0 commented 2 years ago

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 commented 2 years ago

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.