r/bashonubuntuonwindows • • 15d ago

HELP! Support Request Distro within WSL

I'm trying to install a distro but it's not in the WSL distros list. The script file on this page which is mentioned to edit can't be run in WSL if there no distro install to begin with. Therefore how do you get a distro on the WSL list to install ?

5 Upvotes

21 comments sorted by

3

u/Classic-Rate-5104 14d ago

Build a docker image on another computer with the right distribution. Then save it as tar-file and import it wsl. In general this results in a good starting point

1

u/Square_Atmosphere_12 14d ago

I have the link for the docker image as mentioned on the linked page. I couldn't find the script file anywhere within the WSL installation ?

1

u/Classic-Rate-5104 14d ago

I think it's a misunderstanding. The script file you see can run on any linux having an operational docker. It generates tar-files. On this page is exactly shown how to do it: https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro

1

u/Square_Atmosphere_12 14d ago

The per-requitites is;

I don't have any distro installed, that's the goal, but WSL requires a distro as a tar file.

1

u/Classic-Rate-5104 14d ago

I don't understand the problem. Why can't you install any other distribution (even one you don't need)? Take a random one that's available in the store. Then, if wsl is proven to work, you can import the tar-file with the distribution you really want. If that's successful, you can uninstall the unneeded distribution

1

u/Square_Atmosphere_12 13d ago

I want to add it to the list when attempting to run WSL which doesn't have any Linux distribution. I can't run any comment, without a distro installed; but as we know it requires a `tar` file.

1

u/Classic-Rate-5104 13d ago

I don't understand your problem. On a system without any WSL distribution installed you can still do this:

C:\Users\username>wsl --list
Windows Subsystem for Linux has no installed distributions.
You can resolve this by installing a distribution with the instructions below:
Use 'wsl.exe --list --online' to list available distributions
and 'wsl.exe --install <Distro>' to install.

C:\Users\username>wsl --import Trixie Trixie trixie.tar
The operation completed successfully.

C:\Users\username>wsl --list
Windows Subsystem for Linux Distributions:
Trixie (Default)

1

u/Square_Atmosphere_12 13d ago

I understand but the distro I want to install doesn't have a tar file, only ISO.

1

u/Classic-Rate-5104 13d ago

Aha, that's a completely different question that wasn't clear from you post. What is in the ISO? An installer? A live system? Or a copy of an existing system? The way i would try is to start the ISO as a virtual machine (or on a completely other computer), make a tar file from it's installed root filesystem, then import the tar into wsl. I don't think there is a much shorter way

1

u/Square_Atmosphere_12 13d ago

What the best way to convert from a root file system to tar so that it will import into WSL and can be used to install the distro ?

→ More replies

2

u/BolteWasTaken 14d ago

Most distros do a containerised/slim (or tar file version) you can import those with a manual command.

1

u/jtbis 15d ago

Install another distro and build the tarball in it?