Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .xz archive support to wsl.exe --import to improve microsoft/WSL-DistroLauncher #6056

Open
jonstanley opened this issue Oct 8, 2020 · 3 comments
Labels

Comments

@jonstanley
Copy link

When using microsoft/WSL-DistroLauncher, an archive of the distro filesystem must be provided at install.tar and can be GZIP compressed, install.tar.gz or install.tgz

It would improve ease of use (archives are already compressed with XZ) plus reduce storage and bandwidth requirements if XZ compressed can be supported by the import command, users modifying microsoft/WSL-DistroLauncher wouldn't then be bound to using on GZIP compression

user@host:/home/user/Gentoo$ gzip -l install.tar.gz
         compressed        uncompressed  ratio uncompressed_name
          324853255          1080278906  69.9% install.tar
user@host:/home/user/Gentoo$ xz -l install.tar.xz
Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename
    1       1    169.0 MiB  1,030.2 MiB  0.164  CRC64   install.tar.xz

A ~1GiB install.tar is nearly 50% smaller when compressed with xz versus gzip (both at -9)

@duongdominhchau
Copy link

duongdominhchau commented Nov 9, 2022

I haven't tried importing xz tarball yet, but I tried zstd tarball and WSL can import that successfully. zstd is supposed to be superior compared to xz, the compressed tarball may not be smaller, but the compression/decompression speed is better. You can also trade speed with space by increasing the compression level (e.g: zstd -5 wsl_distro.tar instead of the default level of 3 in zstd wsl_distro.tar), so, give it a try maybe?

My wsl --version:

WSL version: 0.70.4.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.675

I use Windows 11 btw, don't know why Windows version is 10 here 🤷

@lucastheisen
Copy link

I tried the rockylinux .tar.xz today and it worked. I'm on a recent update of Windows 11 after running wsl --update, so currently:

PS C:\Users\lucas\git\lucastheisen-dev-bootstrap> wsl --version
WSL version: 1.1.6.0
Kernel version: 5.15.90.1
WSLg version: 1.0.50
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1413

This issue can probably be closed out, but I would suggest updating the wsl --help (and probably online help) to mention that .tar.xz is supported.

@Vinfall
Copy link

Vinfall commented Apr 12, 2024

I can confirm importing .tar.gz, .tar.xz & .tar.zst works perfectly as of latest 2.1.5.

For zstd, you can export like (cmd is called to avoid a PowerShell pipe bug):

cmd /c "wsl --export void-glibc - | zstd -T4 -o void-glibc-$(Get-Date -UFormat "%Y%m%d").tar.zst"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants