Skip to content

Windows apps writing to \\wsl.localhost create files owned by root (UID 0) instead of WSL default user #40941

Description

@AntoineRoue

Windows Version

Microsoft Windows [version 10.0.26200.8457]
(fresh install)

WSL Version

2.7.8.0
(fresh install)

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 6.18.33.1-microsoft-standard-WSL2

Distro Version

Ubuntu-26.04

Other Software

  • Windows Explorer
  • Web browsers (Chrome / Edge / Firefox downloads)

Repro Steps

  1. Open Windows Explorer
  2. Navigate to: \\wsl.localhost\Ubuntu-26.04\home\<user>\
  3. Create a new file (Right-click → New → Text Document)
    or save a file from a browser (Chrome/Edge/Firefox) directly into this path
  4. In WSL, inspect the file:
ls -ln filename

Expected Behavior

Files created from Windows via \\wsl.localhost should be owned by the WSL default user:

-rw-r--r-- 1 <user> <user> ...

(or corresponding UID/GID of default WSL user)

Actual Behavior

Files created from Windows are owned by root:

-rw-r--r-- 1 0 0 0 Jun 26 14:50 test.txt

UID/GID = 0:0

Additional observations

  • WSL distro starts normally as non-root user
  • Files created inside WSL (e.g. touch file) are correctly owned by non-root user

Workaround

Files copied or created from within WSL have correct ownership:

mv /mnt/c/Users/<user>/Downloads/file ~/Downloads/

Notes

I just reinstalled Windows and WSL and this behavior is new for me, I didn't do that before. This appears to be a regression in the Windows → WSL filesystem integration layer (\\wsl$ / \\wsl.localhost provider), incorrectly assigning UID 0 instead of mapping to the WSL default user.

Diagnostic Logs

I'm sorry I can't provide logs:

.\collect-wsl-logs.ps1
.\collect-wsl-logs.ps1 : Impossible de charger le fichier C:\Users<user>\collect-wsl-logs.ps1, car l’exécution
de scripts est désactivée sur ce système. Pour plus d’informations, consultez about_Execution_Policies à l’adresse
https://go.microsoft.com/fwlink/?LinkID=135170.
Au caractère Ligne:1 : 1

  • .\collect-wsl-logs.ps1
  •   + CategoryInfo          : Erreur de sécurité : (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess
    
    

If someone is kind enough to reproduce the bug and post their logs it would be great. You'd need either a fresh Windows install, or a fresh WSL install, or a fresh Ubuntu 26.04 install, or all of the above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions