Advanced WSL launcher / installer. (Win10 FCU x64/arm64 or later.)

wsldl

Advanced WSL Distribution Launcher / Installer

screenshot

GitHub Workflow Status Github All Releases PRs Welcome License

Detailed documentation is here

💻 Requirements

  • Windows 10 1709 Fall Creators Update or later(x64/arm64).
  • Windows Subsystem for Linux feature is enabled.

📦 Install with Prebuilt Packages

You can see List on docs

Note: Exe filename is using to the instance name to register. If you rename it, you can register with a different name.

🔧 Install with any rootfs tarball

1. Download wsldl.exe

(wsldl.exe is x86_64, wsldl_arm64.exe is ARM64 build)

2. Rename it for distribution name to register.

(Ex: Rename to Arch.exe if you want to use "Arch" for the Instance name)

3. Put your install.tar(.gz) in same directory as exe (Installation directory)

4. Run exe to install. This process may take a few minutes.

🔧 Install with any ext4 vhdx disk images (WSL2 only)

1. Download wsldl.exe

(wsldl.exe is x86_64, wsldl_arm64.exe is ARM64 build)

2. Rename it for distribution name to register.

(Ex: Rename to Arch.exe if you want to use "Arch" for the Instance name)

3. Put your install.ext4.vhdx(.gz) in same directory as exe (Installation directory)

4. Run exe to install. This process may take a few minutes.

🔗 Use as a Launcher for already installed distribution

1. Download wsldl.exe

(wsldl.exe is x86_64, wsldl_arm64.exe is ARM64 build)

2. Rename it for registerd instance name.

Please check the registered instance name of the distribution with wslconfig /l command. (Ex: If the instance name is "Ubuntu-20.04", rename wsldl.exe to Ubuntu-20.04.exe)

4. Run exe to Launch instance or configuration.

For details, please see the help. ({InstanceName}.exe help)

Note: You can distribute your distribution including wsldl exe.

📝 How-to-Use(for Installed Instance)

exe Usage

Usage :
    <no args>
      - Open a new shell with your default settings.

    run <command line>
      - Run the given command line in that instance. Inherit current directory.

    runp <command line (includes windows path)>
      - Run the given command line in that instance after converting its path.

    config [setting [value]]
      - `--default-user <user>`: Set the default user of this instance to <user>.
      - `--default-uid <uid>`: Set the default user uid of this instance to <uid>.
      - `--append-path <true|false>`: Switch of Append Windows PATH to $PATH
      - `--mount-drive <true|false>`: Switch of Mount drives
      - `--wsl-version <1|2>`: Set the WSL version of this instance to <1 or 2>
      - `--default-term <default|wt|flute>`: Set default type of terminal window.

    get [setting]
      - `--default-uid`: Get the default user uid in this instance.
      - `--append-path`: Get true/false status of Append Windows PATH to $PATH.
      - `--mount-drive`: Get true/false status of Mount drives.
      - `--wsl-version`: Get the version os the WSL (1/2) of this instance.
      - `--default-term`: Get Default Terminal type of this instance launcher.
      - `--lxguid`: Get WSL GUID key for this instance.

    backup [contents]
      - `--tar`: Output backup.tar to the current directory.
      - `--tgz`: Output backup.tar.tar to the current directory.
      - `--vhdx`: Output backup.ext4.vhdx to the current directory. (WSL2 only)
      - `--vhdxgz`: Output backup.ext4.vhdx.gz to the current directory. (WSL2 only)
      - `--reg`: Output settings registry file to the current directory.

    clean
      - Uninstall that instance.

    help
      - Print this usage message.

Just Run exe

>{InstanceName}.exe
[root@PC-NAME user]#

Run with command line

>{InstanceName}.exe run uname -r
4.4.0-43-Microsoft

Run with command line with path translation

>{InstanceName}.exe runp echo C:\Windows\System32\cmd.exe
/mnt/c/Windows/System32/cmd.exe

