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

WSL should at least very verbosely warn that distro unregister will destroy /home #8466

Open
blami opened this issue Jun 1, 2022 · 2 comments
Labels

Comments

@blami
Copy link

blami commented Jun 1, 2022

Is your feature request related to a problem? Please describe.
Currently if you wsl.exe --unregister a distro on WSL2 (did not test behavior on WSL1) all files on .vhd with its root filesystem will be gone too. As people usually keep their e.g. source code, configs, notes, etc. inside the .vhd because of native ages unresolved host filesystem slowness it would be great if wsl.exe gave more verbose warning about that than blurry Unregisters the distribution and deletes the root filesystem description (had to explain to someone who lost all their work that root filesystem is literally / and /home was on it).

C:\> wsl.exe --help
...
    --unregister <Distro>
        Unregisters the distribution and deletes the root filesystem.
...
C:\> wsl.exe --unregister Ubuntu
C:\> Unregistering...
C:\>

Describe the solution you'd like
I'd at least want to get verbose prompt (skippable with --force)

C:\> wsl.exe --help
...
    --unregister <Distro>
        Unregisters the distribution and irreversibly deletes all files on its filesystem.
...
C:\> wsl.exe --unregister Ubuntu
This will irreversibly remove Ubuntu and all its files, are you sure (Y/N): ...

Ideally, there should be an additional options for wsl.exe to:

  • unregister but keep root filesystem .vhd (such option should be mentioned in that verbose warning, .vhd should be mountable from e.g. other distro)
  • maybe during installation allow mounting separate .vhd for /home that would be always retained by default and only deleted if said so?

Describe alternatives you've considered

  • using /mnt/c/Users/user as persistent home for all distros (with benefit of being able to share configs across distributions AND Windows, unfortunately impossible because of WSL2 slowness accessing native filesystem and problems with symlinks on Windows side).

Additional context
As WSL2 grows more and more popular, UX should be smooth and without unexpected surprises. Nowadays not everyone who uses Linux knows what root filesystem is and what consequences has deleting one.

@blami blami added the feature label Jun 1, 2022
@Robula
Copy link

Robula commented Aug 12, 2022

Just having the ability to keep /home as a separate VHD would be greatly beneficial. Whilst we can already do this this wsl --mount --vhd it is not possible to have the VHD automatically mount when WSL starts. See #8070

@tusharsnx
Copy link

tusharsnx commented Nov 19, 2022

somewhat similar but if I --unregister a distro installed with --import-in-place, wsl deletes the vdhx while unregistering the distro. Instead, I'd expect it to leave vdhx as it is.

--unregister need to have a confirmation before it does its thing.

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

No branches or pull requests

3 participants