6

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).

Ofer Zelig
  • 103
  • 4
knee-cola
  • 221
  • 1
  • 6
  • Report the bug to Microsoft http://www.techulator.com/resources/13419-How-to-report-Windows-10-bugs-to-Microsoft.aspx – Lex Li May 18 '18 at 01:17

2 Answers2

5

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"
knee-cola
  • 221
  • 1
  • 6
1

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:

iegik
  • 111
  • 3