After the most recent update Win10 update (1803) IIS started reporting error "404 Not Found" for folders created in WSL Bash (Windows Subsystem for Linux).

Folder security settings (in Windows Explorer) look fine. I've even tried doing a "Replace all child object permissions" on the folder, but it didn't help.

The folder is stored on the Windows partition and is accessed in WLS as /mnt/c/inetpub/wwwroot/.

IIS App pool is running under AppPoolIdentity (changing it to my user didn't help).

Does anyone know what's going on? How can this be fixed?

P.S. I'm using a bash script to build my website.

Edit

After turning on the "Directory browsing" I've discovered that IIS does list the files contained within the directory. This means that it can access it. However for some reason it can't serve them (the files).

This problem was caused by a changed introduced in Win build 17110, which made all new directories created in Bash to be case-sensitive (NTFS case-sensitive flag is set to enabled).

If the flag is set for a directory can be checked via CMD:

fsutil file queryCaseSensitiveInfo C:\interpub\wwwroot\xyz

For some reason IIS 10.0 has problems accessing a directory if this flag set to enabled.

The problem can be fixed by configuring WSL not to set this flag to enabled by default. This can be done by editing the /etc/wsl.conf and adding case=false to the options list:

[automount]
options="case=off"
  • You da man. I wasted half a day trying to figure this out. – Suman Lama May 24 at 23:42
  • Brilliant, thank you, this has been driving me nuts – nickspoon Jun 12 at 5:23

This problem was caused by a changed introduced in Win build 17110, which made all new directories created in Bash to be case-sensitive (NTFS case-sensitive flag is set to enabled). — knee-cola

Make shure, that case sensitivity is disabled:

In cmd.exe or PowerShell:

fsutil.exe file queryCaseSensitiveInfo .
fsutil.exe file setCaseSensitiveInfo . disable

In bash.exe:

cd /
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o rw,noatime,uid=1000,gid=1000,umask=22,fmask=11,metadata,case=off

Note: Not need to link directories like this: ln -s SomeDir somedir

/ets/wsl.conf:

[automount]
enabled = true
options = "case=off,metadata,umask=22,fmask=11"
mountFsTab = false

Links:

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.