@wsl-images/wslb-cli
v1.0.1
Published
WSLB commandline tool built with Go
Readme
WSLB - Windows Subsystem for Linux Builder
WSLB is a command-line tool that simplifies building and installing Windows Subsystem for Linux (WSL) distributions from Docker images.
Features
- Build custom WSL distributions from any Docker image
- Install WSL distributions directly from Docker image URLs
- Manage WSL distributions (list, stop, remove)
Installation
Prerequisites
- Windows operating system with WSL enabled
- Docker installed and running
- Go 1.16 or later (for building from source)
Install With Go
go install -a github.com/wsl-images/wslb@latestInstall With Scoop
scoop bucket add wsl-images-bucket https://github.com/wsl-images/wsl-images-bucket
scoop install wsl-images-bucket/wslb Antivirus and Anti Malware Problems with Scoop
Add-MpPreference -ExclusionPath "$($env:programdata)\scoop", "$($env:scoop)"To Undo this change
Remove-MpPreference -ExclusionPath "$($env:programdata)\scoop", "$($env:scoop)"Building from source
git clone https://github.com/wsl-images/wslb.git
cd wslb
./build.shThe executable will be available in the bin directory.
Usage
Build a WSL distribution from a Docker image
wslb build ubuntu:20.04This will create a .wsl file in the current directory.
Options:
-o, --output: Specify output directory (default: current directory)
Install a WSL distribution
From Docker image URL:
wslb install ubuntu:20.04From a pre-built .wsl file:
wslb install -f ./ubuntu.wslOptions:
-n, --name: Specify a custom name for the WSL distribution-f, --file: Path to a pre-built .wsl file
List WSL distributions
wslb ls
# or
wslb listOptions:
--all: List all distributions, including those being installed or uninstalled--running: List only distributions that are currently running-q, --quiet: Only show distribution names-v, --verbose: Show detailed information about all distributions-o, --online: Display a list of available distributions for install
Remove a WSL distribution
wslb rm <Distro>Unregisters the distribution and deletes the root filesystem.
Stop a WSL distribution
wslb stop <Distro>Terminates the specified WSL distribution.
Shutdown all WSL distributions
wslb shutdownImmediately terminates all running distributions and the WSL 2 lightweight utility virtual machine.
Show WSL status
wslb statusShows the status of Windows Subsystem for Linux.
Display version information
wslb versionPrints the version information of WSLB.
Examples
Build Ubuntu 22.04 and save to a specific directory:
wslb build ubuntu:22.04 -o ~/wsl-imagesInstall Debian with a custom name:
wslb install debian:bullseye -n MyDebianWSLList all running WSL distributions:
wslb ls --runningLogs
Logs are stored in $HOME/.wslb/logs/wslb.log
