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

Bind mounting /mnt/c to /mnt/wsl/c breaks other distros #6196

Closed
simonferquel opened this issue Nov 4, 2020 · 8 comments
Closed

Bind mounting /mnt/c to /mnt/wsl/c breaks other distros #6196

simonferquel opened this issue Nov 4, 2020 · 8 comments
Assignees

Comments

@simonferquel
Copy link

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.20246.0 Microsoft Windows NT 10.0.20246.0

Your Distribution version: Not distribution specific
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Note also applies to all WSL2 versions (Windows 10 2004 and the backport to 1903 / 1909) - running the test cas in Docker Desktop CI reproduces the issus in all versions.

Steps to reproduce

You need 2 distros to reproduce the issue.
I'll do the repro script with an Ubuntu + Alpine environment

  • start fresh, with no distro started:
> wsl --shutdown
  • From Ubuntu bind mount /mnt/c to /mnt/wsl/c: (/mnt/wsl/ prefix is important, it is to make sure it is present in all mount namespaces that mounts the /mnt/wsl shared tmpfs):
> wsl -d Ubuntu -u root mkdir /mnt/wsl/c
> wsl -d Ubuntu -u root mount --bind /mnt/c /mnt/wsl/c

(note that Alpine at this point has not been started, WSL has not initialized its mount namespace)

  • From Alpine, try to list files from /mnt/c:
> wsl -d Alpine ls /mnt/c

(it is empty)

  • From Alpine, try to list files from /mnt/wsl/c:
> wsl -d Alpine ls /mnt/wsl/c
ls: /mnt/wsl/c/DumpStack.log.tmp: Permission denied
ls: /mnt/wsl/c/hiberfil.sys: Permission denied
ls: /mnt/wsl/c/pagefile.sys: Permission denied
ls: /mnt/wsl/c/swapfile.sys: Permission denied
$Recycle.Bin               Config.Msi                 Go                         PerfLogs                   Program Files (x86)        System Volume Information  Windows.old                projects
$WinREAgent                Documents and Settings     Intel                      ProcessExplorer            ProgramData                Users                      dell                       temp
Apps                       Drivers                    OneDriveTemp               Program Files              Recovery                   Windows                    dell.sdr                   test-dir
  • From Alpine, get the actual mountinfo:
> wsl -d Alpine cat /proc/self/mountinfo
165 154 8:32 / / rw,relatime - ext4 /dev/sdc rw,discard,errors=remount-ro,data=ordered
166 165 0:20 /init /init ro,relatime - 9p tools ro,dirsync,aname=tools;fmask=022,loose,access=client,msize=65536,trans=fd,rfd=6,wfd=6
167 165 0:6 / /dev rw,nosuid,relatime - devtmpfs none rw,size=8130228k,nr_inodes=2032557,mode=755
168 167 0:49 / /dev/pts rw,nosuid,noexec,noatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000
169 165 0:16 / /sys rw,nosuid,nodev,noexec,noatime - sysfs sysfs rw
170 169 0:54 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755
171 170 0:30 / /sys/fs/cgroup/unified rw,nosuid,nodev,noexec,relatime - cgroup2 cgroup2 rw,nsdelegate
172 170 0:31 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpuset
173 170 0:32 / /sys/fs/cgroup/cpu rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpu
174 170 0:33 / /sys/fs/cgroup/cpuacct rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpuacct
175 170 0:34 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,blkio
176 170 0:18 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory
177 170 0:35 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,devices
178 170 0:36 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,freezer
179 170 0:37 / /sys/fs/cgroup/net_cls rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,net_cls
180 170 0:38 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,perf_event
181 170 0:39 / /sys/fs/cgroup/net_prio rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,net_prio
182 170 0:40 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,hugetlb
183 170 0:41 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,pids
184 170 0:42 / /sys/fs/cgroup/rdma rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,rdma
185 165 0:48 / /proc rw,nosuid,nodev,noexec,noatime - proc proc rw
186 185 0:21 / /proc/sys/fs/binfmt_misc rw,relatime - binfmt_misc binfmt_misc rw
187 165 0:50 / /run rw,nosuid,noexec,noatime - tmpfs none rw,mode=755
188 187 0:51 / /run/lock rw,nosuid,nodev,noexec,noatime - tmpfs none rw
189 187 0:52 / /run/shm rw,nosuid,nodev,noatime - tmpfs none rw
190 187 0:53 / /run/user rw,nosuid,nodev,noexec,noatime - tmpfs none rw,mode=755
191 165 0:55 / /usr/lib/wsl/drivers ro,nosuid,nodev,noatime - 9p drivers ro,dirsync,aname=drivers;fmask=333;dmask=222,mmap,access=client,msize=65536,trans=fd,rfd=4,wfd=4
192 165 0:56 / /usr/lib/wsl/lib ro,nosuid,nodev,noatime - 9p lib ro,dirsync,aname=lib;fmask=333;dmask=222,mmap,access=client,msize=65536,trans=fd,rfd=4,wfd=4
193 165 0:19 / /mnt/wsl rw,relatime shared:1 - tmpfs none rw
194 193 0:46 / /mnt/wsl/c rw,noatime shared:2 - 9p drvfsa rw,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;metadata;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio

