Search notes:

wsl --import

wsl --import <Distro> <InstallLocation> <TarFile> [Options]
Recognized [options] are: --version <ver> and --vhdx.

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\

See also

Windows Subsystem for Linux

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1759408321, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/dirs/Windows/System32/wsl_exe/import(69): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78