Skip to content

A script that creates importable tar files for Windows Subsystem for Linux (WSL2). These files can be used to install any Linux distribution of your choice, provided it is available on Docker.

License

Notifications You must be signed in to change notification settings

mvaisakh/wsl-distro-tars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WSL Distro Tars (WDT)

Distro tar generator

A simple script that generates importable tar files for Windows Subsystem for Linux (WSL2). This allows users to install any desired distro on their WSL2 machine. Alpine Linux ArchLinux

How is it different from distros available on the Microsoft Store?

Distros that are available on the Microsoft Store are really quite limited and filled with unwanted prebuilts that one might not want. This repository probably has your favourite distribution tarball available.

What does it do?

This script generates WSL2 importable minimal tarballs that are extracted from docker containers. At the moment only a few distributions are exported. These include:

  • Adélie Linux
  • AlmaLinux OS
  • Alpine Linux (Latest and Edge)
  • Amazon Linux (Latest and 2)
  • Arch Linux (Stable and base-devel)
  • Clear Linux
  • Debian (Stable and Unstable with slim variants)
  • Fedora (Stable and Rawhide)
  • Gentoo (Latest stage3 tarballs)
  • Kali Linux (Rolling release)
  • openSUSE Tumbleweed
  • Rocky Linux 9
  • Ubuntu (Stable and Bleeding edge [devel])

Grab the latest tarballs of your favourite distro from the Releases Page!

How do I import tarballs?

Make sure you have WSL2 setup properly and it is set to default. To import any tarball:

wsl --import distroName path\to\create\vhd path\to\downloaded\tarball

Replace distroName with any name that you desire to call it, replace path\to\create\vhd with the absolute path where you want to create the virtual hard disk of the distro and replace path\to\downloaded\tarball with the absolute path to the downloaded tarball.

then to run your distro

wsl -d distroName

Example: Here my distroName is alpine, virutal hard disk path is D:\wslStorage and tarball is in C:\Users\admin\Downloads\alpine-26122022.tar

wsl --import alpine D:\wslStorage\ C:\Users\admin\Downloads\alpine-26122022.tar

to run

wsl -d alpine

My favourite distro isn't available, what do I do?

It's simple! The prerequisites for generating tarballs are docker and awk. Edit the wsl-tar-gen.sh (but make sure your distro exists in DockerHub, since the script extracts everything from docker) and run the script using:

bash wsl-tar-gen.sh

Contributing

If you want to your favourite distro updated in my repository, fork and clone the repository. Edit wsl-tar-gen.sh and edit the macro DISTROS and add your favourite distro name there. But again make sure that your distro exists in DockerHub!

You can refer to this example commit (make sure you follow the commit message style) and create a pull request to this repository

About

A script that creates importable tar files for Windows Subsystem for Linux (WSL2). These files can be used to install any Linux distribution of your choice, provided it is available on Docker.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages