[SRU] Include wsl-pro-service into wsl-recommends

Bug #2136341 reported by Carlos Nihelton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-meta (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
New
Critical
Carlos Nihelton

Bug Description

[ Impact ]
* Users relying on Ubuntu Pro for WSL to automatically pro-attach their WSL instances any time, including first boot, as currently supported by Noble and later would be surprised with the lack of such feature in the upcoming images of Jammy and Focal to be published in the new format outside of the MS Store.

* Since we're already making the seeds of the older LTSes with the latest already published in that format compatible with each other, this is an opportunity to introduce this key offering in a less-surprising way.
* This is specially attractive to companies, where workloads are more likely to require older releases in specific cases, for which Ubuntu Pro is a necessary measure.
* For users not relying on Pro for WSL this unit is mostly inert, apart from some logs to the journal.

[ Test Plan ]

== Test 1: Existing instance ==
1. Record the system status (systemctl status) after a regular boot first to ensure the system was already healthy. If in doubt, create a new, fresh, instance of Jammy with no startup issues. The 'systemctl status' should consistently show 'running' (and not 'degraded').
2. Enable proposed and make sure to have wsl-pro-service implicitly installed by doing an 'apt update && apt upgrade -y';
3. Reboot the instance a few times by exiting out of it and running 'wsl.exe --shutdown' on Windows.
4. Restart the instance a few times, noticing whether boot time is affected or not by the updates and if the output of 'systemctl status' becomes 'degraded' or not.

The expected result is 'systemctl status' continuing to show 'running' and no correlation between boot time and the update.

== Test 2: New and functional system with Ubuntu Pro and Landscape automatically configured

NOTE: You'll need an image of Jammy for WSL in the new image format to proceed. Since we don't have
    yet any Jammy image publicly available either build one (using Launchpad LiveFSes for example) or
    download the one built by LP specifically to test this SRU, which already comes with proposed
    enabled. That image was built before ubuntu-meta 1.481.5 was accepted into proposed, so we'll
    use it as a template to create the final image used for testing.

    LINK TO THE IMAGE: https://launchpad.net/~ubuntu-wsl-dev/+livefs/ubuntu/jammy/wsl/+build/896695/+files/livecd.ubuntu-wsl.wsl

    IMAGE MANIFEST: https://launchpad.net/~ubuntu-wsl-dev/+livefs/ubuntu/jammy/wsl/+build/896695/+files/livecd.ubuntu-wsl.manifest

    BUILD LOG: https://launchpad.net/~ubuntu-wsl-dev/+livefs/ubuntu/jammy/wsl/+build/896695/+files/buildlog_ubuntu_jammy_amd64_wsl_BUILDING.txt.gz

NOTE: You'll also need a working Landscape server reachable from your Windows device, with which
you'll have Ubuntu Pro for WSL registered with. Landscape SaaS is an option as well as latest
versions of self-hosted Landscape (since 25.04).

1. Download the image from above.
2. Set up a new WSL instance from it but do not launch it to keep the resulting instance as pristine
   as possible:
   `wsl --install --name Factory --from-file <PATH-TO-THE-DOWNLOAD> --no-launch`
3. Disable systemd temporarily to prevent more changes to the system state:
   `wsl -d Factory vim /etc/wsl.conf` # Edit the `[boot].systemd` value to false
4. Update the system. As proposed is already enabled, this will update the `ubuntu-wsl` metapackage
   to the version 1.481.5.
   ```
    wsl -d Factory apt-get update
    wsl -d Factory apt-get install -y ubuntu-wsl
   ```
5. Observe that wsl-pro-service will be installed as part of the step above.
6. Follow the steps from the documentation links below to install and configure Ubuntu Pro for WSL,
    including a Landscape configuration:
    - Install Ubuntu Pro for WSL: https://documentation.ubuntu.com/wsl/stable/howto/set-up-up4w/
    - Configure it with Landscape: https://documentation.ubuntu.com/wsl/stable/howto/set-up-landscape-client/
