This guide describes how to build, import, and run X Linux on Windows Subsystem for Linux (WSL).
- Windows 10/11 with WSL enabled.
- Install WSL via PowerShell (Admin):
wsl --install
- Install WSL via PowerShell (Admin):
- A Linux environment (VM or another WSL distro) to run the build script, as
archisotools are required.
From this repository on your Linux machine:
chmod +x xbuildwsl.sh
sudo ./xbuildwsl.shThis will create the file out-wsl/x-YYYY.MM.DD.tar.zst.
Move the tarball to a location accessible by Windows (e.g., C:\Users\YourUser\Downloads\).
The built image is compressed with Zstandard (.tar.zst) for better compression. WSL does not support importing .tar.zst files directly. You need to decompress it first or pipe the content.
- if you have wsl2 installed:
wsl --import x C:\WSL\x x-2026.01.31.tar.zst- if you`re without wsl2 but also you want to specify this:
wsl --import x C:\WSL\x x-2026.01.31.tar.zst --version 2-
Decompress the file using a tool like 7-Zip or
zstdcommand line on Windows:zstd -d x-2024.10.01.tar.zst
This will produce
x-2024.10.01.tar. -
Import the
.tarfile:# Usage: wsl --import <DistroName> <InstallLocation> <PathToTarball> wsl --import x C:\WSL\x C:\Users\YourUser\Downloads\x-2024.10.01.tar
If you have zstd installed in another WSL distro or Windows, you might be able to pipe it, but Option A is safer.
- : Name you want to give the distro (e.g.,
x). - : Disk path where the VHDX file will be stored.
- : Path to the
.tarfile (after decompression).
Start your new distribution:
wsl -d x-linuxSince the import creates a root shell by default, you may want to create a regular user:
-
Create User:
useradd -m -G wheel -s /bin/bash yourusername passwd yourusername passwd # Set root password -
Configure Sudo: Uncomment the
%wheelgroup line in/etc/sudoers:EDITOR=nano visudo # Uncomment: %wheel ALL=(ALL:ALL) ALL -
Set Default User (Optional): Create a
/etc/wsl.conffile to auto-login as your user:[user] default=yourusername
Then restart WSL (
wsl --shutdownin PowerShell).
Enjoy X Linux on WSL!