Search notes:

/proc/sys/fs/binfmt_misc/WSLInterop

On Windows Subsystem for Linux:
$ cat /proc/sys/fs/binfmt_misc/WSLInterop
enabled
interpreter /tools/init
flags: F
offset 0
magic 4d5a
0x4d5a is MZ

Enabling/disabling WSL interoperability

WSL Interoperability can allegedly be enabled or disabled by writing a 1 or 0 to the file. However, when I tried that, I got a bash: /proc/sys/fs/binfmt_misc/WSLInterop: Permission denied error message.
$ echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop
-bash: /proc/sys/fs/binfmt_misc/WSLInterop: Permission denied
$ sudo echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop
-bash: /proc/sys/fs/binfmt_misc/WSLInterop: Permission denied

See also

According to this Superuser answer, the presence of /proc/sys/fs/binfmt_misc/WSLInterop is a pretty good indicator that the Kernel is running in Windows Subsystem for Linux.

Index