microsoft / microsoft/WSL

Add an option to specify a tarball subdirectory when using wsl --import

Open
#9,187 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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.**
Many Linux distributions provide bootstrap tarballs alongside full installation media.
One popular example of these is Arch Linux.

The bootstrap media provided by upstream Arch Linux is *close* to what `wsl --import` can use for input, the only difference being that the root filesystem in the bootstrap tarball is located in the `root.x86_64` directory.

bootstrap tarballs can be obtained by clicking one of the mirrors [here](https://archlinux.org/download/)

**Describe the solution you'd like**
It would be handy to have an option that lets you tell `wsl --import` where in the tar the root file system is located.
If we assume the new option is called `--prefix`, one could run `wsl --import --prefix root.x86_64` to get a running Arch Linux instance from original upstream media.

**Describe alternatives you've considered**
The current way to instal a distro like Arch Linux in the WSL is to use a separate Linux instance to re-create the tarball as such that the root filesystem is in the root of the tar archive.

This means that to do this on Windows you will need to install some other Linux distribution just to run the correct `tar` command. This must be done using Linux so permissions are preserved correctly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the wsl --import command entry point and its existing tarball import handling; the issue names no source files or tests. Trace how the archive root is selected, then identify or add coverage for importing a bootstrap archive whose filesystem is under root.x86_64 and for the proposed subdirectory option.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.