Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Best practices for data storage location/home directory #2040

Closed
SRGOM opened this issue May 1, 2017 · 6 comments
Closed

[Discussion] Best practices for data storage location/home directory #2040

SRGOM opened this issue May 1, 2017 · 6 comments

Comments

@SRGOM
Copy link
Contributor

SRGOM commented May 1, 2017

Keeping in mind that #1475 (*1) and (*2) what is the consensus on the best place for storing your projects?

*1) Windows and Linux symlinks are incompatible

*2) You are not supposed to edit files inside WSL (both system and user directory) from Windows applications.

I was leaning towards having my Linux $HOME directory same as my Windows %PROFILEDIR% in /etc/passwd, however the dotfiles in both cases would have incompatible link format. So that's out.

However, I'm thinking it would still be better if everything was stored on the "windows side" so that I can edit files from both sides, modulo the link related problems.? My primary environment for development would be WSL so I would do the filesystem manipulations on the WSL side only.

My question is what do you guys think about it? Does anybody have any cons to this approach.

@SRGOM
Copy link
Contributor Author

SRGOM commented May 1, 2017

Calling all WSL devs and non-dev experts that I know of (@fpqc, @aseering, @therealkernc). What best practices do you guys follow?

@CherryDT
Copy link

CherryDT commented May 1, 2017

I have my projects at %userprofile%\proj with a symlink from ~/proj to this directory. I also have a symlink from ~/z to my Windows user profile itself (z because I also have a virtual drive Z: set up in Windows which is a shortcut to my profile directory). Additionally, some directories or files are directly linked from WSL to their Windows equivalent (e.g. ~/.aws), and for SSH keys/config I have scripts I call to copy the data back and forth when something was changed because symlinking doesn't work due to the requirement of 600 permissions (while DrvFs will always show 777).

I develop with VSCode under Windows, but I run the projects only under WSL. I use a special script in my projects which makes sure that npm tasks are always run under WSL even if they are called through a git commit hook which is triggered by Windows Git from VSCode, for example. I have configured my git config under both Windows and WSL with core.autocrlf false to prevent line ending issues.

This setup has a few inconveniences (one of them is that npm link is incompatible, so I don't see linked packages under Windows directly, and another is that FS performance is not so fast because of DrvFs) but mostly works OK.

If I needed better support of symlinks or better FS performance, I would switch to using a WebDAV or SSH server in WSL and map my home folder (or even root) to a drive letter in Windows.

@aseering
Copy link
Contributor

aseering commented May 2, 2017

My setup is actually very similar to @CherryDT 's. I exclusively use ssh et al from within WSL so I don't need the key-management scripts.

@ajaykagrawal
Copy link

if I needed better support of symlinks or better FS performance, I would switch to using a WebDAV or SSH server in WSL and map my home folder (or even root) to a drive letter in Windows

@CherryDT how would you map your Linux FS to Windows with a SSH server running?

@CherryDT
Copy link

CherryDT commented May 2, 2017

@aseering On my end it's basically just Git inside VSCode which is using the Windows-side SSH.
@ajaykagrawal With a third party tool like SshFs.

@SRGOM
Copy link
Contributor Author

SRGOM commented May 3, 2017

Thanks. I'll keep these tips in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants