From 5c2f99cf4a023e84a65eff6e80227dba7c599d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edu=20G=C3=B3mez=20Escandell?= Date: Thu, 26 Oct 2023 13:04:29 +0200 Subject: [PATCH] Update documentation --- docs/03-restart.md | 37 +++++++++++++++++++ docs/04-attach-landscape.md | 26 ------------- docs/{03-enable-pro.md => 04-enable-pro.md} | 4 ++ docs/05-attach-landscape.md | 13 +++++++ ...6-windows-agent-command-line-reference.md} | 0 ...wsl-pro-service-command-line-reference.md} | 0 docs/index.md | 9 +++-- 7 files changed, 59 insertions(+), 30 deletions(-) create mode 100644 docs/03-restart.md delete mode 100644 docs/04-attach-landscape.md rename docs/{03-enable-pro.md => 04-enable-pro.md} (59%) create mode 100644 docs/05-attach-landscape.md rename docs/{05-windows-agent-command-line-reference.md => 06-windows-agent-command-line-reference.md} (100%) rename docs/{06-wsl-pro-service-command-line-reference.md => 07-wsl-pro-service-command-line-reference.md} (100%) diff --git a/docs/03-restart.md b/docs/03-restart.md new file mode 100644 index 000000000..802ba5e33 --- /dev/null +++ b/docs/03-restart.md @@ -0,0 +1,37 @@ +# How to restart Ubuntu Pro for Windows +Some configuration changes only apply when you restart Ubuntu Pro for Windows. Here is a guide on how to restart it. + +## Option 1: Restart your machine +This is the simple one. If you're not in a hurry to see the configuration updated, just wait until next time you boot your machine. + +## Option 2: Restart only Ubuntu Pro For Windows +1. Stop the agent: + ```powershell + Get-Process -Name Ubuntu-Pro-Agent | Stop-Process + ``` +2. Stop the distro, or distros you installed WSL-Pro-Service in: + ```powershell + wsl --terminate DISTRO_NAME_1 + wsl --terminate DISTRO_NAME_2 + # etc. + + # Alternatively, stop all distros: + wsl --shutdown + ``` +7. Start the agent again: + 1. Open the start Menu and search for "Ubuntu Pro For Windows". + 2. The GUI should start. + 3. Wait a minute. + 4. Click on "Click to restart it". +8. Start the distro, or distros you installed WSL-Pro-Service in. + +# How to reset Ubuntu Pro for Windows back to factory settings +If you want to restart UP4W with factory settings, do: +1. Stop the agent and WSL: + ```powershell + Get-Process -Name "Ubuntu-Pro-Agent" | Stop-Process` + wsl --shutdown + ``` +1. Remove folder `$env:LocalAppData\UbuntuPro`. +2. Remove registry key `HKEY_CURRENT_USER\Software\Canonical\UbuntuPro`. +3. You're done. Next time you start the GUI it'll be like a fresh install \ No newline at end of file diff --git a/docs/04-attach-landscape.md b/docs/04-attach-landscape.md deleted file mode 100644 index 107ef6bfa..000000000 --- a/docs/04-attach-landscape.md +++ /dev/null @@ -1,26 +0,0 @@ -# How to auto-register WSL distros to Landscape with UP4W -You can use a private Landscape instance (different from [landscape.canonical.com](https://landscape.canonical.com)). It must be over HTTP, as using certificates is not yet supported. To do so, follow these steps: -1. Press Windows+R. -2. Write `regedit.exe` and enter. -3. Go to `HKEY_CURRENT_USER\Software\Canonical\UbuntuPro`. -4. There are two relevant fields: - - `LandscapeAgentURL` should contain the URL where the Landscape Host-agent server is hosted. - - `LandscapeClientConfig` should contain the contents of the YAML file with the settings, such as the [example from the Landscape repository](https://github.com/canonical/landscape-client/blob/master/example.conf). -5. To edit any of the fields, right-click and Edit. -6. If you need more than one line, delete the field and create a new one with the same name, and type `Multi-String Value`. -7. The changes will take effect next time you start the machine. If you want them to be applied now, follow the next steps. Otherwise, you're done. All new distros will automatically attach to Landscape. -8. Stop the agent: - ```powershell - Get-Process -Name Ubuntu-Pro-Agent | Stop-Process - ``` -9. Start the agent again: - 1. Open the start Menu and search for "Ubuntu Pro For Windows". - 2. The GUI should start. - 3. Wait a minute. - 4. Click on "Click to restart it". -10. Stop the distro you installed WSL-Pro-Service in: - ```powershell - wsl --terminate DISTRO_NAME - ``` -11. Start the distro you installed WSL-Pro-Service in. -12. You should see a new "pending computer authorisation" in your Landscape dashboard. \ No newline at end of file diff --git a/docs/03-enable-pro.md b/docs/04-enable-pro.md similarity index 59% rename from docs/03-enable-pro.md rename to docs/04-enable-pro.md index e4c308195..b50f4e598 100644 --- a/docs/03-enable-pro.md +++ b/docs/04-enable-pro.md @@ -10,3 +10,7 @@ pro status ``` +## Organisational pro enablement +1. Find registry key `HKEY_CURRENT_USER\Software\Canonical\UbuntuPro`, field `ProTokenOrg`. +2. Write your Ubuntu Pro Token into the registry key +3. The changes will take effect next time you start Ubuntu Pro For Windows. All new distros will automatically become pro-enabled. If you want them to be applied now, follow the steps on how to restart Ubuntu Pro For Windows. Otherwise, you're done. \ No newline at end of file diff --git a/docs/05-attach-landscape.md b/docs/05-attach-landscape.md new file mode 100644 index 000000000..a9bfa1b4d --- /dev/null +++ b/docs/05-attach-landscape.md @@ -0,0 +1,13 @@ +# How to auto-register WSL distros to Landscape with UP4W +You can use a private Landscape instance (different from [landscape.canonical.com](https://landscape.canonical.com)). It must be over HTTP, as using certificates is not yet supported. To do so, follow these steps: +1. Find registry key `HKEY_CURRENT_USER\Software\Canonical\UbuntuPro`, field `LandscapeClientConfig`. +2. Copy the contents of the Landscape configuration file into the registry key: + ```ini + [host] + url= The URL of the Landscape hostagent API + + [client] + # The configuration for the WSL client. See an example here + # https://github.com/canonical/landscape-client/blob/master/example.conf + ``` +3. The changes will take effect next time you start Ubuntu Pro For Windows. All new distros will automatically become landscape-enabled. If you want them to be applied now, follow the steps on how to restart Ubuntu Pro For Windows. Otherwise, you're done. diff --git a/docs/05-windows-agent-command-line-reference.md b/docs/06-windows-agent-command-line-reference.md similarity index 100% rename from docs/05-windows-agent-command-line-reference.md rename to docs/06-windows-agent-command-line-reference.md diff --git a/docs/06-wsl-pro-service-command-line-reference.md b/docs/07-wsl-pro-service-command-line-reference.md similarity index 100% rename from docs/06-wsl-pro-service-command-line-reference.md rename to docs/07-wsl-pro-service-command-line-reference.md diff --git a/docs/index.md b/docs/index.md index f9492904f..60998d90c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,8 +19,9 @@ Thinking about using Ubuntu Pro for Windows for your next project? Get in touch! :hidden: Install <02-install> -Auto-enable Ubuntu Pro <03-enable-pro> -Auto-attach distros to Landscape <04-attach-landscape> -Windows Agent command line interface <05-windows-agent-command-line-reference> -WSL Pro Service command line interface <06-wsl-pro-service-command-line-reference> +Restart Ubuntu Pro For Windows <03-restart> +Auto-enable Ubuntu Pro <04-enable-pro> +Auto-attach distros to Landscape <05-attach-landscape> +Windows Agent command line interface <06-windows-agent-command-line-reference> +WSL Pro Service command line interface <07-wsl-pro-service-command-line-reference> ```