1.1.2.1 Prepare WSL2 environment - Daniel-Brosnan-Blazquez/vboa GitHub Wiki

Introduction

This procedure covers the action to prepare the WSL2 environment for developing BOA.

Pre-conditions

  1. Windows 10 May 2020 (2004) update or later.

Tested configurations

  1. WSL version 2 with Ubuntu as a distro.

References

  1. Install Docker Engine in WSL 2 without Docker Desktop: https://medium.com/@rom.bruyere/docker-and-wsl2-without-docker-desktop-f529d15d9398

Procedure

  1. Install WSL2 to your machine:

    1. Open CMD as administrator and execute the following command:
wsl --install

Note: if the command shows this output:

Installing: Windows Subsystem for Linux
A specified logon session does not exist. It may already have been terminated.

Check that HyperV is enabled in the Windows features:

Open Control Panel -> Programs-> Programs and Features -> Turn Windows Feature on or off -> HyperV

And, try again the step a as user administrator

  1. Restart your machine

  2. Enable WSL:

    Open Control Panel -> Programs-> Programs and Features -> Turn Windows Feature on or off -> Check Windows Subsystem for Linux

    1. Open the Microsoft Store, search for Ubuntu and install it.

    2. Check for Windows updates and make sure WSL has the last available version

    3. Launch the ‘Ubuntu’ app from the  Start Menu  to get started.

    4. Continue with the Linux distro setup as necessary with a username and password (we recommend using ''boa'' as a username).

    5. Update Ubuntu:

sudo su -
apt update && apt upgrade
  1. Install Docker Engine on Ubuntu
    1. Add Docker repository:
apt-get install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
 
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
  1. Install Docker:
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  1. Enable Docker to start automatically:
systemctl enable docker.service
systemctl enable containerd.service
  1. Start Docker engine:
systemctl start docker.service
  1. Add your Windows user to the docker-users group (this might not be needed anymore after the removal of the dependency with Docker Desktop):
    1. Open PowerShell as administrator and execute the following command:
net localgroup docker-users "your-user-id" /ADD

Note: your-user-id is your local Windows user name, the one at the folder name under C:\Users\ .