Note that the c drive is indeed mounted in /mnt/wsl/c but wsl init process "forgot" to mount it into /mnt/c

WSL logs:
Not sure how to grab the /init logs for a given distro (that would really help to know that btw).

Expected behavior

My C drive in Alpine should be accessible from /mnt/c (as well as from /mnt/wsl/c as it has been bind-mounted there from Ubuntu - it is the intended goal of /mnt/wsl: share partial filesystem view accross distros by using bind mounts and shared propagation

Actual behavior

My C drive in Alpine is only accessible from /mnt/wsl/c, not from /mnt/c.

This was discovered by trying to fix docker/for-win#9364

@simonferquel
Copy link
Author

As always, I'm available for any additional info / would gladly help anyway I can

@simonferquel
Copy link
Author

dmesg output:

❯ wsl -d Ubuntu dmesg
[    0.000000] Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020
[    0.000000] Command line: initrd=\initrd.img panic=-1 nr_cpus=16 swiotlb=force pty.legacy_count=0
[    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 'compacted' 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-0x00000003ffffffff] 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, hints 0xa4e24, misc 0xe0bed7b2
[    0.000000] Hyper-V Host Build:20246-10.0-0-0.1
[    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] tsc: Detected 2304.008 MHz processor
[    0.000007] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000008] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000010] last_pfn = 0x400000 max_arch_pfn = 0x400000000
[    0.000024] MTRR default type: uncachable
[    0.000024] MTRR fixed ranges disabled:
[    0.000025]   00000-FFFFF uncachable
[    0.000025] MTRR variable ranges disabled:
[    0.000025]   0 disabled
[    0.000025]   1 disabled
[    0.000026]   2 disabled
[    0.000026]   3 disabled
[    0.000026]   4 disabled
[    0.000026]   5 disabled
[    0.000026]   6 disabled
[    0.000027]   7 disabled
[    0.000027] Disabled
[    0.000027] x86/PAT: MTRRs disabled, skipping PAT initialization too.
[    0.000031] CPU MTRRs all blank - virtualized system.
[    0.000032] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC
[    0.000034] last_pfn = 0xf8000 max_arch_pfn = 0x400000000
[    0.000043] Using GB pages for direct mapping
[    0.000045] BRK [0x02e00000, 0x02e00fff] PGTABLE
[    0.000045] BRK [0x02e01000, 0x02e01fff] PGTABLE
[    0.000046] BRK [0x02e02000, 0x02e02fff] PGTABLE
[    0.000374] RAMDISK: [mem 0x02e35000-0x02e43fff]
[    0.000376] ACPI: Early table checksum verification disabled
[    0.000421] ACPI: RSDP 0x00000000000E0000 000024 (v02 VRTUAL)
[    0.000424] ACPI: XSDT 0x0000000000100000 000044 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000427] ACPI: FACP 0x0000000000101000 000114 (v06 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000430] ACPI: DSDT 0x00000000001011B8 01E184 (v02 MSFTVM DSDT01   00000001 MSFT 05000000)
[    0.000432] ACPI: FACS 0x0000000000101114 000040
[    0.000433] ACPI: OEM0 0x0000000000101154 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000435] ACPI: SRAT 0x000000000011F33C 0003B0 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000437] ACPI: APIC 0x000000000011F6EC 0000C8 (v04 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000442] ACPI: Local APIC address 0xfee00000
[    0.000645] Zone ranges:
[    0.000645]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.000646]   DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
[    0.000647]   Normal   [mem 0x0000000100000000-0x00000003ffffffff]
[    0.000647] Movable zone start for each node
[    0.000648] Early memory node ranges
[    0.000648]   node   0: [mem 0x0000000000001000-0x000000000009ffff]
[    0.000649]   node   0: [mem 0x0000000000200000-0x00000000f7ffffff]
[    0.000649]   node   0: [mem 0x0000000100000000-0x00000003ffffffff]
[    0.000867] Zeroed struct page in unavailable ranges: 353 pages
[    0.000868] Initmem setup node 0 [mem 0x0000000000001000-0x00000003ffffffff]
[    0.000869] On node 0 totalpages: 4161183
[    0.000870]   DMA zone: 59 pages used for memmap
[    0.000871]   DMA zone: 22 pages reserved
[    0.000871]   DMA zone: 3743 pages, LIFO batch:0
[    0.000918]   DMA32 zone: 16320 pages used for memmap
[    0.000919]   DMA32 zone: 1011712 pages, LIFO batch:63
[    0.018887]   Normal zone: 49152 pages used for memmap
[    0.018888]   Normal zone: 3145728 pages, LIFO batch:63
[    0.019460] ACPI: Local APIC address 0xfee00000
[    0.019468] ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
[    0.019683] IOAPIC[0]: apic_id 16, version 17, address 0xfec00000, GSI 0-23
[    0.019686] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.019687] ACPI: IRQ9 used by override.
[    0.019689] Using ACPI (MADT) for SMP configuration information
[    0.019690] smpboot: Allowing 16 CPUs, 0 hotplug CPUs
[    0.019699] [mem 0xf8000000-0xffffffff] available for PCI devices
[    0.019699] Booting paravirtualized kernel on bare hardware
[    0.019701] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.113227] random: get_random_bytes called from start_kernel+0x93/0x4be with crng_init=0
[    0.113232] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:16 nr_node_ids:1
[    0.113781] percpu: Embedded 42 pages/cpu s133400 r8192 d30440 u262144
[    0.113784] pcpu-alloc: s133400 r8192 d30440 u262144 alloc=1*2097152
[    0.113785] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 12 13 14 15
[    0.113796] Built 1 zonelists, mobility grouping on.  Total pages: 4095630
[    0.113797] Kernel command line: initrd=\initrd.img panic=-1 nr_cpus=16 swiotlb=force pty.legacy_count=0
[    0.115668] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes)
[    0.116589] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes)
[    0.133498] Memory: 4096408K/16644732K available (14360K kernel code, 1575K rwdata, 2856K rodata, 1512K init, 2756K bss, 384316K reserved, 0K cma-reserved)
[    0.133697] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=16, Nodes=1
[    0.133701] ftrace: allocating 41883 entries in 164 pages
[    0.144459] rcu: Hierarchical RCU implementation.
[    0.144460] rcu:  RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=16.
[    0.144461]  All grace periods are expedited (rcu_expedited).
[    0.144461] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=16
[    0.146075] Using NULL legacy PIC
[    0.146076] NR_IRQS: 16640, nr_irqs: 552, preallocated irqs: 0
[    0.146314] Console: colour dummy device 80x25
[    0.146316] console [tty0] enabled
[    0.146321] ACPI: Core revision 20180810
[    0.146410] Failed to register legacy timer interrupt
[    0.146411] APIC: Switch to symmetric I/O mode setup
[    0.147737] x2apic: IRQ remapping doesn't support X2APIC mode
[    0.149054] Switched APIC routing to physical flat.
[    0.149070] Hyper-V: Using IPI hypercalls
[    0.149073] clocksource: hyperv_clocksource_tsc_page: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.149124] Calibrating delay loop (skipped), value calculated using timer frequency.. 4608.01 BogoMIPS (lpj=23040080)
[    0.149125] pid_max: default: 32768 minimum: 301
[    0.149141] Security Framework initialized
[    0.149162] Mount-cache hash table entries: 32768 (order: 6, 262144 bytes)
[    0.149177] Mountpoint-cache hash table entries: 32768 (order: 6, 262144 bytes)
[    0.149368] Last level iTLB entries: 4KB 64, 2MB 8, 4MB 8
[    0.149369] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 0, 1GB 4
[    0.149370] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.149371] Spectre V2 : Mitigation: Enhanced IBRS
[    0.149371] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.149376] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.149377] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl and seccomp
[    0.149550] Freeing SMP alternatives memory: 44K
[    0.150233] smpboot: CPU0: Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (family: 0x6, model: 0xa5, stepping: 0x2)
[    0.150271] Performance Events: unsupported p6 CPU model 165 no PMU driver, software events only.
[    0.150285] rcu: Hierarchical SRCU implementation.
[    0.150329] random: crng done (trusting CPU's manufacturer)
[    0.150381] smp: Bringing up secondary CPUs ...
[    0.150461] x86: Booting SMP configuration:
[    0.150462] .... node  #0, CPUs:        #1  #2  #3  #4  #5  #6  #7  #8  #9 #10 #11 #12 #13 #14 #15
[    0.150821] smp: Brought up 1 node, 16 CPUs
[    0.150821] smpboot: Max logical packages: 1
[    0.150821] smpboot: Total of 16 processors activated (73728.25 BogoMIPS)
[    0.219120] node 0 initialised, 3041002 pages in 70ms
[    0.220698] devtmpfs: initialized
[    0.220698] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.220698] futex hash table entries: 4096 (order: 6, 262144 bytes)
[    0.220698] xor: automatically using best checksumming function   avx
[    0.220698] NET: Registered protocol family 16
[    0.220698] ACPI: bus type PCI registered
[    0.220698] PCI: Fatal: No config space access function found
[    0.220698] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.220698] raid6: Forced to use recovery algorithm avx2x2
[    0.220698] raid6: Forced gen() algo avx2x4
[    0.220698] ACPI: Added _OSI(Module Device)
[    0.220698] ACPI: Added _OSI(Processor Device)
[    0.220698] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.220698] ACPI: Added _OSI(Processor Aggregator Device)
[    0.220698] ACPI: Added _OSI(Linux-Dell-Video)
[    0.220698] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    0.229604] ACPI: 1 ACPI AML tables successfully acquired and loaded
[    0.230163] ACPI: Interpreter enabled
[    0.230163] ACPI: (supports S0 S5)
[    0.230163] ACPI: Using IOAPIC for interrupt routing
[    0.230163] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.230163] ACPI: Enabled 2 GPEs in block 00 to 0F
[    0.230178] SCSI subsystem initialized
[    0.230178] hv_vmbus: Vmbus version:5.0
[    0.230178] PCI: Using ACPI for IRQ routing
[    0.230178] PCI: System does not support PCI
[    0.230303] clocksource: Switched to clocksource hyperv_clocksource_tsc_page
[    0.230581] hv_vmbus: Unknown GUID: c376c1c3-d276-48d2-90a9-c04748072c60
[    0.230609] hv_vmbus: Unknown GUID: 6e382d18-3336-4f4b-acc4-2b7703d4df4a
[    0.230836] hv_vmbus: Unknown GUID: dde9cbc0-5060-4436-9448-ea1254a5d177
[    0.230854] hv_vmbus: Unknown GUID: 6e382d18-3336-4f4b-acc4-2b7703d4df4a
[    0.240933] VFS: Disk quotas dquot_6.6.0
[    0.240943] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.241006] FS-Cache: Loaded
[    0.241062] pnp: PnP ACPI init
[    0.241213] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[    0.241245] pnp: PnP ACPI: found 1 devices
[    0.245032] NET: Registered protocol family 2
[    0.245279] tcp_listen_portaddr_hash hash table entries: 8192 (order: 5, 131072 bytes)
[    0.245291] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.245545] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
[    0.245609] TCP: Hash tables configured (established 131072 bind 65536)
[    0.245630] UDP hash table entries: 8192 (order: 6, 262144 bytes)
[    0.245648] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes)
[    0.245686] NET: Registered protocol family 1
[    0.246168] RPC: Registered named UNIX socket transport module.
[    0.246168] RPC: Registered udp transport module.
[    0.246168] RPC: Registered tcp transport module.
[    0.246169] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.246170] PCI: CLS 0 bytes, default 64
[    0.246225] Trying to unpack rootfs image as initramfs...
[    0.246350] Freeing initrd memory: 60K
[    0.246388] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.246389] software IO TLB: mapped [mem 0xf4000000-0xf8000000] (64MB)
[    0.246418] KVM: vmx: using Hyper-V Enlightened VMCS
[    0.344945] kvm: already loaded the other module
[    0.345657] Initialise system trusted keyrings
[    0.345752] workingset: timestamp_bits=46 max_order=22 bucket_order=0
[    0.346428] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.346748] NFS: Registering the id_resolver key type
[    0.346752] Key type id_resolver registered
[    0.346752] Key type id_legacy registered
[    0.346771] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.347681] Key type cifs.idmap registered
[    0.347733] fuse init (API version 7.27)
[    0.348220] SGI XFS with ACLs, security attributes, realtime, scrub, no debug enabled
[    0.349183] 9p: Installing v9fs 9p2000 file system support
[    0.349192] FS-Cache: Netfs '9p' registered for caching
[    0.349237] FS-Cache: Netfs 'ceph' registered for caching
[    0.349239] ceph: loaded (mds proto 32)
[    0.351840] NET: Registered protocol family 38
[    0.351841] Key type asymmetric registered
[    0.351842] Asymmetric key parser 'x509' registered
[    0.351848] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.351871] io scheduler noop registered (default)
[    0.352520] hv_vmbus: registering driver hv_pci
[    0.352756] hv_pci fdee2603-7675-464b-a64e-7ec0b95d310e: PCI VMBus probing: Using version 0x10002
[    0.353321] hv_pci fdee2603-7675-464b-a64e-7ec0b95d310e: PCI host bridge to bus a64e:00
[    0.353492] pci a64e:00:00.0: [1414:008e] type 00 class 0x030200
[    0.357036] hv_pci 6f74f752-7581-4490-a1a4-b2983557a12c: PCI VMBus probing: Using version 0x10002
[    0.357448] hv_pci 6f74f752-7581-4490-a1a4-b2983557a12c: PCI host bridge to bus a1a4:00
[    0.357608] pci a1a4:00:00.0: [1414:008e] type 00 class 0x030200
[    0.361138] ACPI: AC Adapter [AC1] (on-line)
[    0.361368] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.361608] battery: ACPI: Battery Slot [BAT1] (battery present)
[    0.361706] Non-volatile memory driver v1.3
[    0.364295] brd: module loaded
[    0.365032] loop: module loaded
[    0.365232] hv_vmbus: registering driver hv_storvsc
[    0.365268] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    0.365549] tun: Universal TUN/TAP device driver, 1.6
[    0.365615] PPP generic driver version 2.4.2
[    0.365690] PPP BSD Compression module registered
[    0.365690] PPP Deflate Compression module registered
[    0.365694] PPP MPPE Compression module registered
[    0.365695] NET: Registered protocol family 24
[    0.365697] hv_vmbus: registering driver hv_netvsc
[    0.365764] VFIO - User Level meta-driver version: 0.3
[    0.365874] hv_vmbus: registering driver hyperv_keyboard
[    0.366018] rtc_cmos 00:00: RTC can wake from S4
[    0.367075] rtc_cmos 00:00: registered as rtc0
[    0.367082] rtc_cmos 00:00: alarms up to one month, 114 bytes nvram
[    0.367175] device-mapper: ioctl: 4.39.0-ioctl (2018-04-03) initialised: dm-devel@redhat.com
[    0.367518] hv_utils: Registering HyperV Utility Driver
[    0.367518] hv_vmbus: registering driver hv_util
[    0.367538] hv_vmbus: registering driver hv_balloon
[    0.367543] dxgk:err: dxg_drv_init  Version: 1
[    0.367545] hv_vmbus: registering driver dxgkrnl
[    0.367558] hv_utils: cannot register PTP clock: 0
[    0.367689] drop_monitor: Initializing network drop monitor service
[    0.367706] Mirror/redirect action on
[    0.367876] IPVS: Registered protocols (TCP, UDP)
[    0.367887] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    0.368306] hv_utils: TimeSync IC version 4.0
[    0.368376] hv_balloon: Using Dynamic Memory protocol version 2.0
[    0.369673] scsi host0: storvsc_host_t
[    0.369712] hv_balloon: cold memory discard enabled
[    0.369895] IPVS: ipvs loaded.
[    0.369897] IPVS: [rr] scheduler registered.
[    0.369897] IPVS: [wrr] scheduler registered.
[    0.369898] IPVS: [sh] scheduler registered.
[    0.371496] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
[    0.371818] Initializing XFRM netlink socket
[    0.371865] NET: Registered protocol family 10
[    0.372434] Segment Routing with IPv6
[    0.374364] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    0.374435] NET: Registered protocol family 17
[    0.374448] Bridge firewalling registered
[    0.374470] 8021q: 802.1Q VLAN Support v1.8
[    0.374488] sctp: Hash tables configured (bind 256/256)
[    0.374520] 9pnet: Installing 9P2000 support
[    0.374528] Key type dns_resolver registered
[    0.374533] Key type ceph registered
[    0.374797] libceph: loaded (mon/osd proto 15/24)
[    0.374798] hv_vmbus: registering driver hv_sock
[    0.374860] NET: Registered protocol family 40
[    0.375075] registered taskstats version 1
[    0.375080] Loading compiled-in X.509 certificates
[    0.375295] Btrfs loaded, crc32c=crc32c-generic
[    0.375900] rtc_cmos 00:00: setting system clock to 2020-11-04 15:48:57 UTC (1604504937)
[    0.375913] 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
[    0.377346] Freeing unused kernel image memory: 1512K
[    0.459317] Write protecting the kernel read-only data: 20480k
[    0.460316] Freeing unused kernel image memory: 1984K
[    0.460575] Freeing unused kernel image memory: 1240K
[    0.460576] Run /init as init process
[    0.486818] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    0.621744] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    0.622169] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    0.623225] sd 0:0:0:0: [sda] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[    0.623226] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    0.623324] sd 0:0:0:0: [sda] Write Protect is off
[    0.623324] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[    0.623499] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.625693] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.634301] scsi 0:0:0:1: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    0.634546] sd 0:0:0:1: Attached scsi generic sg1 type 0
[    0.635135] sd 0:0:0:1: [sdb] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[    0.635136] sd 0:0:0:1: [sdb] 4096-byte physical blocks
[    0.635228] sd 0:0:0:1: [sdb] Write Protect is off
[    0.635229] sd 0:0:0:1: [sdb] Mode Sense: 0f 00 00 00
[    0.635371] sd 0:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.637552] sd 0:0:0:1: [sdb] Attached SCSI disk
[    0.641169] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: (null)
[    0.651833] EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[    0.661027] hv_pci 8e7052f3-aec1-4c22-bf7f-0331c57a6a72: PCI VMBus probing: Using version 0x10002
[    0.698058] Adding 4194304k swap on /swap/file.  Priority:-2 extents:2 across:4202496k
[    0.701328] hv_pci 8e7052f3-aec1-4c22-bf7f-0331c57a6a72: PCI host bridge to bus bf7f:00
[    0.701329] pci_bus bf7f:00: root bus resource [mem 0xe00000000-0xe00002fff window]
[    0.701687] pci bf7f:00:00.0: [1af4:1049] type 00 class 0x010000
[    0.702645] pci bf7f:00:00.0: reg 0x10: [mem 0xe00000000-0xe00000fff 64bit]
[    0.703445] pci bf7f:00:00.0: reg 0x18: [mem 0xe00001000-0xe00001fff 64bit]
[    0.704106] pci bf7f:00:00.0: reg 0x20: [mem 0xe00002000-0xe00002fff 64bit]
[    0.706770] pci bf7f:00:00.0: BAR 0: assigned [mem 0xe00000000-0xe00000fff 64bit]
[    0.707083] pci bf7f:00:00.0: BAR 2: assigned [mem 0xe00001000-0xe00001fff 64bit]
[    0.707396] pci bf7f:00:00.0: BAR 4: assigned [mem 0xe00002000-0xe00002fff 64bit]
[    0.722312] hv_pci 4009ad46-eda6-4c95-9e8e-063a8aa7f055: PCI VMBus probing: Using version 0x10002
[    0.762302] hv_pci 4009ad46-eda6-4c95-9e8e-063a8aa7f055: PCI host bridge to bus 9e8e:00
[    0.762303] pci_bus 9e8e:00: root bus resource [mem 0xe00004000-0xe00006fff window]
[    0.762705] pci 9e8e:00:00.0: [1af4:1049] type 00 class 0x010000
[    0.763717] pci 9e8e:00:00.0: reg 0x10: [mem 0xe00004000-0xe00004fff 64bit]
[    0.764159] pci 9e8e:00:00.0: reg 0x18: [mem 0xe00005000-0xe00005fff 64bit]
[    0.764658] pci 9e8e:00:00.0: reg 0x20: [mem 0xe00006000-0xe00006fff 64bit]
[    0.767472] pci 9e8e:00:00.0: BAR 0: assigned [mem 0xe00004000-0xe00004fff 64bit]
[    0.767780] pci 9e8e:00:00.0: BAR 2: assigned [mem 0xe00005000-0xe00005fff 64bit]
[    0.768082] pci 9e8e:00:00.0: BAR 4: assigned [mem 0xe00006000-0xe00006fff 64bit]
[    0.780153] FS-Cache: Duplicate cookie detected
[    0.780154] FS-Cache: O-cookie c=00000000cd90a8b7 [p=00000000b9371024 fl=222 nc=0 na=1]
[    0.780155] FS-Cache: O-cookie d=0000000041316fe2 n=000000006a3ee416
[    0.780155] FS-Cache: O-key=[10] '34323934393337333539'
[    0.780157] FS-Cache: N-cookie c=00000000502b8307 [p=00000000b9371024 fl=2 nc=0 na=1]
[    0.780157] FS-Cache: N-cookie d=0000000041316fe2 n=000000004222c9b1
[    0.780157] FS-Cache: N-key=[10] '34323934393337333539'
[    0.875340] hv_pci dcc5fdab-63a0-4540-b004-7b4fbb4728cb: PCI VMBus probing: Using version 0x10002
[    0.913567] hv_pci dcc5fdab-63a0-4540-b004-7b4fbb4728cb: PCI host bridge to bus b004:00
[    0.913568] pci_bus b004:00: root bus resource [mem 0xe00008000-0xe0000afff window]
[    0.913914] pci b004:00:00.0: [1af4:1049] type 00 class 0x010000
[    0.914954] pci b004:00:00.0: reg 0x10: [mem 0xe00008000-0xe00008fff 64bit]
[    0.915383] pci b004:00:00.0: reg 0x18: [mem 0xe00009000-0xe00009fff 64bit]
[    0.915806] pci b004:00:00.0: reg 0x20: [mem 0xe0000a000-0xe0000afff 64bit]
[    0.919636] pci b004:00:00.0: BAR 0: assigned [mem 0xe00008000-0xe00008fff 64bit]
[    0.919997] pci b004:00:00.0: BAR 2: assigned [mem 0xe00009000-0xe00009fff 64bit]
[    0.920340] pci b004:00:00.0: BAR 4: assigned [mem 0xe0000a000-0xe0000afff 64bit]
[    0.929057] hv_pci 0c4ecfee-2f64-4d94-8749-aa7f7c037510: PCI VMBus probing: Using version 0x10002
[    0.967009] hv_pci 0c4ecfee-2f64-4d94-8749-aa7f7c037510: PCI host bridge to bus 8749:00
[    0.967011] pci_bus 8749:00: root bus resource [mem 0xe0000c000-0xe0000efff window]
[    0.967428] pci 8749:00:00.0: [1af4:1049] type 00 class 0x010000
[    0.968614] pci 8749:00:00.0: reg 0x10: [mem 0xe0000c000-0xe0000cfff 64bit]
[    0.969044] pci 8749:00:00.0: reg 0x18: [mem 0xe0000d000-0xe0000dfff 64bit]
[    0.969588] pci 8749:00:00.0: reg 0x20: [mem 0xe0000e000-0xe0000efff 64bit]
[    0.972228] pci 8749:00:00.0: BAR 0: assigned [mem 0xe0000c000-0xe0000cfff 64bit]
[    0.972534] pci 8749:00:00.0: BAR 2: assigned [mem 0xe0000d000-0xe0000dfff 64bit]
[    0.972834] pci 8749:00:00.0: BAR 4: assigned [mem 0xe0000e000-0xe0000efff 64bit]
[    1.429398] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   12.588531] scsi 0:0:0:2: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[   12.589016] sd 0:0:0:2: Attached scsi generic sg2 type 0
[   12.589772] sd 0:0:0:2: [sdc] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[   12.589773] sd 0:0:0:2: [sdc] 4096-byte physical blocks
[   12.589889] sd 0:0:0:2: [sdc] Write Protect is off
[   12.589890] sd 0:0:0:2: [sdc] Mode Sense: 0f 00 00 00
[   12.590058] sd 0:0:0:2: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   12.591833] sd 0:0:0:2: [sdc] Attached SCSI disk
[   12.606740] EXT4-fs (sdc): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[   12.614387] FS-Cache: Duplicate cookie detected
[   12.614388] FS-Cache: O-cookie c=00000000be8e123d [p=00000000b9371024 fl=222 nc=0 na=1]
[   12.614389] FS-Cache: O-cookie d=0000000041316fe2 n=000000003382fe6f
[   12.614389] FS-Cache: O-key=[10] '34323934393338353432'
[   12.614390] FS-Cache: N-cookie c=0000000017253d7d [p=00000000b9371024 fl=2 nc=0 na=1]
[   12.614391] FS-Cache: N-cookie d=0000000041316fe2 n=00000000b2ab7115
[   12.614391] FS-Cache: N-key=[10] '34323934393338353432'
[   12.614591] init: (1) ERROR: ConfigApplyWindowsLibPath:2299: open /etc/ld.so.conf.d/ld.wsl.conf
[   12.614592]  failed 2
[   12.639549] WARNING: /usr/share/zoneinfo/Europe/Paris not found. Is the tzdata package installed?
[   30.049497] EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[   30.065780] FS-Cache: Duplicate cookie detected
[   30.065781] FS-Cache: O-cookie c=0000000017253d7d [p=00000000b9371024 fl=222 nc=0 na=1]
[   30.065782] FS-Cache: O-cookie d=0000000041316fe2 n=0000000080a49fe1
[   30.065782] FS-Cache: O-key=[10] '34323934393430323837'
[   30.065784] FS-Cache: N-cookie c=00000000680959b3 [p=00000000b9371024 fl=2 nc=0 na=1]
[   30.065784] FS-Cache: N-cookie d=0000000041316fe2 n=000000009a966431
[   30.065784] FS-Cache: N-key=[10] '34323934393430323837'

I can't see anything related. ConfigApplyLibPath seem to trigger an error in distros without a /etc/ls.so.conf.d dir (as Alpine which does not ship with a glibc anyway).

@Biswa96
Copy link

Biswa96 commented Nov 4, 2020

ConfigApplyWindowsLibPath function is not related to mounting /mnt/wsl. It mounts /usr/lib/wsl/ and it's directories for d3d12. In the output open /etc/ld.so.conf.d/ld.wsl.conf failed 2, the 2 is ENOENT: No such file or directory. Alpine does not have that folder. Did you play with the automount.crossDistro option?

@OneBlue
Copy link
Collaborator

OneBlue commented Jan 6, 2021

Thanks for reporting this @simonferquel.

Looking at the commands in the original post, this seems normal as /mnt/c is only bind mounted from the Ubuntu distro and it's not mounted from the Alpine distro.

For context: /mnt/wsl is shared between all distros, but /mnt isn't.

Does that make sense ?

@simonferquel
Copy link
Author

@OneBlue automount is enabled on both distros, and automount root is set as /mnt on both as well. Accordingly, WSL should make my C drive available on /mnt/c on both distros.
If I don't manually bind-mount /mnt/c to /mnt/wsl/c in Ubuntu before starting Alpine, I can correctly access /mnt/c on both Ubuntu and Alpine.

