WslRegisterDistribution function

Registers a new distribution with the Windows Subsystem for Linux (WSL).


HRESULT WslRegisterDistribution(
  PCWSTR distributionName,
  PCWSTR tarGzFilename



Unique name representing a distribution (for example, "Fabrikam.Distro.10.01").


Full path to a .tar.gz file containing the file system of the distribution to register.

Return Value

This function can return one of the following values. Use the SUCCEEDED and FAILED macros to test the return value of this function.

Return Code Description
S_OK Distribution successfully registered with the Windows Subsystem for Linux.
HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) Failed because a distribution with this name has already been registered.


Target Platform Windows
Header wslapi.h
Library Wslapi.lib
DLL Api-ms-win-wsl-api-l1-1-0.dll