Importing a Debian distro
We need a
root filesystem (rootfs) to be imported. Links to such root fs can be found in
this github repository.
The rootfs is found in a
branch named after the target architecture, for example
dist-amd64.
In this branch, we find directories for debian releases (bookworm, bullseye, buster etc.). We want to import a bookworm release, so we go to the corresponding directory.
The directory has a link to the wanted
rootfs.tar.xz
file. We're interested in the
raw link. This raw link is what we're interested in downloading. We use
PowerShell:
PS:> $progressPreference = 'SilentlyContinue'
PS:> invoke-webRequest https://github.com/debuerreotype/docker-debian-artifacts/blob/dist-amd64/bookworm/rootfs.tar.xz -out $env:temp/rootfs.tar.xz
The root file system is now ready to be imported. We choose the name debian-imported for the distro:
PS:> wsl --import debian-imported d:\wsl\debian-imported $env:temp/rootfs.tar.xz --version 2
Import in progress, this may take a few minutes.
The operation completed successfully.
Starting the distro:
PS:> wsl -d debian-imported
When not used anymore, we dispose of the distro:
PS:> wsl --unregister debian-imported
PS:> remove-item -rec -fo D:\wsl\debian-imported\