To give a little context here, I am working on Docker Desktop. In our setup, we run the docker daemon in a separate distro (that we entirely control) and whenever you want to mount source code from your distro into a container (using docker run -v /source/path/in/my/distro:/path/in/container ... ), we create an intermediate bind mount within /mnt/wsl so that the Docker Desktop distro can access it. If you have some sources living on a Windows volume, it triggers the issue.

@OneBlue
Copy link
Collaborator

OneBlue commented Jan 22, 2021

@simonferquel: I've had a deeper look, and here's the root cause:

When init is about to mount a drive, it searches /proc/self/mounts for any existing mount on the same drive. If any is found, then the drive is not mounted (even if the mount point is different).

So when you bind mount /mnt/c to /mnt/wsl/c, this causes /mnt/wsl/c to show up in /proc/self/mounts when alpine's init starts, and so it skips mounting /mnt/c.

I've made a code change to only skip a mount if the both source drive AND the mount point are the same, which should solve your scenario.

@OneBlue OneBlue self-assigned this Jan 22, 2021
@simonferquel
Copy link
Author

@OneBlue thanks a lot !
Any chance it gets backported to previous versions of Windows ?

@OneBlue
Copy link
Collaborator

OneBlue commented Apr 6, 2021

@simonferquel: Unfortunately no, we won't be able to backport the fix for this.

The fix has made it to insider so closing this.

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

4 participants