microsoft / microsoft/WSL

WSL --unregister should not delete if system was imported in-place

Open
#12,427 4 comments 7 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**
If a user uses --import-in-place, then the usage itself would be indicative of the user managing the lifetime of the root filesystem outside of WSL built-in management semantics; as such, WSL should not delete the root filesystem when doing "--unregister"

**Describe the solution you'd like**
One of two options:
A) Unregister should not delete user data when image was created with "import-in-place"
B) Unregister should never delete user data. There should be an --unregister and --delete command. Similar to this https://github.com/microsoft/WSL/issues/9932 - but I think we should just have two options [--unregister] and [--delete]

**Describe alternatives you've considered**
The workaround is somewhat simple to just --terminate + copy the image somewhere else, then do unregister, but it's ugly.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the --import-in-place and --unregister command paths in WSL and reviewing how unregister currently handles the root filesystem. Compare the proposed preservation and separate deletion behaviors, then verify that imported-in-place user data remains available after unregister and that any explicit deletion behavior is unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.