Open PowerShell with Admin rights and run wsl --install -d Ubuntu-22.04
.
- open
Windows Features
> checkWindows Subsystem for Linux
>Ok
>Restart now
- open the Windows Store and install Windows Subsystem for Linux, if it isn't already installed
- open PowerShell with Admin rights and run
wsl --install -d Ubuntu-22.04
.
Start an Ubuntu terminal.
# Become root
sudo su -
# Install Docker
curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
sed -i -e 's/sleep 20/sleep 1/' /tmp/get-docker.sh
sh /tmp/get-docker.sh
# Enable iptables compatibility
echo 1 | update-alternatives --config iptables
# exit from being root
exit
# Add your user to the Docker group
sudo usermod -aG docker $USER
# Enable docker on startup
fgrep -q wsl.exe ~/.profile || {
cat <<'eof' >> ~/.profile
# check if docker is running
if grep -q "microsoft" /proc/version > /dev/null 2>&1; then
if service docker status 2>&1 | grep -q "is not running"; then
wsl.exe --distribution "${WSL_DISTRO_NAME}" --user root \
--exec /usr/sbin/service docker start > /dev/null 2>&1
fi
fi
eof
}
# close terminal window
exit
# open an Ubuntu terminal and run this command to confirm Docker works
docker container run --rm ubuntu:22.04 echo Hello, world