Skip to content

Commit 687c74c

Browse files
authored
Couple more Readme formatting items (#10)
Readme improvements by @mjbear * Change distro install grammar * Fix `.wsl.` to remove the extra trailing period in the inline code fence * Change "remove container" to a numeric list item * Put the "temp" dir note into an Alert * Change nested virt sentence structure * (later) Move nested virt into an Alert * (later) Again change the nested virt sentence structure * Added a space after the greater than symbol in the Alert syntax `> [!NOTE]` * Standardize unordered list items to hyphens (fix bullets I probably set earlier 😐, oops) * Give images a name (as an added plus, it should aid in web page accessibility for anyone with a screen reader) * Indent some sub-content ([except Alerts](https://github.com/orgs/community/discussions/118296)) beneath related bullet points * Lint some long Markdown lines * Reformat Markdown tables based on the [GitHub docs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)
2 parents 7e54c56 + b994b68 commit 687c74c

File tree

1 file changed

+108
-66
lines changed

1 file changed

+108
-66
lines changed

README.md

Lines changed: 108 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ A WSL distribution designed for easy 'plug and play' usage with [Containerlab](h
99
> [Download](https://github.com/microsoft/WSL/releases/tag/2.4.4)
1010
1111

12-
| **OS** | **Supported** | **VM-based NOSes** |
13-
|:----------:|---------------|--------------------|
14-
| Windows 10 | Yes | No |
15-
| Windows 11 | Yes | Yes |
12+
| OS | Supported | VM-based NOSes |
13+
| :--------: | :---------: | :------------: |
14+
| Windows 10 | Yes | No |
15+
| Windows 11 | Yes | Yes |
1616

1717
We recommend using Windows Terminal for the best experience:
1818
- Windows 11 users: Windows Terminal is installed by default.
@@ -29,14 +29,16 @@ We recommend using Windows Terminal for the best experience:
2929
- If you have Docker Desktop installed. See [Docker Desktop](#docker-desktop).
3030
- Done! you can start labbing. (see [DevPod](#devpod) for a great way to lab).
3131

32-
>[!NOTE]
32+
> [!NOTE]
3333
> Default credentials are `clab:clab`
3434
3535
# WSL Installation
3636

37-
This distro makes use of WSL2, which requires that virtualization is enabled in your UEFI/BIOS.
37+
This distro makes use of WSL2, which requires that virtualization is enabled in
38+
your UEFI/BIOS.
3839

39-
This may appear as something called 'SVM (AMD-V)' or 'Intel VT-x' depending on your processor.
40+
This may appear as something called 'SVM (AMD-V)' or 'Intel VT-x' depending on
41+
your processor.
4042

4143
### Windows 11
4244

@@ -50,7 +52,7 @@ Restart your PC, and WSL2 should be installed.
5052

5153
### Windows 10
5254

53-
>[!TIP]
55+
> [!TIP]
5456
> Newer versions of Windows 10 allow usage of `wsl --install`, just like with Windows 11.
5557
5658
**Instructions are from ['Manual installation steps for older versions of WSL'.](https://learn.microsoft.com/en-us/windows/wsl/install-manual)**
@@ -63,9 +65,11 @@ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux
6365
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
6466
```
6567

66-
At this point restart your computer. After it has rebooted download the latest WSL2 kernel. [Download link](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi).
68+
At this point restart your computer. After it has rebooted download the latest
69+
WSL2 kernel. [Download link](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi).
6770

68-
Follow the installation wizard. After completion finally set WSL2 as the default version of WSL.
71+
Follow the installation wizard. After completion finally set WSL2 as the default
72+
version of WSL.
6973

7074
In PowerShell or command prompt paste the following:
7175

@@ -75,7 +79,8 @@ wsl --set-default-version 2
7579

7680
## Version Check
7781

78-
Run `wsl --version` in PowerShell or command prompt to ensure WSL2 is enabled. The WSL version number should be 2.4.4.0 or higher.
82+
Run `wsl --version` in PowerShell or command prompt to ensure WSL2 is enabled.
83+
The WSL version number should be 2.4.4.0 or higher.
7984

8085
```powershell
8186
PS C:\Users\Kaelem> wsl --version
@@ -90,32 +95,44 @@ Windows version: 10.0.19044.5131
9095

9196
# Distro Installation
9297

93-
**Ensure WSL is enabled and you have WSL 2.4.4 or newer. See the [version check](#version-check) instructions.**
98+
**Ensure WSL is enabled and you have WSL 2.4.4 or newer. See the
99+
[version check](#version-check) instructions.**
94100

95101

96102
1. Download the `.wsl` file from the [latest release](https://github.com/kaelemc/wsl-clab/releases/latest).
97103

98-
2. Double click the `.wsl` file. This will install the distribution.
104+
2. Double click the `.wsl` file to install the distribution.
99105

100-
> You may see an error that nested virtualization is not supported. See [vrnetlab](#vrnetlab-nested-virtualization).
106+
> [!NOTE]
107+
> If you see an error that nested virtualization is not supported, see the
108+
> [vrnetlab](#vrnetlab-nested-virtualization) section below.
101109
102-
3. From the start menu you can launch the distribution from a new 'Containerlab' shortcut which has been added.
110+
3. From the start menu you can launch the distribution from a new 'Containerlab'
111+
shortcut which has been added.
103112

104113
or in PowerShell/cmd you can execute:
105114

106115
```powershell
107116
wsl -d Containerlab
108117
```
109118
110-
4. On first launch you will be presented with an interactive menu to select what shell and prompt you would like.
119+
4. On first launch you will be presented with an interactive menu to select what
120+
shell and prompt you would like.
111121
112-
This menu will give you options of `zsh`, `bash` (with a fancy two-line prompt) or `bash` with the default prompt.
122+
This menu will give you options of `zsh`, `bash` (with a fancy two-line prompt)
123+
or `bash` with the default prompt.
113124
114-
You will also be presented with the choice to have the Fira Code [nerd font](https://www.nerdfonts.com/font-downloads) automatically installed on your system. **We recommend you install this font (especially if using `zsh` as your shell of choice)**.
125+
You will also be presented with the choice to have the Fira Code
126+
[nerd font](https://www.nerdfonts.com/font-downloads) automatically installed on
127+
your system. **We recommend you install this font (especially if using `zsh` as
128+
your shell of choice).**
115129
116-
Finally at the end SSH keys will be copied from your Windows host into Containerlab WSL to enable passwordless SSH. This is an integral step for [DevPod](#devpod) usage.
130+
Finally at the end SSH keys will be copied from your Windows host into
131+
Containerlab WSL to enable passwordless SSH. This is an integral step for
132+
[DevPod](#devpod) usage.
117133
118-
If no SSH keys are found on your machine, an RSA keypair will be automatically generated.
134+
If no SSH keys are found on your machine, an RSA keypair will be automatically
135+
generated.
119136
120137
To run the setup again, execute `/etc/oobe.sh` inside Containerlab WSL.
121138
@@ -143,107 +160,132 @@ Windows version: 10.0.19044.5131
143160
> [!IMPORTANT]
144161
> This feature is only supported on Windows 11.
145162
146-
You can run [vrnetlab (VM-based)](https://github.com/hellt/vrnetlab) nodes on top of WSL2 and use them in containerlab. Containerlab WSL is already configured so that nested virtualization is enabled on the distro side.
163+
You can run [vrnetlab (VM-based)](https://github.com/hellt/vrnetlab) nodes on
164+
top of WSL2 and use them in containerlab. Containerlab WSL is already configured
165+
so that nested virtualization is enabled on the distro side.
147166
148-
To use vrnetlab nodes on Containerlab WSL you must <u>ensure that nested virtualization is enabled globally in WSL</u>.
167+
To use vrnetlab nodes on Containerlab WSL you must <u>ensure that nested
168+
virtualization is enabled globally in WSL</u>.
149169
150-
- You can do this by opening the *'WSL Settings'* app, going to the *'Optional features'* tab and ensuring *'Enable nested virtualization'* is enabled.
170+
- You can do this by opening the *'WSL Settings'* app, going to the *'Optional
171+
features'* tab and ensuring *'Enable nested virtualization'* is enabled.
151172
152-
If you don't get any errors during installation or distro bootup saying that 'Nested virtualization is not supported on this machine.' You should be good to go.
173+
> [!NOTE]
174+
> You should be good to go if you don't get any errors during installation or
175+
> distro bootup saying that *'Nested virtualization is not supported on this
176+
> machine.'*
153177
154-
See the [containerlab user manual](https://containerlab.dev/manual/vrnetlab/) for more information about vrnetlab.
178+
See the [containerlab user manual](https://containerlab.dev/manual/vrnetlab/)
179+
for more information about vrnetlab.
155180
156181
# Performance Tuning
157182
158183
WSL2 runs as a VM. By default allocated resources are:
159184
160-
| **Resource** | **Default value** | **Description** |
161-
|:------------:|----------------------|---------------------------------------------------------------------------------------------------------------------|
162-
| vCPU | Logical thread count | If your processor has 8 cores and 16 threads, WSL2 will assign 16 threads to the WSL VM |
163-
| RAM | 50% of system memory | If you have 32Gb of RAM on your system, WSL will allocate 16Gb to the WSL VM. |
164-
| Disk | 1Tb | Regardless of disk size, the WSL VM will have a VHD with a maximum size of 1Tb. The disk is thin/sparse provisioned. |
185+
| Resource | Default value | Description |
186+
| :------: | -------------------- | :---------- |
187+
| vCPU | Logical thread count | If your processor has 8 cores and 16 threads, WSL2 will assign 16 threads to the WSL VM. |
188+
| RAM | 50% of system memory | If you have 32Gb of RAM on your system, WSL will allocate 16Gb to the WSL VM. |
189+
| Disk | 1Tb | Regardless of disk size, the WSL VM will have a VHD with a maximum size of 1Tb. The disk is thin/sparse provisioned. |
165190
166-
Despite the fairly generous resource allocation by default. WSL2 will not use 100% of the assigned resources.
191+
Despite the fairly generous resource allocation by default. WSL2 will not use
192+
100% of the assigned resources.
167193
168194
# Docker Desktop
169195
170-
If you have Docker desktop installed. You **must** ensure the integration with the Containerlab WSL distro is disabled, otherwise Containerlab will not work inside Containerlab WSL.
196+
If you have Docker desktop installed. You **must** ensure the integration with
197+
the Containerlab WSL distro is disabled, otherwise Containerlab will not work
198+
inside Containerlab WSL.
171199
172200
1. Open Docker Desktop window and go to settings (gear icon on the title bar)
173-
2. Under the 'Resources tab, enter the 'WSL integration' page
174-
3. Ensure 'Containerlab' has integration disabled
201+
1. Under the 'Resources tab, enter the 'WSL integration' page
202+
1. Ensure 'Containerlab' has integration disabled
175203
176-
![](./images/docker_desktop_integration.png)
204+
![Docker Desktop integration screenshot](./images/docker_desktop_integration.png)
177205
178206
# DevPod
179207
180-
[DevPod](https://devpod.sh/) is an awesome tool which can let us easily run labs which take advantage of Devcontainers, which overall can give a 'one-click' lab experience. It's like running the codespaces labs but on your local machine.
208+
[DevPod](https://devpod.sh/) is an awesome tool which can let us easily run labs
209+
which take advantage of Devcontainers, which overall can give a 'one-click' lab
210+
experience. It's like running the codespaces labs but on your local machine.
181211
182-
Check out [this video](https://www.youtube.com/watch?v=ceDrFx2K3jE) for more info.
212+
Check out [this video](https://www.youtube.com/watch?v=ceDrFx2K3jE) for more
213+
info.
183214
184-
Containerlab WSL was designed to support this lab experience out of the box. Just remember the following consideration:
215+
Containerlab WSL was designed to support this lab experience out of the box.
216+
Just remember the following consideration:
185217
186-
- When using DevPod, ensure Containerlab WSL is started (it does **not** automatically launch on Windows startup), you should leave the terminal window with Containerlab WSL open in the background.
218+
- When using DevPod, ensure Containerlab WSL is started (it does **not**
219+
automatically launch on Windows startup), you should leave the terminal window
220+
with Containerlab WSL open in the background.
187221
188-
A one-time configuration step is required. You must setup a provider in DevPod. For Containerlab WSL, create the **SSH** provider with the following values:
222+
A one-time configuration step is required. You must setup a provider in DevPod.
223+
For Containerlab WSL, create the **SSH** provider with the following values:
189224
190225
| Field | Value |
191226
|-------|------------------|
192227
| Host | `clab@localhost` |
193228
| Port | `2222` |
194229
195-
You can leave the other settings as the default values. See the screenshot below.
230+
You can leave the other settings as the default values. See the screenshot
231+
below.
196232
197-
After configuring the provider, you are done! You can now use one-click labs you see with the DevPod button, or configure the lab workspaces yourself.
233+
After configuring the provider, you are done! You can now use one-click labs you
234+
see with the DevPod button, or configure the lab workspaces yourself.
198235
199-
![](./images/devpod_settings.png)
236+
![DevPod settings screenshot](./images/devpod_settings.png)
200237
201238
# Developers
202239
203240
Development should be performed from another WSL distribution.
204241
205-
Clone the repository and build using the build script (you may have to `chmod +x` the script)
242+
Clone the repository and build using the build script (you may have to
243+
`chmod +x` the script)
206244
207245
```bash
208246
./build.sh
209247
```
210248

211-
This will place `clab.wsl` in `C:\temp`. Doubleclick to install the distribution.
249+
This will place `clab.wsl` in `C:\temp`. Doubleclick to install the
250+
distribution.
212251

213252
## Manual Steps
214253

215254
1. From inside a WSL distro Build the container:
216255

217-
```bash
218-
docker build . --tag ghcr.io/kaelemc/clab-wsl-debian
219-
```
256+
```bash
257+
docker build . --tag ghcr.io/kaelemc/clab-wsl-debian
258+
```
220259

221-
2. Run it and export the filesystem to a `.wsl.` file:
260+
2. Run it and export the filesystem to a `.wsl` file:
222261

223-
```bash
224-
docker run -t --name wsl_export ghcr.io/kaelemc/clab-wsl-debian ls /
225-
docker export wsl_export > /mnt/c/temp/clab.wsl
226-
```
262+
```bash
263+
docker run -t --name wsl_export ghcr.io/kaelemc/clab-wsl-debian ls /
264+
docker export wsl_export > /mnt/c/temp/clab.wsl
265+
```
227266

267+
> [!IMPORTANT]
228268
> Create the 'temp' directory on your C: drive if it doesn't exist.
229269
230-
Remove the container to ease rebuilding:
270+
3. Remove the container to ease rebuilding:
231271
232-
```bash
233-
docker rm wsl_export
234-
```
272+
```bash
273+
docker rm wsl_export
274+
```
235275
236-
3. Use it
276+
4. Use it
237277
238-
In your windows filesystem at `C:\temp` should be a file `clab.wsl`, double click to install. or use:
239-
240-
```powershell
241-
wsl --install --from-file clab.wsl
242-
```
278+
In your windows filesystem at `C:\temp` should be a file `clab.wsl`, double
279+
click to install. or use:
280+
281+
```powershell
282+
wsl --install --from-file clab.wsl
283+
```
243284
244285
# Uninstallation
245286
246-
Uninstall Containerlab WSL using the following command in PowerShell/command prompt:
287+
Uninstall Containerlab WSL using the following command in PowerShell/command
288+
prompt:
247289
248290
```powershell
249291
wsl --unregister Containerlab
@@ -257,5 +299,5 @@ wsl -l -v
257299
258300
# Reference Material
259301
260-
* https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro#export-the-tar-from-a-container
261-
* https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro
302+
- https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro#export-the-tar-from-a-container
303+
- https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro

0 commit comments

Comments
 (0)