-
Notifications
You must be signed in to change notification settings - Fork 856
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
Persist /mnt/wsl mountpoints #5851
Comments
Is there a workaround for this? I need to be able to persist a folder in |
Maybe you have an idea for a workaround, @therealkenc ? |
Use |
This introduces a minor ordering issue, as all the mounts need to be up before any distribution starts (the k8s |
Maybe an option here would be to follow some Maybe, when a distro is first setup, it has it's own dedicated Another option, what if we have a second user in Another issue here is where do we create said data/home partition? Seems to be we would have to deal with that inside wsl. So maybe like using docker we can create a persistent drive with the |
This is a use-case for #689, per #5177 (comment): A way/place to store data inside WSL but outside any particular distro's storage, so that it can be shared with all distros without needing to start a particular distro first. Then you would just need what was originally described in this ticket: When a distro starts, before you access $HOME, you replace with with a symlink/bind-mount to wherever that block device is mounted. (Which could be |
if you just want to share small files such as .bashrc and other config files just store them on /mnt/c/. All my custom scripts reside in NTFS and are accessible by all distros and git bash and PowerShell simply because I added the bin folder to the windows env path. I have found no performance impact at all, my distros still start and run my scripts instantly. PS: another trick I do is make all distros use git credential helper from windows and windows composer.phar so they never need to ask for git authentication once windows has triggered a browser sign in. |
@giggio Did you ever find a solution to this? I can't believe I'm asking about this years later haha |
It's been a while since I requested this, and since I haven't tried it again. I don't know if any of the new features would enable it, but AFAIK this is still not possible. |
Is your feature request related to a problem? Please describe.
In WSL2, I'd like to be able to share my home directory between distros. So when Ubuntu (my main distro) comes up, it adds a symlink from
/mnt/wsl/homeuser/
to/home/user
, and when OpenSuse comes up, it also mounts from/mnt/wsl/homeuser/
to/home/user
.Describe the solution you'd like
I understand
/mnt/wsl
enables the sharing between distros but unfortunately/mnt/wsl
uses tmpfs, so when wsl shutsdown you lose everything that was there.Describe alternatives you've considered
I could host the files on my main distro (Ubuntu) and share from Ubuntu to
/mnt/wsl/homeuser/
, and when OpenSuse comes up, it does the opposite. Unfortunately, for that to occur, Ubuntu must come up first, and must stay up, consuming memory and cpu cycles.Additional context
Initial request started at #5177. Also related to #689 and to a possible
wsl --mount
described in MicrosoftDocs/WSL#824.The text was updated successfully, but these errors were encountered: