Skip to content

Instantly share code, notes, and snippets.

@Cenness
Created April 17, 2022 17:21
Show Gist options
  • Save Cenness/e4bc824d9af663f0eac7b51f1a6c297a to your computer and use it in GitHub Desktop.
Save Cenness/e4bc824d9af663f0eac7b51f1a6c297a to your computer and use it in GitHub Desktop.
Update WSL to v2 and install docker in debian

host cmd - elevated

Update to WSL2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart host.
This will take a while:

wsl --set-default-version 2
wsl --set-version Debian 2

nix

sudo apt remove docker docker-engine docker.io containerd runc
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common iptables -y
sudo touch /etc/fstab
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker $USER

host cmd - elevated

wsl.exe -t Debian

nix

sudo service docker start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment