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



from these threads:
https://github.com/microsoft/WSL/discussions/4872

더보기
sidgrafix |on 16 Oct 2020

Just ran into this myself this is what I had to do: WSL2 Debian with Docker (NOT using docker for windows)

first I had to add fstab file as for some reason didn't exist or couldn't be read with:

touch /etc/fstab

Then per dockerd at the end regarding network controller error I had to switch from nftables to iptables for nat with

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

Starting docker now should work!

service docker start

insert sudo before code if needed (I always run root)
Hope it helps


https://patrickwu.space/2021/03/09/wsl-solution-to-native-docker-daemon-not-starting/

더보기

Fortunately, Ubuntu still have a legacy version of iptables kept in the system. To do it, you can simlpy use update-alternatives --config iptables to change it:

$ sudo update-alternatives --config iptables
There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).

  Selection    Path                       Priority   Status
------------------------------------------------------------
* 0            /usr/sbin/iptables-nft      20        auto mode
  1            /usr/sbin/iptables-legacy   10        manual mode
  2            /usr/sbin/iptables-nft      20        manual mode

Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/sbin/iptables-legacy to provide /usr/sbin/iptables (iptables) in manual mode

Afterwards, restart the daemon and you will notice docker works normal again!

 

'IT' 카테고리의 다른 글

exiftool 사용법 (구글포토)  (0) 2022.07.13
GeoIP for Ubuntu  (0) 2022.07.13
linux bandwith limit  (0) 2022.07.13
Core DNS 설정  (0) 2022.07.13
SSH 터널링  (0) 2022.07.13

+ Recent posts