How to register WSL instances to Landscape

See also: WSL API methods

This document is for Landscape beta.

You must have a Windows host machine registered with Landscape before making any Windows Subsystem for Linux (WSL) instances. To register a new WSL host with Landscape, visit how to register WSL hosts to Landscape.

This guide describes how to create and register new WSL instances to Landscape.

Contents:

Landscape web portal

Only one instance of each Ubuntu image can be created per Windows host machine using the web portal.

You can register new WSL instances from the Landscape web portal. To do this:

  1. Navigate to the Computers page in the header
  2. Click the name of the Windows machine that will host the new WSL instance
  3. Click Install new above the WSL Instances table
  4. Select the Ubuntu image that will be installed on the new WSL instance under Instance Type
  5. Click Submit

Once this process is complete, your new WSL instance will appear in the Select computers list and in the Windows host machine’s Info tab.

Landscape API

You can register new WSL instances via the Landscape API. To register new WSL instances with Landscape, make an API call such as:

?action=CreateChildComputer&parent_id=20&computer_name=Ubuntu

The parent_id is assigned by Landscape. You assign computer_name as the name of the child computer you’re creating. If you don’t know the ID of your parent computer, visit how to get computer IDs.

Landscape API and cloud-init

Cloud-init configuration isn’t supported yet by Ubuntu Pro for Windows. This feature is planned in a future beta release.

To register new WSL instances based on cloud-init configurations, make an API call such as:

?action=CreateChildComputer&parent_id=20&computer_name=Ubuntu&cloud_init=<b64 encoded cloud_init file>

Or:

?action=CreateChildComputer&parent_id=20&computer_name=Ubuntu&data_id=data-id&token=vault-token

If your cloud-init file is not located in a vault, you can specify it in cloud_init. If it’s located in a vault, you can specify the name of the vault secret in data_id and the authentication token to be passed to the secrets manager in token.

Specifying both a cloud-init file and a vault secret will result in an error.