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
- Windows 10 May 2020 (2004) update or later.
Tested configurations
- WSL version 2 with Ubuntu as a distro.
References
- Install Docker Engine in WSL 2 without Docker Desktop: https://medium.com/@rom.bruyere/docker-and-wsl2-without-docker-desktop-f529d15d9398
Procedure
-
Install WSL2 to your machine:
- 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
-
Restart your machine
-
Enable WSL:
Open Control Panel -> Programs-> Programs and Features -> Turn Windows Feature on or off -> Check Windows Subsystem for Linux
-
Open the Microsoft Store, search for Ubuntu and install it.
-
Check for Windows updates and make sure WSL has the last available version
-
Launch the ‘Ubuntu’ app from the Start Menu to get started.
-
Continue with the Linux distro setup as necessary with a username and password (we recommend using ''boa'' as a username).
-
Update Ubuntu:
-
sudo su -
apt update && apt upgrade
- Install Docker Engine on Ubuntu
- 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
- Install Docker:
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- Enable Docker to start automatically:
systemctl enable docker.service
systemctl enable containerd.service
- Start Docker engine:
systemctl start docker.service
- Add your Windows user to the docker-users group (this might not be needed anymore after the removal of the dependency with Docker Desktop):
- 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\ .