You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Manipulate Linux/Ubuntu subsystem files from via the Windows environment #1524
A brief description:
When I try to create a file from Windows10 (using Sublime Text, etc) into the Linux Ubuntu subsystem
the file is created, but afterwards the file can't be seen from within the subsystem.
I bypass this by creating (and cutting/pasting) the file via the NANO cmd.
Expected results
It would be nice (like in Apple's OSX terminal environment) to manipulate files from outside the Linux subsystem.
In my opinion (as a developer) this would mean a big step forward in the usability of the Ubuntu subsystem.
*My Windows build number: W10 Build 1607 14393.576.
Reacted by Miloš Stanić, Adnan Ullah, Mark Allasread, Bradley Walters, Piotr Staroszczyk, Panayotis, Martijn van de Rijdt, Marco Schmidlin, Sebastian Graf, Jordan W and 25 more
Thanks BJobsis for reporting this! For what it's worth, I think this is the same basic issue as #1239 , though the way you have phrased it is more general.
Ben Hillis (@benhillis) -- this UserVoice appears to indicate that this issue is WONTFIX. Could you (or could someone else at Microsoft) make sure this ticket and that UserVoice are flagged the same way?
Adam Seering (@aseering) It looks like their thinking has moved from "wontfix" to "might eventually fix in RS3 or RS4", based on some hints I've seen dropped.
Adam Seering (@aseering) - I'm not sure why this was ever marked as won't fix. This is a huge limitation of the current design and definitely something we're looking at improving. I'll get that user voice status changed. Thanks for the heads up.
Reacted by therealkenc, fpqc, Herst, Charles DuBose, Michael Wallace Louwrens, Yvan da Silva, Panayotis, Roy Ivy III, Pushpal Sidhu, Tara Harris and 9 more
But if one shrinks the problem space to /home, ie "development related scenarios", the permissions problem solves itself. Just ask anybody who's worked with OneDrive. 😃
Longer term, there is no reason why users or permissions need to be mapped in the first place (but I digress).
do what I do, create a symlink to your documents folder and just work on stuff like that. If you are really brave, you could try symlinking your windows user directory to your home directory. I haven't tried that though, so it might break things.
Here, fixed that for you. This also represents the third way I alluded to a month ago in #1397 (comment). Options available to have VSCode open a file on a WSL path:
VSCode would have to have built in logic to understand WSL file paths.
Orrrr... Use a Window Filesystem that has built in logic that understands WSL file paths.
I give you, nfs-ganesha on WSL and nfs-fuse in Windows via dokan-dev. That's VSCode editing .bashrc, launched from WSL home directory on L: drive (natch) in Windows Explorer. Code to follow when it sucks less.
Reacted by fpqc, Adnan Ullah, Yvan da Silva, Sandria Agung Saputra, George Hahn, Ali Lahijani and Yun Zhi Lin
therealkenc Lol, was waiting for someone to do this. I figured you could do it horribly by setting up a local Samba share and mounting it on a Windows network mount, but then I considered what a hassle it would be. I'm guessing you've essentially streamlined this using dokan?
Samba is problematic because Windows is a CIFS server and those ports are spoken for. This is NFS not CIFS. There is a NFS client available for Windows, but Microsoft considers the technology all Enterprisey 'n stuff (as opposed to the thing your teenager uses to share XBMC videos throughout the house).
I considered a fusesmb port to dokan, with which you could choose a nonstandard port, but that was just a bridge too silly to contemplate seriously. That is thread #764 (message). In fact if I knew how to redirect the CIFS ports on Windows this hack probably wouldn't have happened.
At this point this is the most important feature for me as a web developer. All I want is to edit my code from windows, everything else should happen within WSL. Having the code on the Windows filesystem works 99% of the time but there is that one percent where the application thinks it's running on Linux and does all the crazy things the Windows filesystem doesn't handle properly (permissions, directory separators etc.). This reminds me of working with Docker for Windows which had the same issues because the code was residing on Windows and I ultimately had to abandon that solution. The only way all the code I use runs seamlessly is when it not only runs in Linux but also is on such a filesystem.
Just a small example of some code from the core of a PHP CMS I have to work with:
// Replace \ with _ if on Windowsif (DIRECTORY_SEPARATOR == '\\')
{
$key = str_replace('\\', '_', $key);
}
You can imagine that this doesn't behave as intended on WSL because the Windows check will fail and the resulting cache key, which is used as the file name, keeps the backslashes in it and will create a number of directories instead of a file.
I still don't understand the desire to directly edit the files on the WSL filesystem. WSL provides a share (/mnt/c or similar) that allows you to perform the same thing, safely and without issue (I've never encountered one at least).
However, performance of the WSL filesystem in general is still very slow, I still use a CentOS VM on VMWare and use shared folders. It is exponentially faster and more stable to do stuff that way.
Hopefully the WSL team focuses on speeding things up in the future.
Richard Campbell (@pharmmd-rich) For me, it's mostly a speed issue. DriveFS is significantly slower than VolFS. If I was going straight Vim, I'd be able to manage, but if I want to run an integrated environment (Atom/VisualStudio Code, Docker services, linux server), I've gotta be on DriveFS and it's at times painfully slow.
I am also in the need to edit files directly on WSL fiesystem, and I will
give you an example why is that.
I need to host my project in WSL for hundreds of reasons, some of which are
unix permissions, symbolic links, compatibility with other open source
tools, fixed directory structure etc.
Now, I need an IDE to edit my project (let's pretend that this is IntelliJ
or Netbeans).
Then I am stucκ to use the Linux version of the IDE (which again means
gigabytes of dependencies, not to mention the ugly graphics).
This is my only reason up to now that I continue developing on my Linux
box, instead of booting into my (test-only) Windows partition.
2017-12-08 20:12 GMT+02:00 Richard Campbell <[email protected]>:
I still don't understand the desire to directly edit the files on the WSL
filesystem. WSL provides a share (/mnt/c or similar) that allows you to
perform the same thing, safely and without issue (I've never encountered
one at least).
However, performance of the WSL filesystem in general is still very slow,
I still use a CentOS VM on VMWare and use shared folders. It is
exponentially faster and more stable to do stuff that way.
Hopefully the WSL team focuses on speeding things up in the future.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1524 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAkKuC6sKQ2Ncw1819JuSiHjItC6ccPPks5s-Xv4gaJpZM4LR5BU>
.
Here's a workaround: after setting obcaseinsensitive=0 in the registry and fixing any path issues install Sandboxie (any sandboxing program will do). Run the IDE / text editor sandboxed so that it does not directly save to lxss. Use rsync under Bash to update the files.
@b71729 maybe you need more detail:
I enabled case sensitivity on an almost new w10 install and luckily had no issues. Without it you can still edit linux files with non-conflicting names.
I tried to avoid third party tools but could not make VirtualStore do what was needed (tried a few things like shimming the text editor so that run as non-admin any writes to lxss folder would be virtualized).
With Sandboxie I created a custom "lxss" sandbox w/ no auto recovery, no deletion, protecting only the lxss folder. Then I defined the following aliases under bash:
alias *1='"/mnt/c/Program Files/Sandboxie/Start.exe" /box:lxss explorer.exe /root,C:\\Users\\$USER\\AppData\\Local\\lxss'
alias *2='rsync -r /mnt/c/Sandbox/$USER/lxss/user/current/AppData/Local/lxss/ /.'
alias *3='rm -rf /mnt/c/Sandbox/$USER/lxss/user/current/AppData/Local/lxss/*'
$USER represents the Windows username, no spaces. Not a predefined variable. *1 opens a sandboxed Explorer window from bash (any opened file is also sandboxed). *2 syncs changes, this should preserve original permissions, using mv would make them 777 *3 deletes lxss folder from the sandbox (to avoid stale files reverting any changes done in bash)
Hope someone finds this useful.
Tested create file in W10 1903 (via WSL explore.exe) with Sublime Text and read back in WSL with Nano. And vice versa. Both actions worked perfect.
I close this request now as I consider it as solved.
Development team thanks for your effort.
Ilya,
I never used symlinks. I understand what they do but don't see any added
value in this case.
For me: I needed a way to edit a file in WSL and use in in W10 and vica
versa.
That works now and so my problem is solved.
Regards,Barry
Activity
aseering commentedon Dec 20, 2016
Thanks BJobsis for reporting this! For what it's worth, I think this is the same basic issue as #1239 , though the way you have phrased it is more general.
If you (or anyone else reading this particular issue) has not already seen this blog post, I'd recommend reading it:
https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
The intent, in short, is that you put your files in
/mnt/c/somewhere if you want to get at them from Windows.aseering commentedon Dec 20, 2016
Ben Hillis (@benhillis) -- this UserVoice appears to indicate that this issue is WONTFIX. Could you (or could someone else at Microsoft) make sure this ticket and that UserVoice are flagged the same way?
fpqc commentedon Dec 20, 2016
Adam Seering (@aseering) It looks like their thinking has moved from "wontfix" to "might eventually fix in RS3 or RS4", based on some hints I've seen dropped.
benhillis commentedon Dec 20, 2016
Adam Seering (@aseering) - I'm not sure why this was ever marked as won't fix. This is a huge limitation of the current design and definitely something we're looking at improving. I'll get that user voice status changed. Thanks for the heads up.
fpqc commentedon Dec 20, 2016
Lol, and that's about as close to a confirmation as we've seen!
benhillis commentedon Dec 20, 2016
It's a hard problem to solve (mapping Windows permissions to Linux permissions or vise versa). Just ask anybody who's worked with Samba.
fpqc commentedon Dec 20, 2016
Ben Hillis (@benhillis) Yup, the Samba people blamed you guys for it though!! (ACL format is not stable between windows versions).
benhillis commentedon Dec 20, 2016
I'm pretty sure I wasn't born yet when those decisions were made :)
therealkenc commentedon Dec 20, 2016
But if one shrinks the problem space to
/home, ie "development related scenarios", the permissions problem solves itself. Just ask anybody who's worked with OneDrive. 😃Longer term, there is no reason why users or permissions need to be mapped in the first place (but I digress).
pharmmd-rich commentedon Dec 20, 2016
do what I do, create a symlink to your documents folder and just work on stuff like that. If you are really brave, you could try symlinking your windows user directory to your home directory. I haven't tried that though, so it might break things.
fpqc commentedon Dec 20, 2016
Will break everything. Don't do it.
therealkenc commentedon Dec 21, 2016
Here, fixed that for you. This also represents the third way I alluded to a month ago in #1397 (comment). Options available to have VSCode open a file on a WSL path:
I give you, nfs-ganesha on WSL and nfs-fuse in Windows via dokan-dev. That's VSCode editing
.bashrc, launched from WSL home directory onL:drive (natch) in Windows Explorer. Code to follow when it sucks less.fpqc commentedon Dec 21, 2016
therealkenc Lol, was waiting for someone to do this. I figured you could do it horribly by setting up a local Samba share and mounting it on a Windows network mount, but then I considered what a hassle it would be. I'm guessing you've essentially streamlined this using dokan?
Hope I'm doing it justice.
therealkenc commentedon Dec 21, 2016
Samba is problematic because Windows is a CIFS server and those ports are spoken for. This is NFS not CIFS. There is a NFS client available for Windows, but Microsoft considers the technology all Enterprisey 'n stuff (as opposed to the thing your teenager uses to share XBMC videos throughout the house).
I considered a fusesmb port to dokan, with which you could choose a nonstandard port, but that was just a bridge too silly to contemplate seriously. That is thread #764 (message). In fact if I knew how to redirect the CIFS ports on Windows this hack probably wouldn't have happened.
fpqc commentedon Dec 21, 2016
So KenC, does this automagically fix paths (so launching
code.exe ~/blahopens the file with a path relative to the nfs mount?37 remaining items
therealkenc commentedon Dec 4, 2017
Native Linux Sublime works very well in WSL if you are willing to go the VcXsrv route. But yeah for now officially vim and nano.
They have their top men on it per the User Voice.
marcelgwerder commentedon Dec 8, 2017
At this point this is the most important feature for me as a web developer. All I want is to edit my code from windows, everything else should happen within WSL. Having the code on the Windows filesystem works 99% of the time but there is that one percent where the application thinks it's running on Linux and does all the crazy things the Windows filesystem doesn't handle properly (permissions, directory separators etc.). This reminds me of working with Docker for Windows which had the same issues because the code was residing on Windows and I ultimately had to abandon that solution. The only way all the code I use runs seamlessly is when it not only runs in Linux but also is on such a filesystem.
Just a small example of some code from the core of a PHP CMS I have to work with:
You can imagine that this doesn't behave as intended on WSL because the Windows check will fail and the resulting cache key, which is used as the file name, keeps the backslashes in it and will create a number of directories instead of a file.
Definitely a huge 👍 for this!
pharmmd-rich commentedon Dec 8, 2017
I still don't understand the desire to directly edit the files on the WSL filesystem. WSL provides a share (/mnt/c or similar) that allows you to perform the same thing, safely and without issue (I've never encountered one at least).
However, performance of the WSL filesystem in general is still very slow, I still use a CentOS VM on VMWare and use shared folders. It is exponentially faster and more stable to do stuff that way.
Hopefully the WSL team focuses on speeding things up in the future.
kayakyakr commentedon Dec 8, 2017
Richard Campbell (@pharmmd-rich) For me, it's mostly a speed issue. DriveFS is significantly slower than VolFS. If I was going straight Vim, I'd be able to manage, but if I want to run an integrated environment (Atom/VisualStudio Code, Docker services, linux server), I've gotta be on DriveFS and it's at times painfully slow.
teras commentedon Dec 8, 2017
Gannalech commentedon Jan 15, 2018
Here's a workaround: after setting obcaseinsensitive=0 in the registry and fixing any path issues install Sandboxie (any sandboxing program will do). Run the IDE / text editor sandboxed so that it does not directly save to lxss. Use rsync under Bash to update the files.
leo-cydar commentedon Jul 19, 2018
Gannalech that is a terrible workaround.
Deltrego commentedon Jul 20, 2018
@b71729 maybe you need more detail:
I enabled case sensitivity on an almost new w10 install and luckily had no issues. Without it you can still edit linux files with non-conflicting names.
I tried to avoid third party tools but could not make VirtualStore do what was needed (tried a few things like shimming the text editor so that run as non-admin any writes to lxss folder would be virtualized).
With Sandboxie I created a custom "lxss" sandbox w/ no auto recovery, no deletion, protecting only the lxss folder. Then I defined the following aliases under bash:
$USER represents the Windows username, no spaces. Not a predefined variable.
*1opens a sandboxed Explorer window from bash (any opened file is also sandboxed).*2syncs changes, this should preserve original permissions, usingmvwould make them 777*3deletes lxss folder from the sandbox (to avoid stale files reverting any changes done in bash)Hope someone finds this useful.
BJobsis commentedon May 24, 2019
Ls,
Tested create file in W10 1903 (via WSL explore.exe) with Sublime Text and read back in WSL with Nano. And vice versa. Both actions worked perfect.
I close this request now as I consider it as solved.
Development team thanks for your effort.
Regards, Barry
ilqvya commentedon Oct 31, 2019
BJobsis what about symlink folders ?
therealkenc commentedon Oct 31, 2019
Shipped in 18342 aka 1903.
BJobsis commentedon Oct 31, 2019