WSL should store the downloaded image locally
Nobody has claimed this yet.
- 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.**
Not really a problem but it is a QoL update. WSL shouldn't download the same image every time you want to install an image.
**Describe the solution you'd like**
Download an image once and use it every time a user wants to register a new instance. For example, Distrobox checks if an image is downloaded locally before setting up the new instance, if it's available, use the local image and if not, download it from a remote server.
**Describe alternatives you've considered**
Currently, the only workaround is;
1. Download and install a WSL image normally.
2. Boot your installation.
3. Export your WSL image to a `.tar` (e.g. `wsl --export ubuntu ubuntu.tar`)
4. Use the Ubuntu installation normally.
5. Now, whenever you want a new Ubuntu instance, you can just use `ubuntu.tar` (e.g. `wsl --import ubuntu-work ubuntu.tar`)
**Additional context**
I'm not sure if this is already a feature but I don't see it happening for my use case:
```
PS C:\Users\User> wsl --terminate ubuntu
The operation completed successfully.
PS C:\Users\User> wsl --unregister ubuntu
Unregistering.
The operation completed successfully.
PS C:\Users\User> wsl --install -d ubuntu
Downloading: Ubuntu
Installing: Ubuntu
Distribution successfully installed. It can be launched via 'wsl.exe -d Ubuntu'
Launching Ubuntu...
... (truncated)
```
As you can see, it's downloading the image (based on the prompt). I haven't tested it without an internet connection nor without unregistering the image.
(PS: I'm sorry for my bad English.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the `wsl --install -d ubuntu` flow after unregistering an installation, and compare it with the documented `wsl --export` and `wsl --import` workaround. Research the existing WSL installation entry point and determine how a locally retained image should be selected, with completion demonstrated by installing another instance without downloading the image again.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100