How to perform common tasks with WSL in Landscape¶
See also: WSL
This guide describes some common tasks you may perform with Landscape for managed WSL instances and Windows hosts.
If you haven’t registered your WSL hosts or WSL instances yet with Landscape, see How to set up Ubuntu Pro for WSL and register WSL hosts to Landscape and How to manage WSL instances.
Note that you need your computer IDs for many of these calls. If you don’t know the IDs of your child computers, visit how to get computer IDs.
Start WSL instances registered in your Landscape account¶
You can remotely start a list of one or more WSL instances via the Landscape API. To start a WSL instance, you need the legacy API. See Start Child Computers (Legacy API).
Shutdown WSL instances registered in your Landscape account¶
You can remotely shutdown a list of one or more WSL instances via the Landscape API. To shutdown WSL instances, you need the legacy API. See Stop Child Computers (Legacy API).
Set a default WSL instance¶
The “default instance” is the instance you log into if you run wsl in PowerShell from the Windows host. You can set your default child computer in the Landscape web portal or via the API.
Web portal¶
Go to Instances > Open the Windows host machine > WSL tab
Select the instance you want to make default > Open the dot menu > Set as default
This queues an activity to set that instance as default.
API¶
Within Landscape, you can only set a WSL instance as default with the legacy API. See Set Default Child Computer (Legacy API).
Remove a WSL instance¶
Web portal¶
To remove a WSL instance in the web portal:
Go to Instances > Open the Windows host (parent) machine > WSL tab
Select your instance, and click Uninstall
If you remove a WSL instance from its Windows host machine outside of Landscape, the WSL instance will also be removed from your Landscape account.
API¶
To remove a WSL instance via the API, you need the legacy API. See Delete Child Computers (Legacy API).
View WSL host machines and child computers¶
From the Landscape web portal, you can view all WSL host machines and their associated WSL instances (child computers).
To view all WSL host machines, go to Instances > Filters > OS > Windows
To view the WSL instances associated with a specific WSL host, go to Instances > Open the Windows host machine > WSL tab.
If you only want to view WSL machines, you can do this by applying tags to those machines. For more information, visit how to apply tags to computers.