Unable to start Docker in WSL2 using new Windows Terminal

I might be late but I faced similar problem and the solution was completely different.
I am posting here for someone if he/she gets similar issue.

Problem I Faced.

I setup wsl and docker in my new machine. I can not run dockerd in wsl2. As TheGameiswar suggest I can start the dockerd if I run the terminal as Admin but I still can not run any image.

The root cause

By default the wsl is version 1 (wsl 1) and docker required wsl2.

Solution

Set the default wsl version to 2

wsl --set-default-version 2

set the installed distro to wsl2

wsl --set-version  Ubuntu-20.04 2

I have tried a lot of steps based on the error below

can't initialize iptables table nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. (exit status 3) `

But Starting Terminal as administrator worked.Even though you run

sudo service docker start

The Terminal should be launched as Admin


sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

from https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269