wsl --shutdown
sudo su -
sudo touch /etc/wsl.conf
sudo chmod 777 /etc/wsl.conf
sudo echo "[boot]
command=\"/etc/init.d/docker start\"" > /etc/wsl.conf
# You might setup some more suitable permissions than chmod 777, chmod was only given to ensure the test works
sudo groupadd docker
# sudo gpasswd -a $USER docker
sudo usermod $USER -aG docker
# sudo usermod -aG docker $USERNote: The content of
/etc/wsl.confshould look like:
[boot]
command="service docker start"