7. Enable systemd back:
   `wsl -d Factory vim /etc/wsl.conf` # Edit the `[boot].systemd` value to true
8. Export an image from that system:
   `wsl --export Factory ./jammy.wsl`
9. Once export is complete, double-click on the new image to register a new WSL instance from it.
10. Follow the prompts to complete registration of the new `Ubuntu-22.04` instance.
11. When set up completes, you'll get a shell into that instance. Confirm that Pro attached:
    `sudo pro status`
12. Check that the Landscape configuration is present and complete, including the computer_title
    field matching the instance name (Ubuntu-22.04 in this case, the other values will vary
    depending on the configuration you supplied to the Windows app):

    ```
    u@pc:/home/u$ sudo cat /etc/landscape/client.conf
    [sudo] password for s:
    [client]
    log_level = info
    url = https://landscape.canonical.com/message-system
    ping_url = http://landscape.canonical.com/ping
    data_path = /var/lib/landscape/client
    account_name = <REDACTED>
    computer_title = Ubuntu-22.04
    hostagent_uid = <REDACTED>
    registration_key = <REDACTED>
    tags = wsl
    ```

The expected result is having wsl-pro-service preinstalled in the exported image and acting on first
boot to complete the Landscape configuration.

NOTE: Specific tests of wsl-pro-service were carried out in its own SRU. Refer to LP: https://bugs.launchpad.net/ubuntu/+source/wsl-pro-service/+bug/2133940.

[ Where problems could occur ]
* Since wsl-pro-service ships a systemd unit, boot time could increased or system startup could become degraded (as seen by 'systemctl status') if the unit and binary were not carefully crafted with that in mind.

[ Other Info ]

* This SRU completes the work to make Jammy for WSL images compatible with Noble and later.
* The changes herein proposed are a direct effect of running the './update' script part of the 'ubuntu-meta' source package (the standard way to synchronize it with the current state of the seed), excluding changes to the desktop meta-package for RISC-V because they are unrelated to WSL and I'm not aware of the needs for such changes. If they are needed, in fact they must be presented in a specific SRU.

Related branches

description: updated
Changed in ubuntu-meta (Ubuntu Jammy):
status: New → Confirmed
Changed in ubuntu-meta (Ubuntu):
importance: Undecided → Critical
Changed in ubuntu-meta (Ubuntu Jammy):
importance: Undecided → Critical
Changed in ubuntu-meta (Ubuntu):
status: New → Confirmed
Changed in ubuntu-meta (Ubuntu):
status: Confirmed → Fix Released
importance: Critical → Undecided
Changed in ubuntu-meta (Ubuntu Jammy):
assignee: nobody → Carlos Nihelton (cnihelton)
Revision history for this message
Nick Rosbrook (enr0n) wrote :

It's unclear to me what exactly the test plan is exercising. While it is one way to make sure that wsl-pro.service is *not failing*, it doesn't at all check that it is *working as expected*.

The [Impact] section suggests that this enables Ubuntu Pro enablement/attachment for new WSL images. Shouldn't that functionality be exercised here in some way?

> For users not relying on Pro for WSL this unit is mostly inert, apart from frequent logs to the journal.

How frequent are you talking about here? Is it excessively noisy? If so, that represents a sort of regression to many users.

Changed in ubuntu-meta (Ubuntu Jammy):
status: Confirmed → Incomplete
description: updated
Revision history for this message
Carlos Nihelton (cnihelton) wrote :

>> For users not relying on Pro for WSL this unit is mostly inert, apart from frequent logs to the journal.

> How frequent are you talking about here? Is it excessively noisy? If so, that represents a sort of regression to many users.

It was excessively noisy in the past but we made some changes not so long ago to address that, which were part of the SRU #2106757.

---

I edited the bug description to improve the testing story. The test which you identified as unclear was kept to make sure that an `apt upgrade` wouldn't harm existing instances and a new test case was added to exercise the role of wsl-pro-service during first boot. Unfortunately the new test case is complex, I had to repeat it a few times to make sure it's doable.

Changed in ubuntu-meta (Ubuntu Jammy):
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.