Skip to content

WSL Install Fails with Arithmetic Error for Custom Linux Distro #12805

@JersyJ

Description

@JersyJ

Windows Version

Microsoft Windows [Version 10.0.19045.5608]

WSL Version

2.4.13.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.167.4-1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

We have successfully built a custom Linux distribution for WSL in tar.gz (.wsl) format, which installs and works fully when using the command wsl --install --from-file <Path>, or by opening the file directly in the Explorer. However, we are encountering an issue when attempting to install the distribution through the enterprise distribution mechanism using wsl --install (https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro#adding-your-distribution-to-wsl---install-for-your-enterprise-or-business-group) .

We have created and deployed the DistributionInfo.json file, and we can list the distribution using the command wsl --list --online

PS C:\Users\redacted> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME                                      FRIENDLY NAME
Ubuntu-<redacted>                Ubuntu <redacted>
Ubuntu-22.04-<redacted>      Ubuntu 22.04 <redacted>

But when the user try to install the distro, the installation process begins successfully, an error occurs after the download reaches about 82%. The error message is as follows:

Downloading: Ubuntu <redacted>
Arithmetic result exceeded 32 bits. ============           ]
Error code: Wsl/InstallDistro/0x80070216

This error occurs only when using the remoteURL, not when using a local file:/// path.

It occurred to me that the issue might be related to the file size. The distribution file is over 4GB, specifically 4,442,940 KB, due to the large number of pre-installed tools.

Exact steps:

  1. Build a custom Linux distribution for WSL in tar.gz (.wsl) format, with a file size over 4GB.
  2. Create and deploy the DistributionInfo.json file for the distribution with the remote URL (not file:///) that points to distro file.
  3. Verify by the wsl --list --online command that the distribution is listed correctly.
  4. Attempt to install the distribution using the wsl --install <Distro> command
  5. The installation process fails

Expected Behavior

Downloading: Ubuntu
Installing:
Distribution successfully installed.

Actual Behavior

Downloading: Ubuntu
Arithmetic result exceeded 32 bits. ============ ]
Error code: Wsl/InstallDistro/0x80070216

Diagnostic Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions