Description
Issue Description
While using Visual Studio Code v1.100.0 on Windows 11 24H2, I encountered a serious data loss issue due to the current behavior of the Remote - WSL extension.
In the Remote Explorer panel, I right-clicked my WSL2 Ubuntu distribution and chose the "Remove" option. A prompt appeared asking if I wanted to delete it — but I assumed this would only remove the item from the Remote Explorer UI or disconnect the session.
To my shock, it completely removed the entire WSL distribution, effectively performing wsl --unregister, which deleted all my files — including everything in /home/username and all installed packages. There was no mention that this would lead to permanent and irreversible data deletion.
This caused critical data loss for me, as I had important development files and personal configurations in that environment.
Steps to Reproduce
Install Remote - WSL extension.
Open the Remote Explorer in VSCode.
Right-click a WSL distribution (e.g., Ubuntu).
Click "Remove".
A basic confirmation dialog appears.
After confirming, the entire WSL instance is deleted, including all files.
Expected Behavior
The confirmation dialog should explicitly warn that this action will permanently delete the entire WSL distribution and all associated files.
Ideally, there should be an option to export/backup the WSL environment before such an operation.
Actual Behavior
After clicking “Remove” and confirming, the system executed something equivalent to wsl --unregister.
The entire Ubuntu distribution was deleted without any chance to recover.
My ext4.vhdx file and all files under /home/username were erased.
Feature Request / Improvement Suggestions
Please revise the wording of the confirmation dialog to be more explicit and alarming (e.g., “This will PERMANENTLY delete all data from this WSL distribution. Continue?”).
Consider adding an option to export/backup the WSL distribution before unregistering.
Maybe restrict such actions to a dedicated settings menu instead of placing it in a casual right-click context menu.
System Info
VSCode Version: 1.100.0
Windows Version: Windows 11 24H2
Remote - WSL Extension: Latest version (as of May 2025)
WSL Version: 2
Distribution Affected: Ubuntu
Reproduction Rate: 100% (tested on a new WSL install)
Impact
This incident caused me to lose critical project files and configurations, and I had no idea that the “Remove” action was equivalent to wsl --unregister. I strongly believe more protection and clarity is needed for destructive actions in the UI.
Thank you for your consideration. I hope this feedback can help prevent other users from suffering similar losses.
Personal note:
I am a graduate student, and my research and development work heavily depends on the WSL Ubuntu environment. This incident resulted in the complete loss of all my research code, datasets, scripts, and configuration files, severely affecting my academic progress. The current “Remove Distribution” design is dangerously misleading.
I truly did not expect that such a simple and casual UI operation in VSCode could lead to the complete deletion of an entire operating system and all of its data. I sincerely urge the VSCode team to address this issue to better protect researchers and developers who rely on WSL.