Windows install

Basic WSL set up

Step 1: Enable WSL

Using Windows POWERSHELL (as Administrator):

Launch POWERSHELL as administrator: search powershell from Windows search

Enable-WindowsOptionalFeature -Online -FeatureName $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")

Step 2: Install Debian

Using CMD (console):

To open a CMD console search for cmd in the Windows search

wsl --set-default-version 2
wsl --install -d Debian

Step 3: Configure WSL to access the internet

Using LINUX (WSL) console:

To get the Linux console, open a CMD console, type: wsl

Step 4: Custom WSL configurations

@see https://docs.microsoft.com/en-us/windows/wsl/wsl-config

These configuration files tweak the WSL environments to enable a better developer experience based on a standard CoB laptop configuration (i.e. minimum i7 chip, 32GB RAM and SSD harddisk).

Using a POWERSHELL console from the windows host:

Using a LINUX console (WSL):

Step 5: install packages needed in WSL

Using LINUX console

Troubleshooting:

  • If you have accessing the internet from WSL first try RESTARTING the computer.

  • If that does not work, using a LINUX console try:

=> then restart the computer.

Step 6: Mount local folders into WSL.

Mount your development folders into WSL using the LINUX console:

  1. Replace c:/Users/xxxx/sources with the location in the windows host where you plan to keep all development source files. This is the folder where you will be cloning the CoB repos. If in doubt, create a sources folder in your windows home folder, and for the command above just replace xxxx with your CoB supplied EmployeeID/User Account.

  2. Replace yyyy with the accountname you used when you installed WSL (you can find this in the LINUX console by running cd ~ && pwd - the path displayed be in the format /home/accountname

Step 7: Install Docker Desktop for Windows

  1. Double click the installer to launch: + Click OK to accept non-windows app, + Select WSL2 as the backend (rather than Hyper-V)

  2. Docker desktop does not automatically start after the install, you need to start it the first time from the Start menu.

Setup other developer tooling

Add AWS-CLI credentials

Verify AWS is installed using LINUX console:

You should see an output something like:

aws-cli/2.7.4 Python/3.9.11 Linux/5.10.102.1 .....

Obtain your secret access keys for AWS from the AWS administrator, and then create the AWS credentials file using the LINUX console:

Alternatively. you could also create and edit the credentials file using vim which is installed in the WSL instance (from step 5 above).

Add SSH keys

Add your ssh keys to into your windows account (typically into a windows folder on you home drive) and then from a LINUX console:

Replace xxxx with your EmployeeID/User Account from CoB.

Install IDE:

  • Microsoft Visual Studio Code (VSC)

  • PHP Storm

Install Dashlane password manager

Knowledgebase

Restart the WSL service on Windows host

Using POWERSHELL:

Ensure windows has profile/policies loaded properly

Using POWERSHELL:

Mount the sources folder manually

Using LINUX console:

Replace xxxx with your CoB supplied EmployeeID/User Account.

Replace yyyy with the accountname you used when you installed WSL.

Un-mount the sources folder

Using LINUX console:

Replace yyyy with the accountname you used when you installed WSL.

Remount the sources folder

Using LINUX console:

Uninstall WSL:

Using Powershell (as Administrator):

Moving Home=>Office or Office=>Home

From Powershell console reinitialize WSL:

From LINUX (WSL) console reset the nameserver so you can access the internet:

Where X.X.X.X is the IPAddress: 8.8.8.8 (confirm if there should be a different address) when in the office and 10.241.241.70 when not on the city network but using a VPN.

Docker Fails to start

If, when restarting the computer, Docker fails to start and/or you get the following error when starting WSL:

The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

To fix this, perform the following steps.

Step 1: Using Powershell (ps) as Admin:

Step 2: Then using a CMD shell (as Admin)

Step 3: Restart Docker for Windows from the start menu.

Last updated

Was this helpful?