Change Default User(id command required)

>{InstanceName}.exe config --default-user user

>{InstanceName}.exe
[user@PC-NAME dir]$

Set "Windows Terminal" as default terminal

>{InstanceName}.exe config --default-term wt

How to uninstall instance

>{InstanceName}.exe clean

How-to-backup

export to backup.tar.gz (WSL1 or 2)

>{InstanceName}.exe backup --tgz

export to backup.ext4.vhdx.gz (WSL2 only)

>{InstanceName}.exe backup --vhdxgz

How-to-import

.tar(.gz) (WSL1 or 2)

>{InstanceName}.exe install backup.tar.gz

.ext4.vhdx(.gz) (WSL2 only)

>{InstanceName}.exe install backup.ext4.vhdx.gz

🛠 How-to-Build

Please see DEVELOPERS.md

📄 License

MIT

Copyright (c) 2017-2021 yuk7

Owner
yuk7
Be together. not the same.
yuk7
Comments
  • [Feature Request] Add option to run a startup-command

    [Feature Request] Add option to run a startup-command

    Today the 'run' parameter runs a command and exits WSL immediately. It would be nice to have a similar option which runs a startup-command. This could be used for example to 'cd' directly into the current directory of the Windows CMD console.

  • ERROR:[2] Could not read registry key

    ERROR:[2] Could not read registry key

    Microsoft Windows [Version 10.0.22000.51] WSL2 Fresh install using the APPX

    I get this error on the command each time I open the window. It happens regardless of how I launch it (Windows Terminal, Powershell or the Start Menu launcher). Nothing else seems to be affected but I would like this to not happen. A fresh Ubuntu install does not get this error.

    Thanks.

  • Make the instance thumb drive portable

    Make the instance thumb drive portable

    Probably an enhancement, but i'm not sure how difficult it would be. ~It's possible this belongs over in your yuk7/wsldl project.~ 🤷‍♂ (intended to register this issue on the CentWSL project. Oops.)

    i'd like to install this instance on a thumb drive so i can take it with the rest of my dev environment. i'm aware that when the thumb drive is plugged into another system, the new machine will need to register the WSL instance.

    Right now when i attempt to install from the thumb drive, i see:

    PS W:\env\wsl\CentWSL> .\CentOS.exe
    Installing...
    ERROR:Installation Failed!
    HRESULT:0x80070057
    Press any key to continue...
    

    If i install on an internal drive and attempt to migrate it to the thumb, i start down a rabbit hole of registry changes and other things that ultimately don't work:

    The parameter is incorrect.
    

    No idea what originates it. Maybe a debug argument for the EXE could also be added? 😁

    If you decide to try this, let me know how i can contribute.

  • PhpStorm and custom WSL

    PhpStorm and custom WSL

    So i finally found a way to make phpstorm recognise imported WSL distribution (thanks to your tool).

    I am on Windows 10 PhpStorm 2020.2.3 (using toolbox)

    Steps to reproduce

    1. Follow the installation instructions BUT rename the launcher the same as one of this
    // Found in AppData\Roaming\JetBrains\PhpStorm2020.2\options\wsl.distributions.xml
    debian.exe
    kali.exe
    opensuse-42.exe
    sles-12.exe
    sles-15.exe
    openSUSE-Leap-15.exe
    ubuntu.exe
    ubuntu1604.exe
    ubuntu1804.exe
    wlinux.exe
    pengwin.exe
    wle.exe
    Arch.exe
    openSUSE-Leap-15-1.exe
    

    The reason for this is, all the paths for WSL executables are hard coded so even if you add a custom distribution in wsl.distributions.xml it will not work.

    The name of the executable is not obligatory the same as the ditribution it run ! You can install Ubuntu with a launcher named debian.exe and it will work.

    1. Move the executable in C:\Users\USER\AppData\Local\Microsoft\WindowsApps
    2. Open or reopen Phpstorm and if all is good you can use WSL as an interpreter for PHP and nodejs

    I would like people to confirm if it's working for them and maybe add it to the readme.

  • Running distro failed with

    Running distro failed with "Installation directory not found" error if executable and distro names are mismatched case-sensitive

    I have a Debian WSL distro on my old computer and move it to my new PC with the following process:

    :: On the source computer
    wsl.exe --export debain Debian-Export.tar
    
    :: On the destination computer
    wsl.exe --import debian D:\some\path Debian-Export.tar
    

    Everything is OK but the official Debian launcher app is not installed on destination. So I want to use this launcher app instead.

    Launcher's run and config commands are run successfully. But launching the distro with renamed launcher.exe failed with the following error:

    C:>debian.exe
    Installation directory not found: .
    Make sure it exists or reinstall.
    
  • Import existing ext4 disk if present next to Arch.exe

    Import existing ext4 disk if present next to Arch.exe

    IMPORTANT Please read README and Docs before creating the issue.

    Please fill out the below information: Describe the issue Two days ago I had to wipe my own Laptop because Windows started to behave weird. So as I'm using this distro on WSL2 all I did was backupping the directory where i extracted the Arch folder as contained in your zip ( which inside has the Arch.exe, the rootfs.tar.gz and the ext4 file created once installing once the distro ).

    Once I finished to wipe my Laptop and re-enabled WSL2, all i did was copying back the folder, and double clicking Arch.exe. To my surprise the ext4 file contained already was overridden like it never existed before.

    Would be nice if the ext4 file is considered and used, if present, in order to ease migrations.

    To Reproduce Steps to reproduce the behavior: 0. Set your WSL version to v2

    1. Install the Arch OS by running Arch.exe
    2. Copy the Arch folder into another Windows machine with WSL2
    3. Double click Arch.exe
    4. Proof-it

    Expected behavior Arch is added to WSL using the existing ext4 disk.

    Screenshots N/A

    Enviroment:

    • Windows build number: 10.0.19043.1110
    • Security Software: Windows Defender
    • WSL version 1/2: WSL2
    • ArchWSL version: 21.7.16.0
    • ArchWSL Installer type: zip
    • Launcher version: wsldl2, version 21071600 (amd64)

    Additional context N/A

  • [Question] How do you extract the root filesystem of a distro to use in wsldl?

    [Question] How do you extract the root filesystem of a distro to use in wsldl?

    The docs say you have to place the compressed root filesystem(rootfs.tar.gz) in the same repository as wsldl, but how do you get the rootfs.tar.gz in the first place?(I have absolutely no knowledge of what a rootfs contains, so I'm sorry if this is a stupid question.)

  • Publish into the running instance the WSL version

    Publish into the running instance the WSL version

    From the PowerShell/cmd line you can check which WSL version is each of the installed distros you have:

    wsl -l -v
    

    Unfortunatelly, windows is not publishing into the running instance which is the WSL version running, neither they indicate how to obtain that information from the running shell (question on superuser with some unofficial options).

    Could it be possible to add this version value from the Launcher retrieved previous start?

  • Add xz-support

    Add xz-support

    As several of the distros used with wsldl provide their rootfs.tar or equivalent in the significantly better compressed xz format instead of, or in addition to, the traditional gzip compression, it would be convenient if wsldl also recognized and was able to import a "rootfs.tar.xz" file without the users having to first decompress, recompress and then have wsldl decompress it again during the install-importing anyway.

    Maybe even also add support for uncompressed plain "rootfs.tar" files as well, because... it only takes checking for the file and in that case skipping the decompression, so why not?

  • Not an issue: Some improvements needed

    Not an issue: Some improvements needed

    Recently, I am following your repo and also added some idea in my repo. But I have some suggestions, may be that help this project.

    1. In newer version of Windows SDK, Microsoft has added Wslapi.h header file. So that you have not to make definition of that WSL functions. 2. Also you may skip to launch WSL.exe in your program by calling the WslLaunchInteractive function. 3. It will be easy if there is a separate header file and .c files for each of the functions.

    Also many more....

  • Terminal Integration

    Terminal Integration

    The latest ArchWSL release 20.4.3.0 supports a couple of terminals "integration". Is there a page where it explains what that does exactly or can you tell us more about it?

  • build(deps): bump github.com/schollz/progressbar/v3 from 3.11.0 to 3.12.2 in /src

    build(deps): bump github.com/schollz/progressbar/v3 from 3.11.0 to 3.12.2 in /src

    Bumps github.com/schollz/progressbar/v3 from 3.11.0 to 3.12.2.

    Release notes

    Sourced from github.com/schollz/progressbar/v3's releases.

    v3.12.2

    What's Changed

    Full Changelog: https://github.com/schollz/progressbar/compare/v3.12.1...v3.12.2

    v3.12.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/schollz/progressbar/compare/v3.12.0...v3.12.1

    v3.12.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/schollz/progressbar/compare/v3.11.0...v3.12.0

    Commits
    • c8cf82e update deps
    • 502db75 Merge pull request #146 from oerlikon/fix-full-width-test
    • b2ea7ac Fix TestOptionFullWidth not always working
    • f9d6be8 Add actual check to TestOptionSetElapsedTime
    • 23b4ee3 update deps
    • 82603fe Merge pull request #145 from oerlikon/fix-full-width
    • aef324e Add minor fix for full width mode
    • 6204e0e change branch for badge
    • 84d4294 Merge pull request #144 from oerlikon/fix-vet-tests
    • 56c5e5b Merge pull request #143 from oerlikon/use-strings-builder
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • build(deps): bump golang.org/x/text from 0.4.0 to 0.5.0 in /src

    build(deps): bump golang.org/x/text from 0.4.0 to 0.5.0 in /src

    Bumps golang.org/x/text from 0.4.0 to 0.5.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • `wsldl backup` fails with `4294967295` exit code

    `wsldl backup` fails with `4294967295` exit code

    Way to reproduce:

    1. Windows Server 2019
    2. PowerShell
    Invoke-WebRequest -Uri https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/x86_64/alpine-minirootfs-3.15.0-x86_64.tar.gz -OutFile alpine.tar.gz
    Invoke-WebRequest -Uri https://github.com/yuk7/wsldl/releases/download/21082800/wsldl.exe -OutFile wsldl.exe
    ./wsldl.exe install alpine.tar.gz
    ./wsldl.exe backup --tgz
    

    Here's GitHub Actions test run that reproduces this error: https://github.com/slonopotamus/wsldl-backup/runs/4752601188?check_suite_focus=true


    Note that I do NOT reproduce this on Windows 10 20H2 neither in WSL1 nor in WSL2 modes.

  • Add option for custom filename in `wsldl backup`

    Add option for custom filename in `wsldl backup`

    Currently, wsldl backup uses fixed output filename. It would be convenient if user could specify desired filename (including writing output to a different directory).

A command launcher 🚀 made with ❤️

Command Launcher A command launcher ?? made with ❤️ Why a command launcher? At Criteo, we have many teams who provides command line applications for d

Dec 18, 2022
Advanced ANSI style & color support for your terminal applications
Advanced ANSI style & color support for your terminal applications

termenv lets you safely use advanced styling options on the terminal. It gathers information about the terminal environment in terms of its ANSI & col

Dec 31, 2022
Extensible Go terminal spinner with advanced functions with 82 built-in spinners
Extensible Go terminal spinner with advanced functions with 82 built-in spinners

Features Start/Stop Customizable character sets (spinners) Custom spinner color, background Custom spinner text Restarting and reversing the spinner P

Aug 19, 2022
A pay later service to allow our users to buy goods from a merchant now, and then allow them to pay for those goods at a later date.

simple-pay-later A pay later service to allow our users to buy goods from a merchant now, and then allow them to pay for those goods at a later date.

Dec 11, 2021
Windows helpers for GnuPG tools suite - OpenSSH, WSL 1, WSL2, Cygwin, MSYS2, Git4Windows, Putty...
Windows helpers for GnuPG tools suite - OpenSSH, WSL 1, WSL2, Cygwin, MSYS2, Git4Windows, Putty...

win-gpg-agent Simple set of tools to make working with GPG and SSH keys easier on Windows 10. Windows 10 has ssh-agent service (with support for persi

Jan 6, 2023
Cli tool to save useful links to read it later
Cli tool to save useful links to read it later

lnk - Cli tool to save useful links still in development Usage lnk <new|list> [url] - new: creates a new link url: required params, which i

Jun 23, 2022
Quick and dirty test to compare MySQL perf between ARM64 & Rosetta MySQL on M1Pro mac

Quick and dirty test to compare MySQL perf between ARM64 & Rosetta MySQL on M1Pro mac

Nov 5, 2021
go-sche is a golang library that lets you schedule your task to be executed later.

go-sche is a golang library that lets you schedule your task to be executed later.

Dec 24, 2022
Nanovms running in Docker x86 container for M1 Mac ARM64.

Docker Ops This project is an attempt to enable Nanos unikernels to be managed by Ops on non-intel architectures such as the Mac M1 ARM64. Unless ther

Nov 22, 2021
VSCode Remote-SSH and configuration sharing on WSL.

Wslssh Wslssh forwards SSH command from VSCode Remote-SSH to WSL and enables SSH configuration sharing. Quick Start Guide Download or compile wslssh a

Dec 2, 2021
A WSL Library for Golang.

wsllib-go A WSL Library for Golang. Usage Get this package go get

Jun 13, 2022
oci-ccm custom build for both arm64 and amd64

OCI Cloud Controller Manager (CCM) oci-cloud-controller-manager is a Kubernetes Cloud Controller Manager implementation (or out-of-tree cloud-provider

Jan 18, 2022
k8s applications at my home (on arm64 devices e.g nvidia jet son nano)

k8s applications at my home (on arm64 devices e.g nvidia jet son nano)

Oct 9, 2022
Various tools for usage with Golang like installer, github tool and cloud features.

Gopei2 (Go Programming Environment Installer) Gopei shell install Go compiler, LiteIDE and configure for you the entire environment, variables, paths,

Dec 23, 2022
💻 A one-line installer for GitHub projects!
💻 A one-line installer for GitHub projects!

instl Instl is an installer that can install most GitHub projects on your system with a single command. Installation | Documentation | Contributing In

Jul 23, 2022
💻 A installer for GitHub projects!
💻 A installer for GitHub projects!

instl Instl is an installer that can install most GitHub projects on your system with a single command. Installation | Documentation | Contributing In

Nov 2, 2022
KissMP Installer for Windows
KissMP Installer for Windows

I'm using colours in the terminal which only Powershell supports so if you see weird characters in command prompt then that's why.

Dec 25, 2022
Windows Store Installer for VS Code

vscode-winsta11er This repo contains the code for a simple Go-based installer for the new Windows store. Releases To create a release, create and push

Dec 9, 2022
Raspberry Pi Archlinux Automated Offline Installer with Wi-Fi. Windows, Mac and more features coming.
Raspberry Pi Archlinux Automated Offline Installer with Wi-Fi. Windows, Mac and more features coming.

Raspberry Pi Archlinux Automated Installer with Wi-Fi. Windows, Mac and more features coming. Download Go to releases page and download the zip file f

Nov 22, 2022
An interactive menu for Magisk's module installer with tools to alter Android

JD's Toolbox I'll update this with some details later, just getting the source code out for now... LICENSE The source code for JD's Toolbox is release

Jan 24, 2022