WSL: Make it more obvious that Windows programs shouldn't touch WSL partition

This is mostly a request for better docs. I understand why this behavior happened, but it could have been prevented if I had known this to be true.

I’ve been using BashOnWindows as a primary development environment for a while now. I’ve also been trying to migrate from vim to VS: Code. So today, I thought “hey, I should work with Code instead of vim.” That’s all good, but when I opened up my projects, which live on my BashOnWindows partition, I got an error with git. After looking into things, it looked like my partition was now full, which seemed very strange since it was working a few minutes before.

After talking with some people about my issues, they said “oh yeah, you can’t have a windows program touch your BashOnWindows partition or it hoses it.”

I’m not upset that this happened (though it is going to pretty much kill the rest of my workday to get my environment set up again), but it is unfortunate that I didn’t know this was something I wasn’t supposed to do. I re-read the documentation for BashOnWindows to make sure I didn’t miss anything, but I didn’t find anything.

Was this something I should have been aware of? If so, how was I supposed to be made aware of it?

Thanks so much for BashOnWindows; other than this, it’s been working very well for me, and I have been evangelizing it to my friends for a while now. 😄

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

I’ve found symlinking can be a very useful way to work around this issue. While it won’t help modify WSL system files, it does help things behave. Here’s a simple example from my stack: -Working sites I’m developing are in c:\Sites -Symlink working directory to home, ~/Sites (aka /users/{me}/Sites) -Caveat: Apache doesn’t seem to like using a symlink, so virtual hosts must point to /mnt/c/Sites/{project} -??? -Profit

So I can edit all day in VS Code, version control with git at ~/Sites/{project}, and it works wonderfully. I run node, Grunt, the works, with no issues using the symlinked path. However, as I pointed out above, the only quirk I’ve found is that Apache wants the “real” path in vhosts, but that’s something I have no problem living with as everything else works smoothly.

To the extent anyone wants to even entertain this apparently touchy subject, it would be nice if the WSL kernel did something other than halt and catch fire here. Yes, the extended attributes got blown away by win32, but that doesn’t have to be fatal. If the attributes aren’t there, branch and set (or treat) the attributes to (as) 0400 and user/group 0:0. At least then the recovery process becomes: “log into bash and fix it with chmod and chown”, rather than “delete everything and start over”. You can make a straw man argument about named pipes or unix sockets, but frankly that isn’t the bug here.

First rule of programming: Don’t delete people’s data. I understand that a grand fix is in the plan, but in the meantime, at least being graceful in the face of failure would be a good place to start.