Automated pipeline to generate a custom Manjaro Linux root filesystem for Windows Subsystem for Linux (WSL2) using Docker. The result is installable via the official wsl --import command.
- To use a pre-built rootfs: WSL2 enabled on Windows.
- To build from source: WSL2, Docker (e.g. Docker Desktop) installed and running.
From the project root:
-
Build the Docker image:
docker build -t manjaro-wsl -f docker/Dockerfile . -
Create a container from the image:
docker create --name manjaro manjaro-wsl
-
Export the root filesystem:
docker export manjaro | gzip > rootfs.tar.gz docker rm manjaro
Alternatively, run the build script (it performs these steps and outputs rootfs.tar.gz in output/):
./scripts/build.shArtifacts will be in the output/ directory: rootfs.tar.gz (root filesystem image).
-
Get the rootfs
Download a release and extractrootfs.tar.gz, or use the file from your localoutput/after building. -
Import into WSL (PowerShell)
wsl --import Manjaro C:\WSL\Manjaro C:\path\to\rootfs.tar.gz --version 2
Use the real path to your
rootfs.tar.gz. The--version 2option is required for WSL2. -
Start the distro
wsl -d Manjaro -
Verify systemd
Inside the distro:ps -p 1 -o comm=
Expected output:
systemd.
If the Manjaro distro does not show up or connect in VS Code Remote - WSL, it may have been registered with the wrong backend. Re-register with WSL2:
wsl --unregister Manjaro
wsl --import Manjaro C:\WSL\Manjaro C:\path\to\rootfs.tar.gz --version 2Then start the distro again with wsl -d Manjaro.
- Base image:
manjarolinux/base:latest - Default user:
manjaro - Passwordless sudo enabled for the default user
- Pre-configured Zsh environment
This project does not ship or rely on a custom installer/launcher (e.g. an .exe). Installation is done with the official WSL command:
wsl --importis the supported way to register a distribution in WSL.- It avoids dependency on internal WSL APIs and reduces compatibility issues (e.g. wrong mount backend, VS Code Remote not working).
- It keeps the project simple and predictable: we only produce a rootfs; Windows/WSL handle installation.
Want to turn this basic installation into a robust development machine (Zsh plugins, ASDF, Powerlevel10k)?
See the Post-Installation Guide.
