Share folder between Windows and WSL

Viewed 22248

I am using XMing to run Emacs from WSL, which is working quite well. My issue is when trying to share folders between Windows and WSL. I have tried the following:

  • Project located in the Windows file system, accessed via /mnt/ in WSL
  • Symlink (created in WSL bash) of project located in the Windows file system
  • Copy the project to the WSL file system

Out of the 3 listed options, only the last works with projectile (and likely other Emacs packages). But I need to be able to access/modify the files from Windows as well, so that is not a viable option.

Has anyone found a good solution for this?

2 Answers

I do it so (also to sync between Windows_laptop & Ubuntu_pc):

I have folder "workspace" and symlinks to it: windows symlink under win and linux symlink under linux.

%USERPROFILE%\Cloud\workspace

for Win usage: made windows symlink: %USERPROFILE%\workspace -> %USERPROFILE%\Cloud\workspace

for Ubuntu usage (WSL): made linux symlink: ~/workspace -> /mnt/C/Users/USER/Cloud/workspace

May this help?

One of the advantages of WSL (windows subsystem for Linux) is that you can share files easily with your windows. I have used the below codes with WSL Ubuntu (but this should work with other versions of Linux as well). Using /mnt will do all the magic.

Syntax:- cd /mnt/drive/Folder/Subfolder

Sample code:- cd /mnt/c/Users/Saswat

Related