「マイクロソフト系技術情報 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
ファイルシステム、環境変数、プログラム実行辺りの話。
$ echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop
$ echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop
WSL環境にWindowsのボリュームをマウントし、
LinuxからWindowsのファイルにアクセスできるようにする仕組み。
※ kledgeb
wsl がアクセスできる Windows 環境変数はPATHのみ。
WSLENVはブリッジのための特殊な環境変数。
C:\>set WSLENV=USERPROFILE:USERNAME C:\>wsl seigi@nishino:/mnt/c/Users/nishi$ echo $WSLENV USERPROFILE:USERNAME
wsl.exeを使用してCMD または PowerShellから Linux バイナリを実行
wsl.exe <command>
c:\> wsl ls -la | findstr "root"
c:\>dir | wsl grep root
$ notepad.exe
$ ls -la | findstr.exe "root" drwxr-xr-x 1 root root 512 May 8 2018 .. drwxrwxrwx 1 seigi seigi 512 May 8 2018 wwwroot
$ ipconfig.exe | grep IPv4 IPv4 Address. . . . . . . . . . . : 10.0.75.1 IPv4 Address. . . . . . . . . . . : 192.168.179.2 IPv4 Address. . . . . . . . . . . : 172.17.68.193
その26 -(前編)LinuxのファイルシステムとWindowsのファイルシステム
https://kledgeb.blogspot.jp/2016/06/wsl-26-wsllinuxwindows.html
その27 -(後編)WSLのファイルシステム
https://kledgeb.blogspot.jp/2016/06/wsl-27-wslwsl.html
Tags: :Windows, :Linux, :Linuxサブシステム, :仮想化