I found that static files served from a Rails application running in /home/pupeno/projectx
take more or less half as much time than the ones served from /mnt/c/Users/pupeno/projectx
. It's almost acceptable. I tried webrick and puma (as well as passenger and unicorn, which don't work yet).
So, if I'm going to host my source code in /home/pupeno
, how do I access from Windows applications such as RubyMine?
For the record, this is the application being served from the Windows file system:
and this is the Linux file system:
One of the benefits of WSL is being able to access your files via both Windows and Linux apps or tools. Using your mounted drives, you can edit code in, for example, C:\dev\myproj\ using Visual Studio / or VS Code, and build/test that code in Linux by accessing the same files via /mnt/c/dev/myproj .
Whenever you are in a directory in WSL that you would like to access from File Explorer, simply type: $ explorer.exe . $ explorer.exe .
Access Linux Files from Windows You can access WSL2 Linux files from the network path \\wsl$\ . Enter it in the File Explorer address bar or any file open dialog. Here, <yourname> is the username you defined during installation. It's best to set this as the starting folder for the distro in Windows Terminal.
Press Win + E keys to open the File Explorer, and then map your Linux home folder or directory on Windows. Click on Tools at the top menu and select Map network drive. Select the drive letter from the drop-down menu and click on Browse to select the folder that you want to mount.
PM for Windows Command-Line here:
Thus far, accessing Linux files from Windows has been unsupported. To understand why, please read this post: https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
However, as of Windows 10 build 1903 (March 2019), we (finally!) exposed your distros' filesystems to Windows!
To learn more, please read this post: https://blogs.msdn.microsoft.com/commandline/2019/02/15/whats-new-for-wsl-in-windows-10-version-1903/
Look forward to hearing how you get on with this feature. If you find any problems, please file issues on the WSL GitHub repo here: https://github.com/microsoft/wsl.
WSL mounts Windows partitions under /mnt
. For example, you can modify files in c:\work
on the mounted Windows filesystem by referencing them as /mnt/c/work
.
Windows apps (cmd, file manager, etc), can access files in WSL in read-only mode by prepending with %LocalAppData%\lxss
. Copying a file from the Windows filesystem to the WSL directories renders it unreadable, with a cryptic general I/O error
. Files created in %LocalAppData%\lxss
from Windows are not visible to WSL. Files created from WSL can be modified in Windows, and the modified file can subsequently be accessed by WSL.
On Windows 10 Creators Update, I use SFTP NetDrive to mount the WSL filesystem into windows as as a network drive.
There are some Window sshFS ports that'll achieve the same thing.
You'll need to start the ssh daemon via sudo service ssh start
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With