WSL: mkfifo: cannot create fifo 'testfifo': Operation not permitted - dotnet 2.1.300 SDK CLI issues

ver
Microsoft Windows [Version 10.0.17134.48]

uname -a
Linux testmachine 4.4.0-17134-Microsoft # 48-Microsoft Fri Apr 27 18:06:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial
sudo apt-get install dotnet-sdk-2.1.300-preview1-008174
dotnet --version
Failed to initialize CoreCLR, HRESULT: 0x80004005

If we run dotnet with sudo it writes to the local filesystem at /tmp and no issues.

sudo dotnet --version
2.1.300-rc1-008673
cd /mnt/c/Users/jrillema/AppData/Local/Temp

mkfifo testfifo
mkfifo: cannot create fifo 'testfifo': Operation not permitted

cd /tmp
mkfifo testfifo
ls -ltr testfifo
prw-rw-rw- 1 jrillema jrillema 0 May 15 00:33 testfifo

Problem creating a pipe on /mnt/c/users/jrillema/appdata/local/temp folder.

Problem originally reported over dotnet/core-setup

4586 21457 unlink("/mnt/c/Users/jrillema/AppData/Local/Temp/clr-debug-pipe-21457-299289-in") = -1 ENOENT (No such file or directory)
4587 21457 mknod("/mnt/c/Users/jrillema/AppData/Local/Temp/clr-debug-pipe-21457-299289-in", S_IFIFO|0700) = -1 EPERM (Operation not permitted) 
4588 21457 futex(0x7f2340125680, FUTEX_WAKE_PRIVATE, 2147483647) = 0
4589 21457 write(2, "Failed to initialize CoreCLR, HR"..., 49) = 49

Workaround found here

export COMPlus_EnableDiagnostics=0

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@therealkenc @danmosemsft

That metadata blog post did specify special files like pipes would be supported. So I went back through to see how I was mounting my /mnt/c drive and sure enough I did not opt in to the new metadata drvfs approach. I created a /etc/wsl.conf with the following:

[automount]
enabled = true
options = "metadata,uid=1000,gid=1000,umask=22,fmask=111"
mountFsTab = true

Note I have mountFsTab set so I can access my SD card. So after enabling this metadata and keeping my original TMPDIR set I was able to get pass the critical error from the .NET SDK. See my results below

dotnet --version
2.1.300-rc1-008673

mount -l | grep "C:"
C: on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000,umask=22,fmask=111,metadata)

echo $TMPDIR
/mnt/c/Users/jrillema/AppData/Local/Temp

cd $TMPDIR
pwd
/mnt/c/Users/jrillema/AppData/Local/Temp

mkfifo testfifo
ls -tlr testfifo
prw-rw-rw- 1 jrillema jrillema 0 May 16 00:37 testfifo

So I was able to get this working with opting into the new drvfs metadata options. Here is the link and search for special files The whole reason I went down this path was to accomodate running a Beyond Compare diff session from inside WSL.

I appreciate everybody’s help on this one. I will play around a bit more with testing this the next few days to make sure it is working. I would suspect we might be able to close this out here if it works. I am not sure how new WSL installations are handled with the new metadata by default but I am working with an older WSL installation.